HariboteOS/day22/elf.c
2021-05-19 00:09:22 +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;
}