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