diff options
Diffstat (limited to '')
| -rw-r--r-- | bootloader/other.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/bootloader/other.c b/bootloader/other.c new file mode 100644 index 0000000..9286dac --- /dev/null +++ b/bootloader/other.c @@ -0,0 +1,42 @@ +#include <efi.h> +#include <efilib.h> +#include <efidef.h> + +#include "other.h" + +void PrintImageAddr(EFI_HANDLE image) +{ + EFI_LOADED_IMAGE *loaded_image = NULL; + EFI_STATUS status; + + status = uefi_call_wrapper(BS->HandleProtocol, + 3, + image, + &LoadedImageProtocol, + (void **)&loaded_image); + + if (EFI_ERROR(status)) + { + Print(L"handleprotocol: %r\n", status); + } + + Print(L"Image base: 0x%lx\n", loaded_image->ImageBase); +} + +bool AreEqual(void* lhs, void* rhs, uint64_t size) +{ + char* clhs = (char*)lhs; + char* crhs = (char*)rhs; + + bool equal = true; + + for(int i = 0; i < size; i++) + { + if(clhs[i] != crhs[i]) + { + equal = false; + } + } + + return equal; +} |
