Hello evaluator / Gaia
Thanks evaluator for the exercise & Gaia for the solution.
I need to ask how u knew
(1) @401003 it should be 6AFF
(4) @401021 it should be 0x57
(2) @401005 it should be 0x68
(5) @40102C it should be 0x2BD2
(3) @40100A it should be 0x68
(6) @401057 it should be 0x6A01
In below code the one in dark black i was not able to find. Rest i did saw in the code were recovered from execution of program & some from stack manipulaion.
Does it mean we have to reconstruct it with
->> trial & error ?
->> or we have to know which compiler is used & then reconstruct it appropriately
->> or i am failing to understand the concept behind it.
Also how u knew this recovered bytes will fit at this particular offset ? I might sound lame but i need to understand it.
Two thing i definately learnt from this exercise is we have to be very careful while pressing F8 or F10 one or two quick press we might loose important DWORDS from stack which we need to note down. Second important thing is recovering of code from stack manipulation.
Regards
Sope!
Code:
:00401000 55 push ebp
:00401001 8B EC mov ebp, esp
:00401003 6A FF push 0FFFFFFFFh
:00401005 68 A8 2F 4B 00 push 4B2FA8h ; 0x40312F
:0040100A 68 90 10 40 00 push (offset aDl+5)
:0040100F 64 FF 35 00 00 00 00 push large dword ptr fs:0 ; 0x4039C0
:00401016 64 89 25 00 00 00 00 mov large fs:0, esp ; 0x403587
:0040101D 83 EC 58 sub esp, 58h
:00401020 53 push ebx ; either from 403CE5 / 403C83 / 403A8E / 402AF2 / 4027F8 ?
:00401021 56 push esi ; 0x4032D6 ?
:00401022 57 push edi ; ?
:00401023 89 65 E8 mov [ebp+var_18], esp ; 0x402238
:00401026 FF 15 54 40 40 00 call ds:GetVersio
:0040102C 2B D2 sub edx, edx
:0040102E 88 E2 mov dl, ah ; 0x401F63
:00401030 89 15 C8 41 40 00 mov ds:4041C8h, edx
:00401036 8B C8 mov ecx, eax
:00401038 81 E1 FF 00 00 00 and ecx, 0FFh ; 0x401F6D
:0040103E 89 0D C4 41 40 00 mov ds:4041C4h, ecx ; 0x40334B
:00401044 C1 E1 08 shl ecx, 8
:00401047 01 D1 add ecx, edx
:00401049 89 0D C0 41 40 00 mov ds:4041C0h, ecx ; 0x402DA6
:0040104F C1 E8 10 shr eax, 10h
:00401052 A3 BC 41 40 00 mov ds:4041BCh, eax
:00401057 6A 01 push 1 ; i got 01 but 6A = ?
:00401059 E8 2C 00 00 00 call nullsub_1 ; 0x401059
:0040105E 59 pop ecx
:0040105F 6A 00 push 0
:00401061 68 00 11 40 00 push offset aFinish
:00401066 68 00 11 40 00 push offset aFinish
:0040106B 6A 00 push 0
:0040106D FF 15 70 40 40 00 call ds:MessageBoxA
:00401073 64 8B 25 00 00 00 00 mov esp, large fs:0
:0040107A 64 8F 05 00 00 00 00 pop large dword ptr fs:0
:00401081 C9 leave
:00401082 6A 00 push 0
:00401084 FF 15 50 40 40 00 call ds:ExitProcess