HariboteOS/day27/kernel/elf.c
2021-06-01 20:44:39 +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;
}