生活随笔
收集整理的這篇文章主要介紹了
160 - 41 defiler.1.exe
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
環(huán)境: Windows xp sp3
工具: Ollydbg stud_PE LoadPE
先分析一下。 這次的程序要求更改了,變成了這個(gè):
defiler
's reversme no
.1
The task
of this little, lame reverseme
is to add some code
to it.
The code you have
to add will be triggered by the
'Exit ' menu
and should
look like this:A messagebox should appear asking the user
"Do you fickbirne really want to quit?" .
Its buttons should be
'Yes '
and 'No '.
If the user clicks
'Yes ', simply
exit the
program
in a clean way,
if the user clicks
'No ' just do
NOT exit the program
(it
's up
to you what will happen
when the user clicks
'No ').Valid solutions are solutions
with a tutorial explaining what you did,
explaining the code you added
and the modified binaries.Mail your solution
to defiler@immortaldescendants.org
Valid solutions will be published
on http://immortaldescendants.org,
the first solution will be
on http://defiler.cjb.netthats it.. i hope i didn
't forget any more unimportant stuff ;)best regards,defiler
其實(shí)就是程序的菜單欄的Exit選項(xiàng)沒(méi)有功能,讓我們把加個(gè)messagebox下去,實(shí)現(xiàn)這個(gè)Exit選項(xiàng)。
OD載入,直接運(yùn)行,點(diǎn)擊菜單欄,選About選項(xiàng),彈出messagebox,F12站廳,Alt+F9,點(diǎn)擊確定。斷下來(lái)到這里:
0043 CCE2 |.
64 :FF31
push dword ptr fs:[ecx]
0043 CCE5 |.
64 :
8921 mov dword ptr fs:[ecx],esp
0043 CCE8 |.
53 push ebx
0043 CCE9 |.
57 push edi
0043 CCEA |.
56 push esi
0043 CCEB |.
8 B45 FC
mov eax,[local
.1 ]
0043 CCEE |.
8 B40
24 mov eax,dword ptr ds:[eax+
0x24 ]
0043 CCF1 |.
50 push eax
0043 CCF2 |. E8 C998FCFF
call <
jmp .&user32
.MessageBoxA >
0043 CCF7 |.
8945 F8
mov [local
.2 ],eax
單步F8往下走:
00430528 /$
53 push ebx
00430529 |. 33DB xor ebx,ebx
0043052 B
|. 0FB7D2 movzx edx,dx
0043052 E
|. 33C9 xor ecx,ecx
00430530 |. E8 53FFFFFF call defiler_.00430488 ; 獲取點(diǎn)擊后的位置
00430535 |. 85C0 test eax,eax ; 確認(rèn)點(diǎn)擊的是哪個(gè)東西
00430537 |. 74 07 je Xdefiler_.00430540 ;
00430539 |. 8B10 mov edx,dword ptr ds:[eax] ;
0043053 B
|. FF52 40 call dword ptr ds:[edx+0x40]
0043053 E
|. B3 01 mov bl,0x1
00430540 |> 8BC3 mov eax,ebx
00430542 |. 5B pop ebx
00430543 \. C3 retn
在00430535下斷點(diǎn),重新運(yùn)行程序,點(diǎn)擊菜單欄,選About,程序斷下。觀察EAX的值:
數(shù)據(jù)窗口跟隨: 顯示方式改為:長(zhǎng)型 -> 地址
可以猜測(cè)上一個(gè)call是用來(lái)確定菜單欄的選項(xiàng)的。 讓程序重新運(yùn)行,這次點(diǎn)Exit
看出這兩個(gè)的值是不同的,于是可以用eax的值來(lái)判斷點(diǎn)擊的內(nèi)容。
現(xiàn)在可以開始添加代碼了。 首先先用LoadPE刪除重定位信息。 打開LOadPE后用PE編輯器加載程序。
設(shè)置為0
然后就保存
再用stud_PE打開,添加section
大小設(shè)置為0x1000,用NULL填充
點(diǎn)擊Add添加,完成后雙擊新建的section
設(shè)置一下Characteristics flags為0xE00000E0 順便記一下VirtualOff:4E000 save一下。
OD載入這個(gè)修改過(guò)的程序,跳轉(zhuǎn)到44E000處,然后就可以開始添加代碼了。
思路是這樣的: 在00430530處的call后獲取了點(diǎn)擊的內(nèi)容,然后就直接跳轉(zhuǎn)到44E000處進(jìn)行判斷,根據(jù)內(nèi)容來(lái)確定接下來(lái)的程序。如果是“About”的值就直接返回去源代碼處,否則就是exit的值了,就可以彈出消息框,根據(jù)用戶點(diǎn)擊來(lái)確定點(diǎn)擊內(nèi)容從而判斷接下來(lái)的行為。
0044E000 85 C0 test eax,eax
0044E002 -
0 F84
3825 FEFF je 復(fù)件_def
.00430540
0044E008 60 pushad
0044E009 8 B0D D0FB4300
mov ecx,dword ptr ds:[
0x43FBD0 ]
0044E00 F
8 B09
mov ecx,dword ptr ds:[ecx]
0044E011 90 nop
0044E012 90 nop
0044E013 90 nop
0044E014 81 C1
04230000 add ecx,
0x2304
0044E01 A
3 BC1 cmp eax,ecx
0044E01 C
61 popad
0044E01 D
8 B10
mov edx,dword ptr ds:[eax]
0044E01 F
75 05 jnz
X 復(fù)件_def
.0044E026
0044E021 - E9
1525 FEFF
jmp 復(fù)件_def
.0043053 B
0044E026 A1 D0FB4300
mov eax,dword ptr ds:[
0x43FBD0 ]
0044E02 B
8 B00
mov eax,dword ptr ds:[eax]
0044E02 D
83 C0
24 add eax,
0x24
0044E030 6 A
24 push 0x24
0044E032 68 58E04400 push 復(fù)件_def
.0044E058
0044E037 68 60E04400 push 復(fù)件_def
.0044E060
0044E03 C FF30
push dword ptr ds:[eax]
0044E03 E E8
7 D85FBFF
call <
jmp .&user32
.MessageBoxA >
0044E043 83 F8
06 cmp eax,
0x6
0044E046 74 05 je
X 復(fù)件_def
.0044E04 D
0044E048 - E9 F124FEFF
jmp 復(fù)件_def
.0043053 E
0044E04 D
6 A
00 push 0x0
0044E04 F E8 D831FBFF
call <
jmp .&kernel32
.ExitProcess >
0044E054 0000 add byte ptr ds:[eax],al
0044E056 0000 add byte ptr ds:[eax],al
0044E058 51 push ecx
0044E059 75 69 jnz
X 復(fù)件_def
.0044E0 C4
0044E05 B
74 00 je
X 復(fù)件_def
.0044E05 D
0044E05 D
0000 add byte ptr ds:[eax],al
0044E05 F
0041 72 add byte ptr ds:[ecx+
0x72 ],al
0044E062 65 :
2079 6 F
and byte ptr gs:[ecx+
0x6F ],bh
0044E066 75 20 jnz
X 復(fù)件_def
.0044E088
0044E068 73 75 jnb
X 復(fù)件_def
.0044E0 DF
0044E06 A
72 65 jb
X 復(fù)件_def
.0044E0 D1
0044E06 C
2071 75 and byte ptr ds:[ecx+
0x75 ],dh
0044E06 F
69743 F
00 00000 >imul esi,dword ptr ds:[edi+edi],
0x0
修改完44E000的代碼后,再修改一下 00430530后面的內(nèi)容
0043052 B .
0 FB7D2 movzx edx,dx
0043052 E .
33 C9 xor ecx,ecx
00430530 . E8
53 FFFFFF
call 復(fù)件_def
.00430488
00430535 .- E9 C6DA0100
jmp 復(fù)件_def
.0044E000
0043053 A
90 nop
0043053 B . FF52
40 call dword ptr ds:[edx+
0x40 ]
0043053 E . B3
01 mov bl,
0x1
修改完后保存一下就好了
完成 O(∩_∩)O
參考: https://www.52pojie.cn/thread-654237-1-1.html
總結(jié)
以上是生活随笔 為你收集整理的160 - 41 defiler.1.exe 的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
如果覺(jué)得生活随笔 網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔 推薦給好友。