November 29, 2010

File Magic Numbers in Header to differentiate between files

Hi everyone,
I just came to know about the file magic numbers
http://en.wikipedia.org/wiki/Magic_number_%28programming%29

Its good that, we can identify the file by converting the file to ASCII even someone changes the file extension manually.

I personally tested this by creating one GIF file and saw the file ASCII values are starting with GIF89a.
Later I manually changed the file extension to JPEG and I verified the ASCII values surprised that still the file ASCII values aren't changed. Its GIF89a.

So, I understand one thing, that, if someone changes the file extension to some unknown type, we can easily find the original file extension by this method.

To see the file ASCII values, use hexdump tool.
http://www.richpasco.org/utilities/hexdump.html

See the screeshots
Demo_Image_GIF

See the output ever after changing file extn

Please send your comments and feedback to me

No comments:

Featured Post

Java Introdcution

Please send your review and feedback to psrdotcom@gmail.com