HariboteOS/day23/elf.c
2021-05-20 21:57:48 +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;
}