1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 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; }