| 9 | #include <math.h> |
| 10 | |
| 11 | int VerifyELF(void* elf){ |
| 12 | elf64_header_t elfHdr = *(elf64_header_t*)elf; |
| 13 | |
| 14 | char id[4]; |
| 15 | strncpy(id, (char*)elfHdr.id + 1, 3); |
| 16 | if(strncmp("ELF", id, 3)){ |
| 17 | Log::Warning("Invalid ELF Header: %x, %x, %x (%c%c%c)", id[0], id[1], id[2], id[0], id[1], id[2]); |
| 18 | return 0; |
| 19 | } else return 1; |
| 20 | } |
| 21 | |
| 22 | elf_info_t LoadELFSegments(process_t* proc, void* _elf, uintptr_t base){ |
| 23 | uint8_t* elf = reinterpret_cast<uint8_t*>(_elf); |
no test coverage detected