Wednesday, 29 August 2007

Console/Window executables

Simple trick to suppress console window to pop up is to change the flag 03 to 02 as it is done in the following example (in case you forgot 03 is ctrl-C and 02 is ctrl-B):

0000: 4D 5A 90 00 03 00 00 00 04 00 00 00 FF FF 00 00 MZ_ ♥ ♦ яя
0010: B8 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 ё @
0020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0030: 00 00 00 00 00 00 00 00 00 00 00 00 80 00 00 00 _
0040: 0E 1F BA 0E 00 B4 09 CD 21 B8 01 4C CD 21 54 68 ♫▼є♫ _○Н!ё☺LН!Th
0050: 69 73 20 70 72 6F 67 72 61 6D 20 63 61 6E 6E 6F is program canno
0060: 74 20 62 65 20 72 75 6E 20 69 6E 20 44 4F 53 20 t be run in DOS
0070: 6D 6F 64 65 2E 0D 0D 0A 24 00 00 00 00 00 00 00 mode.♪♪◙$
0080: 50 45 00 00 4C 01 12 00 7B DA D4 46 00 68 5E 00 PE L☺↕ {ЪФF h^
0090: 34 1F 00 00 E0 00 06 01 0B 01 02 38 00 50 0A 00 4▼ а ♠☺♂☺☻8 P◙
00A0: 00 1C 10 00 00 F8 20 00 A0 12 00 00 00 10 00 00 ∟► ш ↕ ►
00B0: 00 60 0A 00 00 00 40 00 00 10 00 00 00 02 00 00 `◙ @ ► ☻
00C0: 04 00 00 00 01 00 00 00 04 00 00 00 00 00 00 00 ♦ ☺ ♦
00D0: 00 F0 7F 00 00 06 00 00 4A 86 63 00 03 00 00 00 р⌂ ♠ J┼c ♥
00E0: 00 00 20 00 00 10 00 00 00 00 10 00 00 10 00 00 ► ► ►
00F0: 00 00 00 00 10 00 00 00 00 90 30 00 22 46 00 00 ► _0 "F
0100: 00 E0 30 00 98 20 00 00 00 00 00 00 00 00 00 00 а0 _
0110: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0120: 00 10 31 00 88 4B 00 00 00 00 00 00 00 00 00 00 ►1 _K
0130: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0140: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0150: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0160: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

This flag is at the end of the line 00D0. This flag is not in absolute offset so you may try to guess.

No comments: