cybersecurity · beginner · ~15 min · safe pentest lab

Is it gzip-compressed?

Recognise the gzip magic.

Challenge

gzip files start with 0x1F 0x8B. Implement int is_gzip(const unsigned char *b) returning 1 if the first two bytes match, else 0.

Starter code

int is_gzip(const unsigned char *b) {
    /* TODO */
    return 0;
}

Solve this exercise in the browser editor — compile and run against the test harness, no setup required.