Day 2 building a C program (FileID) that identifies a file's true type by reading its first few bytes (its magic byte signature). Im tired.
Used memcmp(buf, sig, 3)==0 to check whether a file's first 3 bytes are FF D8 FF . Then we added a uint8_t array for each file type's magic bytes, PNG, PDF, ZIP, ELF and the rest so the program has a fingerprint to check every file against, not just JPEG....
Day 1 building a C program (FileID) that identifies a file's true type by reading its first few bytes (its magic byte signature).
The "printf("x ", buffer[i]);" is just confirming that the fread() function was working correctly.
Most important thing I need to implement tomorrow:
-A signature table (I'm too n00b to create my own dictionary so looking for other way). Read so much today, im probably going to forget a lot of if but i'll keep tabs open to revisit tomorrow.