cybersecurity · intermediate · ~15 min · safe pentest lab
Recognise the ELF magic number.
ELF files start with the magic bytes 0x7F 'E' 'L' 'F'. Implement int is_elf(const unsigned char *b) returning 1 if the first four bytes match, else 0.
int is_elf(const unsigned char *b) {
/* TODO */
return 0;
}
Solve this exercise in the browser editor — compile and run against the test harness, no setup required.