how to write patch for 有聲有色 3.10.txt (4千字)

看雪資料發表於2000-08-20

今天我cracking了有聲有色 3.10, 下載地點http://www.newhua.com.cn/down/you310.zip, 它是用aspack 2.1加的殼,我已成功地將它unpack, crack down, 但我想現在想寫一個patch, 一個直接在它的原檔案MusRea.exe上寫上patch程式碼,即在.Aspack section最後的無程式碼部分加上我的patch程式碼,但似乎不成功,望高手能賜教:

分析過程如下:

在.Aspack section一節, 最後要返回原程式entry point前的反彙編程式碼如下:


:004CC4F3 61                      popad
:004CC4F4 7508                    jne 004CC4FE

* Possible Reference to String Resource ID=00001: "DDDDDDADDDDDDDD??
                                  |
:004CC4F6 B801000000              mov eax, 00000001
:004CC4FB C20C00                  ret 000C



* Referenced by a (U)nconditional or (C)onditional Jump at Address:
|:004CC4F4(C)
|
:004CC4FE 6800000000              push 00000000  <==將此處改為E99D1F0000
:004CC503 C3                      ret    <==從此返回原程式entry point

我的思路將:004CC4FE處程式碼改為 jmp 004ce434, :004ce434為.Aspack section一節無程式碼處,在此處我寫入我的patch程式碼,即:
mov dword ptr [0048A4E1], 90E98002
push 00000000
ret

HEX值:C705E1A448000280E9906800000000C3,
這種思路我在老外的tutor裡看到過,但我的測試未透過,請高人指點。

附:我寫的關於如何破解有聲有色 3.10的tutor

Target file : MusRea.exe
Packer: Aspack 2.1
Compiler: Delphi 5.0

cracking tutorial:

1.unpacking target file with your favorite tools , eg. softice or trw, I prefer to use UnAspack 1.0.9.1
2.Using ProcDump change the Section Characteristics for the CODE section to 0xE0000020. (you must master PE file format, or you don't understand it. :-()
3.Disassemble the target file
4.anlysis the source code:
:0048A4D4 8B8318050000            mov eax, dword ptr [ebx+00000518]
:0048A4DA 83B8380100001E          cmp dword ptr [eax+00000138], 0000001E  <== see if you have  used 30 times
:0048A4E1 0F8498000000            je 0048A57F
:0048A4E7 8B831C050000            mov eax, dword ptr [ebx+0000051C]
:0048A4ED 8B10                    mov edx, dword ptr [eax]
:0048A4EF FF92B4000000            call dword ptr [edx+000000B4]
:0048A4F5 3C01                    cmp al, 01
:0048A4F7 0F8482000000            je 0048A57F
:0048A4FD 8B8324050000            mov eax, dword ptr [ebx+00000524]
:0048A503 8B10                    mov edx, dword ptr [eax]
:0048A505 FF92B4000000            call dword ptr [edx+000000B4]
:0048A50B 3C01                    cmp al, 01
:0048A50D 7470                    je 0048A57F
:0048A50F 8B8328050000            mov eax, dword ptr [ebx+00000528]
:0048A515 8B10                    mov edx, dword ptr [eax]
:0048A517 FF92B4000000            call dword ptr [edx+000000B4]
:0048A51D 3C01                    cmp al, 01
:0048A51F 745E                    je 0048A57F
:0048A521 8B832C050000            mov eax, dword ptr [ebx+0000052C]
:0048A527 8B10                    mov edx, dword ptr [eax]
:0048A529 FF92B4000000            call dword ptr [edx+000000B4]
:0048A52F 3C01                    cmp al, 01
:0048A531 744C                    je 0048A57F
:0048A533 8B8330050000            mov eax, dword ptr [ebx+00000530]
:0048A539 8B10                    mov edx, dword ptr [eax]
:0048A53B FF92B4000000            call dword ptr [edx+000000B4]
:0048A541 3C01                    cmp al, 01
:0048A543 743A                    je 0048A57F
:0048A545 8B8330050000            mov eax, dword ptr [ebx+00000530]
:0048A54B 8B10                    mov edx, dword ptr [eax]
:0048A54D FF92B4000000            call dword ptr [edx+000000B4]
:0048A553 3C01                    cmp al, 01
:0048A555 7428                    je 0048A57F
:0048A557 8B8334050000            mov eax, dword ptr [ebx+00000534]
:0048A55D 8B10                    mov edx, dword ptr [eax]
:0048A55F FF92B4000000            call dword ptr [edx+000000B4]
:0048A565 3C01                    cmp al, 01
:0048A567 7416                    je 0048A57F
:0048A569 8B833C050000            mov eax, dword ptr [ebx+0000053C]
:0048A56F 8B10                    mov edx, dword ptr [eax]
:0048A571 FF92B4000000            call dword ptr [edx+000000B4]
:0048A577 3C01                    cmp al, 01
:0048A579 0F85E2010000            jne 0048A761  <==if everything OK,  you should jump to 0048A761 from it.

    Through the analysis, you can change the code at :0048A4DA to jmp 0048A761, I think you know how to modify HEX value, do it yourself. Do you understand? let me know.
5.run the target file again, see what happen? Bingo!  The limit use 30 times is removed.

DO NOT USE THIS TUTOR FOR COMMERICAL PURPOSE, IF YOU LIKE THIS PROGRAM, PLEASE PAY THE AUTHOR'S HARD WORK, THE REGISTER FEE IS ONLY TEN YUAN.

相關文章