diff options
Diffstat (limited to '')
| -rw-r--r-- | misc-host/ELF/ELF-loader-test/bootloader_compat.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/misc-host/ELF/ELF-loader-test/bootloader_compat.cpp b/misc-host/ELF/ELF-loader-test/bootloader_compat.cpp new file mode 100644 index 0000000..038e597 --- /dev/null +++ b/misc-host/ELF/ELF-loader-test/bootloader_compat.cpp @@ -0,0 +1,18 @@ +#include "bootloader_compat.h" +#include <stdio.h> +#include <stdlib.h> + +UEFIPrint Print = wprintf; + +void * EFIAPI LoadFile(char * name, UINTN memtype) +{ + FILE * f = fopen(name, "rb"); + fseek(f, 0, SEEK_END); + long fsize = ftell(f); + fseek(f, 0, SEEK_SET); + char * mem = (char*)malloc(fsize); + fread(mem, fsize, 1, f); + fclose(f); + + return mem; +} |
