The boring rants of a lazy nerd

Friday, December 24, 2004

Tech - IMAGE_DOS_HEADER.e_magic = 0x5A4D

As those of you who have used the computer before Microsoft decided to set "hide file extensions for known file types" default to "on" know, usually the file's extension (the last part after the last period in its name) is used to identify which type of file it is (like "doc" for Word and "jpeg" for pictures). But, that can be misleading as the file's extension is easy to change. So, some software that needs to know the file's type (like antivirus software to needs to scan only infectable files, or multimedia cataloguer that will find pictures in everything) has to actually look into the file and check. While reading and analyzing the entire file is the safest method, it is much too slow and requires the software (or person) doing it to know everything about all the file formats (impossible), so what's usually done is you look at the beginning, what's called the "header", and see if you recognize anything. This method is surprisingly good - Zip files all start with "PK", PDF files start with "%PDF", etc. Some people know that EXE files (programs) since the earliest versions of DOS till today's Windows executables all start with "MZ". What I'm ashamed to admit is I didn't know "MZ" are the initials of one Mark Zbikowski, one of the architects of DOS 2.0. What an interesting piece of trivia! bibliographic references:

No comments:

Blog Archive

About Me

GCS d- s-: a-- C++$ UL++ P+++ L+++ E--- W+++ N o? K? w++$ !O !M !V PS-(+) PE Y+ PGP+(-) t--@ 5++(+++) !X R-- tv-- b+>++ DI+++ D+ G e h! r* y--(-)>+++