cybersecurity · intermediate · ~15 min · safe pentest lab
Branch on multiple magic numbers.
Implement const char *firmware_kind(const unsigned char *b) returning "gzip" for 1F 8B, "uimage" for the U-Boot magic 27 05 19 56 (big-endian), else "unknown".
const char *firmware_kind(const unsigned char *b) {
/* TODO */
return "unknown";
}
Solve this exercise in the browser editor — compile and run against the test harness, no setup required.