cybersecurity · intermediate · ~15 min · safe pentest lab
Read the ELF class field.
The EI_CLASS byte at offset 4 is 1 for 32-bit, 2 for 64-bit. Implement int elf_is_64bit(const unsigned char *b) returning 1 if b[4] == 2, else 0.
int elf_is_64bit(const unsigned char *b) {
/* TODO */
return 0;
}
Solve this exercise in the browser editor — compile and run against the test harness, no setup required.