Skip to main content
Back to challenges

Digital Forensics · Programming

File Carving from Memory

Intermediate · 3/5
Paid planPractitioner rank required65 points on first solo solve

Challenge brief

Find possible file headers in a hexadecimal byte stream. A signature match identifies a candidate location. It does not establish that a complete file is present.

Read one line containing hexadecimal bytes from standard input. Spaces and upper- or lowercase letters are accepted. Report every matching start position, including repeats, in ascending order. Offsets are zero-based byte offsets. Print one line per match as TYPE at offset N, or print No signatures if none match.

TypeHexadecimal signature
PNG89504e470d0a1a0a
JPEGffd8ffe0 or ffd8ffe1
PDF25504446
ZIP504b0304

For input 00 25 50 44 46 the output is PDF at offset 1.

Solo practice

Sign in to submit an answer and save your progress.

Sign in to practice