Win32 EXEファイルのDOS stubを参考にバイナリエディタ(Stirling)で小さいDOS EXEを作る。
short.exe 91bytes
_IMAGE_DOS_HEADER (winnt.h)
0000 5a4d Magic number (MZ=5a4d)
0002 005b Bytes on last page of file
0004 0001 Pages in file (1page=512bytes)
0006 0000 Relocations
0008 0004 Size of header in paragraphs (1para=16bytes)
000a 0000 Minimum extra paragraphs needed
000c ffff Maximum extra paragraphs needed
000e 0000 Initial (relative) SS value
0010 00b8 Initial SP value
0012 0000 Checksum
0014 0000 Initial IP value
0016 0000 Initial (relative) CS value
0018 0040 File address of relocation table
001a 0000 Overlay number
address 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 0123456789abcdef
00000000 4d 5a 5b 00-01 00 00 00-04 00 00 00-ff ff 00 00 MZ[.............
00000010 b8 00 00 00-00 00 00 00-40 00 00 00-00 00 00 00 ........@.......
00000020 00 00 00 00-00 00 00 00-00 00 00 00-00 00 00 00 ................
00000030 00 00 00 00-00 00 00 00-00 00 00 00-00 00 00 00 ................
00000040 0e 1f ba 0e-00 b4 09 cd-21 b8 00 4c-cd 21 68 65 ........!..L.!he
00000050 6c 6c 6f 2c-20 77 6f 72-6c 64 24 - llo, world$
symdebで逆アセンブル ※アドレス40h~4Dhに相当
-u 0 d
2398:0000 0E PUSH CS
2398:0001 1F POP DS
2398:0002 BA0E00 MOV DX,000E
2398:0005 B409 MOV AH,09
2398:0007 CD21 INT 21
2398:0009 B8004C MOV AX,4C00
2398:000C CD21 INT 21
最終更新:2017年10月30日 22:49