blob: f1ceb2de5b4ad209f6fc3981faf47e297e0ca101 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
#include <elf.h>
#include <common.h>
int elf_chk_header(struct elf_header *header) {
uint32_t magic_chk;
memcpy(&magic_chk, header->e_ident, sizeof(uint32_t));
if (magic_chk != ltohi(ELF_MAGIC_LE)) {
return -1;
}
return 0;
}
|