From 132d3236bb884433bf94e961f6d32264e0334aec Mon Sep 17 00:00:00 2001 From: ornitorrincos Date: Tue, 18 Aug 2026 12:15:05 +0200 Subject: --- bootloader/other.c | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 bootloader/other.c (limited to 'bootloader/other.c') 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 +#include +#include + +#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; +} -- cgit v1.2.3-70-g09d2