åå¼·ä¼ã¨ãããããã¯ãä¸èªå
çã®è¬ç¾©ãã£ã¦æãã ã£ãããªãå人çã«ã¯ãã¤ããªã¨ãã£ã¿ã§ç°å¸¸åä½ãã PE ãããã£ã¦æ£å¸¸ã«åãããã«ãããããã+ï¼0ï¾ã»âã»ï¼ + ï¾ï½¸ï¾ï½¶ +ã§ããã
éä¸ã§ PE ãã¡ã¤ã«ãããã®è©±ã«ãªã£ãæã«ãµã¨ããã® TimeDateStamp ã£ã¦ã³ã³ãã¤ã«æã®ã¿ã¤ã ã¹ã¿ã³ããå
¥ãã®ï¼ãã¨ãããã¨ãæ°ã«ãªã£ããã¨ãæãåºããã®ã§ã¡ãã£ã¨è©¦ãã¦ã¿ãã
typedef struct _IMAGE_FILE_HEADER { WORD Machine; WORD NumberOfSections; DWORD TimeDateStamp; DWORD PointerToSymbolTable; DWORD NumberOfSymbols; WORD SizeOfOptionalHeader; WORD Characteristics; } IMAGE_FILE_HEADER, *PIMAGE_FILE_HEADER;
cygwin ã® gcc ã§ãã£ã¦ã¿ãã
% uname -s CYGWIN_NT-6.1 % echo 'int main(){}' > a.c % gcc a.c -o 1.exe % gcc a.c -o 2.exe % md5sum.exe 1.exe 2.exe 907129d2a56fd3777ffa725588ba9498 *1.exe 38584a31ff69bb022abf0fc87afb3a31 *2.exe
--- /dev/fd/63 (objdump.exe -afhp 1.exe) +++ /dev/fd/62 (objdump.exe -afhp 2.exe) @@ -1,6 +1,6 @@ -1.exe: file format pei-i386 -1.exe +2.exe: file format pei-i386 +2.exe architecture: i386, flags 0x0000013a: EXEC_P, HAS_DEBUG, HAS_SYMS, HAS_LOCALS, D_PAGED start address 0x00401000 @@ -11,7 +11,7 @@ line numbers stripped 32 bit words -Time/Date Mon Feb 21 23:14:35 2011 +Time/Date Mon Feb 21 23:14:38 2011 Magic 010b (PE32) MajorLinkerVersion 2 MinorLinkerVersion 21 @@ -33,7 +33,7 @@ Win32Version 00000000 SizeOfImage 0000b000 SizeOfHeaders 00000400 -CheckSum 00007171 +CheckSum 00007174 Subsystem 00000003 (Windows CUI) DllCharacteristics 00008000 SizeOfStackReserve 00200000
ãªãã CheckSum ã¨ããã®ãç¬èªå¥ã®ãããã«ãããªãã*1 ããã¯ãã¦ãããããããä½æ
ããããªãã¨ãæ°ã«ãªã£ããã¨ããã¨ãåãã³ã³ãã¤ã©ããã³ãªãã·ã§ã³ã§ã³ã³ãã¤ã«ãããã¤ããªãåè´ããªãã¨ãªãã¨ãåããã¤ããªã¯äºåº¦ã¨ã¤ãããªãã¨ãããã¨ã«ãªãã®ããªã¨æã£ã次第ãã¡ã¼ã«ã¼ã¨ããã¹ãããæã«æéã¨ãã©ããªãã ãã¨ãä½è¨ãªãã¨ãèãã¦ã¿ãã
ã追è¨ãæ¬å½ã«ãã£ããããw
ã¡ãªã¿ã« Mac OS X ã 㨠Mach-O ãããããæ
å ±ãæããªãã®ããå·®åã¯åºãªãã£ãã
% uname -s Darwin % echo 'int main(){}' > a.c % gcc a.c -o 1.exe % gcc a.c -o 2.exe % gmd5sum a1.exe a2.exe dced646ad5ae2d7fbe4791a61c9bab23 a1.exe dced646ad5ae2d7fbe4791a61c9bab23 a2.exe
Linux ã¯ããã«ä½¿ããç°å¢ã¯æå
ã«ãªããããæ°ãåãããããã«è¿½è¨ããã
ãã¨ãMacBook* ã§ãã®åå¼·ä¼ã«åå ãã人㯠HugeDomains.com - LoadupDates.com is for sale (Loadup Dates) ã® mingw ã¿ã¼ã²ããã®ã¯ãã¹ã³ã³ãã¤ã©ã使ãã¨ããããããªãããªã*2
*1:EXEファイルの内部構造(PEヘッダ) (2/3):CodeZine(コードジン)
*2:èªå㯠VirtualBox ä¸ã® Windows 7 ã« CygwinPorts ããã¤ã³ã¹ãã¼ã«ãã i686-mingw32-gcc ã使ã£ã¦èª²é¡ã解ãããã©ãç´ äººã«ã¯ããããã§ããªãè¨ã®ã»ããã¢ããã®éã ã¨æãã