1*823f0493SLoGin #pragma once 2*823f0493SLoGin 3*823f0493SLoGin #include <elf.h> 4*823f0493SLoGin #include "types.h" 5*823f0493SLoGin 6*823f0493SLoGin struct payload_info; 7*823f0493SLoGin 8*823f0493SLoGin bool elf_check(const void *payload_start, u64 payload_size); 9*823f0493SLoGin 10*823f0493SLoGin /// @brief 获取ELF文件头 11*823f0493SLoGin /// @param payload_start 文件起始地址 12*823f0493SLoGin /// @param payload_size 文件大小 13*823f0493SLoGin /// @param ehdr 返回的ELF文件头 14*823f0493SLoGin /// @return 15*823f0493SLoGin efi_status_t elf_get_header(const void *payload_start, u64 payload_size, 16*823f0493SLoGin Elf64_Ehdr **ehdr); 17*823f0493SLoGin 18*823f0493SLoGin efi_status_t load_elf(struct payload_info *payload_info);