HariboteOS/day26/elf.c
2021-05-27 23:28:49 +08:00

7 lines
218 B
C

#include "elf.h"
int elf32_validate(Elf32_Ehdr *hdr) {
return hdr->e_ident[EI_MAG0] == ELFMAG0 && hdr->e_ident[EI_MAG1] == ELFMAG1 &&
hdr->e_ident[EI_MAG2] == ELFMAG2 && hdr->e_ident[EI_MAG3] == ELFMAG3;
}