cybersecurity · beginner · ~15 min · safe pentest lab
Detect the FAT deleted-entry marker.
Detect a deleted FAT directory entry from its first byte — FAT marks deletion by overwriting only that byte with 0xE5.
Implement int is_deleted(unsigned char first) that returns 1 if first == 0xE5, and 0 otherwise.
first: the first byte of a FAT directory entry, supplied by the grader.Returns 1 for a deleted entry, 0 for a live one.
is_deleted(0xE5) -> 1
is_deleted('A') -> 0
0xE5 counts as deleted.The first byte (unsigned char) of a FAT directory entry.
1 if first == 0xE5; otherwise 0.
Compare against the sentinel 0xE5.
int is_deleted(unsigned char first) {
/* TODO */
return 0;
}
Solve this exercise in the browser editor — compile and run against the test harness, no setup required.