====================================================
二 技能資料表&怪物ID資料表破解
====================================================
技能資料表與怪物ID, 存放在 Game.dat 第4段與第7段. 用 Ollydgb 打開 Srobot.exe 搜尋 game.dat 發現第4段與第7段雙重加密
00402010 /$ 81EC 00010000 sub esp, 100 ; 這裡下斷
00402016 |. 8D4424 00 lea eax, dword ptr [esp]
0040201A |. 53 push ebx
0040201B |. 55 push ebp
0040201C |. 56 push esi
0040201D |. 57 push edi
0040201E |. 8BE9 mov ebp, ecx
00402020 |. 50 push eax
00402021 |. E8 4A040000 call 00402470
00402026 |. BF 34E24000 mov edi, 0040E234 ; ASCII "game.dat"
0040202B |. 83C9 FF or ecx, FFFFFFFF
0040202E |. 33C0 xor eax, eax
00402030 |. 8D5424 14 lea edx, dword ptr [esp+14]
00402034 |. F2:AE repne scas byte ptr es:[edi]
00402036 |. F7D1 not ecx
00402038 |. 2BF9 sub edi, ecx
0040203A |. 68 30E24000 push 0040E230 ; /mode = "rb"
0040203F |. 8BF7 mov esi, edi ; |
00402041 |. 8BD9 mov ebx, ecx ; |
00402043 |. 8BFA mov edi, edx ; |
00402045 |. 83C9 FF or ecx, FFFFFFFF ; |
00402048 |. F2:AE repne scas byte ptr es:[edi] ; |
0040204A |. 8BCB mov ecx, ebx ; |
0040204C |. 4F dec edi ; |
0040204D |. C1E9 02 shr ecx, 2 ; |
00402050 |. F3:A5 rep movs dword ptr es:[edi], dword p>; |
00402052 |. 8BCB mov ecx, ebx ; |
00402054 |. 8D4424 18 lea eax, dword ptr [esp+18] ; |
00402058 |. 83E1 03 and ecx, 3 ; |
0040205B |. 50 push eax ; |path
0040205C |. F3:A4 rep movs byte ptr es:[edi], byte ptr>; |
0040205E |. 90 nop ; |
0040205F |. E8 ACCF8077 call msvcrt.fopen ; \fopen
00402064 |. 8B35 1CC34000 mov esi, dword ptr [40C31C] ; msvcrt.fseek
0040206A |. 8BF8 mov edi, eax
0040206C |. 6A 02 push 2 ; /whence = SEEK_END
0040206E |. 6A 00 push 0 ; |offset = 0
00402070 |. 57 push edi ; |stream
00402071 |. FFD6 call esi ; \fseek
00402073 |. 57 push edi ; /stream
00402074 |. 90 nop ; |
00402075 |. E8 FAF48077 call msvcrt.ftell ; \ftell
0040207A |. 6A 00 push 0
0040207C |. 6A 00 push 0
0040207E |. 57 push edi
0040207F |. 8BD8 mov ebx, eax
00402081 |. FFD6 call esi
00402083 |. 53 push ebx
00402084 |. E8 8D8E0000 call 0040AF16
00402089 |. 57 push edi ; /stream
0040208A |. 8BF0 mov esi, eax ; |
0040208C |. 6A 01 push 1 ; |n = 1
0040208E |. 53 push ebx ; |size
0040208F |. 56 push esi ; |ptr
00402090 |. 90 nop ; |
00402091 |. E8 65F18077 call msvcrt.fread ; \fread
00402096 |. 57 push edi ; /stream
00402097 |. 90 nop ; |
00402098 |. E8 14EA8077 call msvcrt.fclose ; \fclose
0040209D |. 8B0D 20E04000 mov ecx, dword ptr [40E020] ; Srobot.0040E12C
004020A3 |. 83C4 40 add esp, 40
004020A6 |. 51 push ecx
004020A7 |. 53 push ebx
004020A8 |. 56 push esi
004020A9 |. 8BCD mov ecx, ebp
004020AB |. E8 C04D0000 call 00406E70 ; Game.dat 解密
004020B0 |. 56 push esi ; READ 第1段
004020B1 |. E8 7A160000 call 00403730
004020B6 |. 8BF8 mov edi, eax
004020B8 |. 83C7 04 add edi, 4
004020BB |. 8D1437 lea edx, dword ptr [edi+esi]
004020BE |. 52 push edx ; READ 第2段
004020BF |. E8 6C160000 call 00403730
004020C4 |. 8D7C07 04 lea edi, dword ptr [edi+eax+4]
004020C8 |. 8D0437 lea eax, dword ptr [edi+esi]
004020CB |. 50 push eax ; READ 第3段
004020CC |. E8 5F160000 call 00403730
004020D1 |. 8D7C07 04 lea edi, dword ptr [edi+eax+4]
004020D5 |. 8D0C37 lea ecx, dword ptr [edi+esi]
004020D8 |. 51 push ecx ; READ 第4段(技能資料表)
004020D9 |. E8 52160000 call 00403730
004020DE |. 8D7C07 04 lea edi, dword ptr [edi+eax+4]
004020E2 |. 8D1437 lea edx, dword ptr [edi+esi]
004020E5 |. 52 push edx ; READ 第5段
004020E6 |. E8 45160000 call 00403730
004020EB |. 8D7C07 04 lea edi, dword ptr [edi+eax+4]
004020EF |. 8D0437 lea eax, dword ptr [edi+esi]
004020F2 |. 50 push eax ; READ 第6段
004020F3 |. E8 38160000 call 00403730
004020F8 |. 8D7C07 04 lea edi, dword ptr [edi+eax+4]
004020FC |. 8D0C37 lea ecx, dword ptr [edi+esi]
004020FF |. 51 push ecx ; READ 第7段(怪物ID)
00402100 |. E8 2B160000 call 00403730
00402105 |. 8D7C07 04 lea edi, dword ptr [edi+eax+4]
00402109 |. 8D1437 lea edx, dword ptr [edi+esi]
0040210C |. 52 push edx ; READ 第8段
0040210D |. E8 1E160000 call 00403730
00402112 |. 8D7C07 04 lea edi, dword ptr [edi+eax+4]
00402116 |. 8D0437 lea eax, dword ptr [edi+esi]
00402119 |. 50 push eax ; READ 第9段
0040211A |. E8 11160000 call 00403730
0040211F |. 8D7C07 04 lea edi, dword ptr [edi+eax+4]
00402123 |. 8D0C37 lea ecx, dword ptr [edi+esi]
00402126 |. 51 push ecx ; READ 第10段
00402127 |. E8 04160000 call 00403730
0040212C |. 8D7C07 04 lea edi, dword ptr [edi+eax+4]
00402130 |. 8D1437 lea edx, dword ptr [edi+esi]
00402133 |. 52 push edx ; READ 第11段
00402134 |. E8 F7150000 call 00403730
00402139 |. 8D7C07 04 lea edi, dword ptr [edi+eax+4]
0040213D |. 03FE add edi, esi
0040213F |. 57 push edi ; READ 第12段 (silk.dll 覆寫)
00402140 |. E8 EB150000 call 00403730
00402145 |. 83C4 30 add esp, 30
00402148 |. 83C7 04 add edi, 4
0040214B |. 8BCD mov ecx, ebp
0040214D |. 50 push eax
0040214E |. 57 push edi
0040214F |. E8 1C000000 call 00402170 ; jmp mfc42.#operator new_823
00402154 |. 56 push esi
00402155 |. E8 B68D0000 call 0040AF10 ; jmp mfc42.#operator delete_825
0040215A |. 83C4 04 add esp, 4
0040215D |. 5F pop edi
0040215E |. 5E pop esi
0040215F |. 5D pop ebp
00402160 |. 5B pop ebx
00402161 |. 81C4 00010000 add esp, 100
00402167 \. C3 retn
------------------------------
解 game.dat 第4段與第7段的方法
------------------------------
打開 Srobot.exe 搜尋字串 Game.dat 發現有三個
第二個字串處代碼後面進入VM 這裡是技能資料表解密的地方
第三個字串處代碼後面進入VM 這裡是怪物ID料表解密的地方
先RUN一次, 在 004020B0 push esi(READ 第1段) 這裡下斷點
把第一次解密的Game.dat DUMP出來, 並紀錄第4段與第7段在記憶體(內存)的指標(指針).
A.第7段解密
在沒加VM的地方 00402010 sub esp, 100 下斷點.
在第二個Game.dat字串代碼頭 004021C0 push ebp 的地方 新建EIP.
然後在dat解密的 Call 裡面 00406E70 下斷點
然後按 F9 RUN 解密 Game.dat 第二次又斷在 00406E70 解密第4段技能資料表
第4段解壓縮大小=000003E8
B.第7段解密
在沒加VM的地方 00402010 sub esp, 100 下斷點.
在第三個Game.dat字串代碼頭 00402300 push ebp 的地方 新建EIP.
然後在dat解密的 Call 裡面 00406E70 下斷點
然後按 F9 RUN 解密 Game.dat 第二次又斷在 00406E70 解密第7段怪物ID資料表
第7段解壓縮大小=00001A38
00406E70 /$ 8B5424 08 mov edx, dword ptr [esp+8] ; 這裡下斷 EDX=大小
00406E74 |. 8B4424 04 mov eax, dword ptr [esp+4] ; EAX=Game.dat解壓縮存放指標
00406E78 |. B9 01000000 mov ecx, 1
00406E7D |. 3BD1 cmp edx, ecx
00406E7F |. 8D4410 FF lea eax, dword ptr [eax+edx-1]
00406E83 |. 76 1E jbe short 00406EA3
00406E85 |. 53 push ebx
00406E86 |. 56 push esi
00406E87 |. 8B7424 14 mov esi, dword ptr [esp+14]
00406E8B |> 33DB /xor ebx, ebx
00406E8D |. 8A58 FF |mov bl, byte ptr [eax-1]
00406E90 |. 8A1C33 |mov bl, byte ptr [ebx+esi]
00406E93 |. 3218 |xor bl, byte ptr [eax]
00406E95 |. 32D9 |xor bl, cl
00406E97 |. 32DA |xor bl, dl
00406E99 |. 8818 |mov byte ptr [eax], bl
00406E9B |. 48 |dec eax
00406E9C |. 41 |inc ecx
00406E9D |. 3BCA |cmp ecx, edx
00406E9F |.^ 72 EA \jb short 00406E8B
00406EA1 |. 5E pop esi ; 這裡按F4解壓成功 看EAX 指標內的數據
00406EA2 |. 5B pop ebx
00406EA3 \> C2 0C00 retn 0C
將第4段與第7段解密的數據複製起來,在用HEX編輯工具如WinHEX,寫到Game.dat第1次Dump的文件.
完全解密的 Game.dat 大公告成...
---------------------------
Case 501 分析
---------------------------
跟蹤 recv 到 Case 501封包處理代碼
10018B3D |> \8D46 02 lea eax, dword ptr [esi+2] ; Case 501 of switch 10018A9B
10018B40 |. 50 push eax
10018B41 |. E8 6A170000 call 1001A2B0
10018B46 |. 8B4F 08 mov ecx, dword ptr [edi+8]
10018B49 |. 25 FFFF0000 and eax, 0FFFF
10018B4E |. 83C4 04 add esp, 4
10018B51 |. 83C0 FC add eax, -4
10018B54 |. 83C6 04 add esi, 4
10018B57 |. 50 push eax
10018B58 |. 56 push esi
10018B59 |. E8 C2530200 call 1003DF20 ; 進入501封包處理
進入 Call 1003DF20 來到
1003DF20 /$ 53 push ebx
1003DF21 |. 8B5C24 08 mov ebx, dword ptr [esp+8]
1003DF25 |. 56 push esi
1003DF26 |. 57 push edi
1003DF27 |. 8B7C24 14 mov edi, dword ptr [esp+14]
1003DF2B |. 8BF1 mov esi, ecx
1003DF2D |. 57 push edi
1003DF2E |. 53 push ebx
1003DF2F |. E8 CCFFFFFF call 1003DF00 ; 解密501封包資料
1003DF34 |. 8B46 10 mov eax, dword ptr [esi+10]
1003DF37 |. 57 push edi
1003DF38 |. 53 push ebx
1003DF39 |. 8B88 A04B0100 mov ecx, dword ptr [eax+14BA0]
1003DF3F |. E8 8C8EFDFF call 10016DD0 ; 解壓縮Game.dat 並寫入第4段解密資料
1003DF44 |. 8B4E 10 mov ecx, dword ptr [esi+10]
1003DF47 |. C786 10050000 0100>mov dword ptr [esi+510], 1
1003DF51 |. E8 7ABDFEFF call 10029CD0
1003DF56 |. 8B4E 10 mov ecx, dword ptr [esi+10]
1003DF59 |. E8 A260FEFF call 10024000
1003DF5E |. 5F pop edi
1003DF5F |. 5E pop esi
1003DF60 |. 5B pop ebx
1003DF61 \. C2 0800 retn 8
再進入 call 10016DD0 來到
10016DD0 /$ 81EC 08010000 sub esp, 108
10016DD6 |. 53 push ebx
10016DD7 |. 55 push ebp
10016DD8 |. 56 push esi
10016DD9 |. 8D4424 14 lea eax, dword ptr [esp+14]
10016DDD |. 57 push edi
10016DDE |. 8BE9 mov ebp, ecx
10016DE0 |. 50 push eax
10016DE1 |. 896C24 14 mov dword ptr [esp+14], ebp
10016DE5 |. E8 86100000 call 10017E70
10016DEA |. BF 48670510 mov edi, 10056748 ; ASCII "game.dat"
10016DEF |. 83C9 FF or ecx, FFFFFFFF
10016DF2 |. 33C0 xor eax, eax
10016DF4 |. 8D5424 1C lea edx, dword ptr [esp+1C]
10016DF8 |. F2:AE repne scas byte ptr es:[edi]
10016DFA |. F7D1 not ecx
10016DFC |. 2BF9 sub edi, ecx
10016DFE |. 68 A8630510 push 100563A8 ; /mode = "rb"
10016E03 |. 8BF7 mov esi, edi ; |
10016E05 |. 8BD9 mov ebx, ecx ; |
10016E07 |. 8BFA mov edi, edx ; |
10016E09 |. 83C9 FF or ecx, FFFFFFFF ; |
10016E0C |. F2:AE repne scas byte ptr es:[edi] ; |
10016E0E |. 8BCB mov ecx, ebx ; |
10016E10 |. 4F dec edi ; |
10016E11 |. C1E9 02 shr ecx, 2 ; |
10016E14 |. F3:A5 rep movs dword ptr es:[edi], dword>; |
10016E16 |. 8BCB mov ecx, ebx ; |
10016E18 |. 8D4424 20 lea eax, dword ptr [esp+20] ; |
10016E1C |. 83E1 03 and ecx, 3 ; |
10016E1F |. 50 push eax ; |path
10016E20 |. F3:A4 rep movs byte ptr es:[edi], byte p>; |
10016E22 |. FF15 04D60410 call dword ptr [1004D604] ; \fopen
10016E28 |. 8B1D E4D50410 mov ebx, dword ptr [1004D5E4] ; msvcrt.fseek
10016E2E |. 8BF0 mov esi, eax
10016E30 |. 6A 02 push 2 ; /whence = SEEK_END
10016E32 |. 6A 00 push 0 ; |offset = 0
10016E34 |. 56 push esi ; |stream
10016E35 |. FFD3 call ebx ; \fseek
10016E37 |. 56 push esi ; /stream
10016E38 |. FF15 E8D50410 call dword ptr [1004D5E8] ; \ftell
10016E3E |. 6A 00 push 0
10016E40 |. 6A 00 push 0
10016E42 |. 56 push esi
10016E43 |. 8BF8 mov edi, eax
10016E45 |. FFD3 call ebx
10016E47 |. 57 push edi
10016E48 |. E8 BD1D0300 call 10048C0A ; jmp 到 mfc42.#operator new_823
10016E4D |. 56 push esi ; /stream
10016E4E |. 8BD8 mov ebx, eax ; |
10016E50 |. 6A 01 push 1 ; |n = 1
10016E52 |. 57 push edi ; |size
10016E53 |. 53 push ebx ; |ptr
10016E54 |. FF15 ECD50410 call dword ptr [1004D5EC] ; \fread
10016E5A |. 56 push esi ; /stream
10016E5B |. FF15 0CD60410 call dword ptr [1004D60C] ; \fclose
10016E61 |. 83C4 40 add esp, 40
10016E64 |. 8BCD mov ecx, ebp
10016E66 |. 57 push edi
10016E67 |. 53 push ebx
10016E68 |. E8 C392FFFF call 10010130 ; 解壓縮 Game.dat
10016E6D |. 53 push ebx ; READ 第1段
10016E6E |. E8 BD7F0200 call 1003EE30
10016E73 |. 8BF0 mov esi, eax
10016E75 |. 83C6 04 add esi, 4
10016E78 |. 8D0C1E lea ecx, dword ptr [esi+ebx]
10016E7B |. 51 push ecx ; READ 第2段
10016E7C |. E8 AF7F0200 call 1003EE30
10016E81 |. 8D7406 04 lea esi, dword ptr [esi+eax+4]
10016E85 |. 8D141E lea edx, dword ptr [esi+ebx]
10016E88 |. 52 push edx ; READ 第3段
10016E89 |. E8 A27F0200 call 1003EE30
10016E8E |. 8D7406 04 lea esi, dword ptr [esi+eax+4]
10016E92 |. 8D2C1E lea ebp, dword ptr [esi+ebx]
10016E95 |. 55 push ebp ; READ 第4段
10016E96 |. E8 957F0200 call 1003EE30
10016E9B |. 8B8C24 30010000 mov ecx, dword ptr [esp+130]
10016EA2 |. 8BB424 2C010000 mov esi, dword ptr [esp+12C] ;解密後的資料指標移到ESI
10016EA9 |. 83C4 10 add esp, 10
10016EAC |. 83C5 04 add ebp, 4
10016EAF |. 8BFD mov edi, ebp
10016EB1 |. 8BD1 mov edx, ecx
10016EB3 |. C1E9 02 shr ecx, 2
10016EB6 |. F3:A5 rep movs dword ptr es:[edi], dword>
10016EB8 |. 8BCA mov ecx, edx
10016EBA |. 6A 00 push 0 ; /pDefaultCharUsed = NULL
10016EBC |. 99 cdq ; |
10016EBD |. 83E1 03 and ecx, 3 ; |
10016EC0 |. 2BC2 sub eax, edx ; |
10016EC2 |. F3:A4 rep movs byte ptr es:[edi], byte p>; |
10016EC4 |. 8BF0 mov esi, eax ; |
10016EC6 |. 6A 00 push 0 ; |pDefaultChar = NULL
10016EC8 |. D1FE sar esi, 1 ; |
10016ECA |. 6A 00 push 0 ; |MultiByteCount = 0
10016ECC |. 6A 00 push 0 ; |MultiByteStr = NULL
10016ECE |. 56 push esi ; |WideCharCount
10016ECF |. 55 push ebp ; |WideCharStr
10016ED0 |. 6A 00 push 0 ; |Options = 0
10016ED2 |. 6A 00 push 0 ; |CodePage = CP_ACP
10016ED4 |. FF15 6CD00410 call dword ptr [1004D06C] ; \WideCharToMultiByte
10016EDA |. 8BF8 mov edi, eax
10016EDC |. 57 push edi
10016EDD |. E8 281D0300 call 10048C0A ; jmp 到 mfc42.#operator new_823
10016EE2 |. 83C4 04 add esp, 4
10016EE5 |. 894424 14 mov dword ptr [esp+14], eax
10016EE9 |. 6A 00 push 0 ; /pDefaultCharUsed = NULL
10016EEB |. 6A 00 push 0 ; |pDefaultChar = NULL
10016EED |. 57 push edi ; |MultiByteCount
10016EEE |. 50 push eax ; |MultiByteStr
10016EEF |. 56 push esi ; |WideCharCount
10016EF0 |. 55 push ebp ; |WideCharStr
10016EF1 |. 6A 00 push 0 ; |Options = 0
10016EF3 |. 6A 00 push 0 ; |CodePage = CP_ACP
10016EF5 |. FF15 6CD00410 call dword ptr [1004D06C] ; \WideCharToMultiByte
10016EFB |. 8B7424 14 mov esi, dword ptr [esp+14]
10016EFF |. 8B4C24 10 mov ecx, dword ptr [esp+10]
10016F03 |. 57 push edi
10016F04 |. 56 push esi
10016F05 |. E8 F694FFFF call 10010400 ; 解密的資料表處理
10016F0A |. 56 push esi ; /block
10016F0B |. E8 F41C0300 call 10048C04 ; \free
10016F10 |. 53 push ebx ; /block
10016F11 |. E8 EE1C0300 call 10048C04 ; \free
10016F16 |. 83C4 08 add esp, 8
10016F19 |. 5F pop edi
10016F1A |. 5E pop esi
10016F1B |. 5D pop ebp
10016F1C |. 5B pop ebx
10016F1D |. 81C4 08010000 add esp, 108
10016F23 \. C2 0800 retn 8
紀錄下 call 10010400 ; 解密的資料表處理,後面打Patch用.
---------------------------
Case 502 分析
---------------------------
10018B17 |. 8D56 02 lea edx, dword ptr [esi+2] ; Case 502 of switch 10018A9B
10018B1A |. 52 push edx
10018B1B |. E8 90170000 call 1001A2B0
10018B20 |. 8B4F 08 mov ecx, dword ptr [edi+8]
10018B23 |. 25 FFFF0000 and eax, 0FFFF
10018B28 |. 83C4 04 add esp, 4
10018B2B |. 83C0 FC add eax, -4
10018B2E |. 83C6 04 add esi, 4
10018B31 |. 50 push eax
10018B32 |. 56 push esi
10018B33 |. E8 38540200 call 1003DF70 ; 進入502封包處理
進入 call 1003DF70 來到
1003DF70 /$ 53 push ebx
1003DF71 |. 8B5C24 08 mov ebx, dword ptr [esp+8]
1003DF75 |. 56 push esi
1003DF76 |. 57 push edi
1003DF77 |. 8B7C24 14 mov edi, dword ptr [esp+14]
1003DF7B |. 8BF1 mov esi, ecx
1003DF7D |. 57 push edi
1003DF7E |. 53 push ebx
1003DF7F |. E8 7CFFFFFF call 1003DF00 ; 解密502封包資料
1003DF84 |. 8B46 10 mov eax, dword ptr [esi+10]
1003DF87 |. 57 push edi
1003DF88 |. 53 push ebx
1003DF89 |. 8B88 A04B0100 mov ecx, dword ptr [eax+14BA0]
1003DF8F |. E8 9C8FFDFF call 10016F30 ; 解密怪物ID資料表處理
1003DF94 |. 8B4E 10 mov ecx, dword ptr [esi+10]
1003DF97 |. E8 84BDFEFF call 10029D20
1003DF9C |. 5F pop edi
1003DF9D |. 5E pop esi
1003DF9E |. 5B pop ebx
1003DF9F \. C2 0800 retn 8
進入 call 10016F30 來到
10016F30 /$ 8B4424 08 mov eax, dword ptr [esp+8]
10016F34 |. 8B5424 04 mov edx, dword ptr [esp+4]
10016F38 |. 50 push eax
10016F39 |. 52 push edx
10016F3A |. E8 71BBFFFF call 10012AB0 ; 解密的資料表處理
10016F3F \. C2 0800 retn 8
紀錄下 call 10012AB0 ; 解密的資料表處理,後面打Patch用.
------------------------------
silk.dll Game.dat Patch
------------------------------
Silk.dll Hook 遊戲客戶端後會預先載入 Game.dat
這時候他的第4段跟第7段部分,沒有做載入資料表的處理.須通過原動力server驗證有註冊的用戶,
才會接收到 501 502 的封包然後把解密資料寫入 第4段跟第7段存放的記憶體空間(內存).
所以要在Silk.dll Game.dat 預先載入的代碼裡面 在第4段與第7段處理代碼打上Patch
找到
10012430 /$ 81EC 14010000 sub esp, 114
10012436 |. 53 push ebx
10012437 |. 55 push ebp
10012438 |. 56 push esi
10012439 |. 8D4424 20 lea eax, dword ptr [esp+20]
1001243D |. 57 push edi
1001243E |. 8BD9 mov ebx, ecx
10012440 |. 50 push eax
10012441 |. E8 2A5A0000 call 10017E70
10012446 |. BF 48670510 mov edi, 10056748 ; ASCII "game.dat"
1001244B |. 83C9 FF or ecx, FFFFFFFF
1001244E |. 33C0 xor eax, eax
10012450 |. 8D5424 28 lea edx, dword ptr [esp+28]
10012454 |. F2:AE repne scas byte ptr es:[edi]
10012456 |. F7D1 not ecx
10012458 |. 2BF9 sub edi, ecx
1001245A |. 68 A8630510 push 100563A8 ; /mode = "rb"
1001245F |. 8BF7 mov esi, edi ; |
10012461 |. 8BE9 mov ebp, ecx ; |
10012463 |. 8BFA mov edi, edx ; |
10012465 |. 83C9 FF or ecx, FFFFFFFF ; |
10012468 |. F2:AE repne scas byte ptr es:[edi] ; |
1001246A |. 8BCD mov ecx, ebp ; |
1001246C |. 4F dec edi ; |
1001246D |. C1E9 02 shr ecx, 2 ; |
10012470 |. F3:A5 rep movs dword ptr es:[edi], dwo>; |
10012472 |. 8BCD mov ecx, ebp ; |
10012474 |. 8D4424 2C lea eax, dword ptr [esp+2C] ; |
10012478 |. 83E1 03 and ecx, 3 ; |
1001247B |. 50 push eax ; |path
1001247C |. F3:A4 rep movs byte ptr es:[edi], byte>; |
1001247E |. FF15 04D60410 call dword ptr [1004D604] ; \fopen
10012484 |. 8B35 E4D50410 mov esi, dword ptr [1004D5E4] ; msvcrt.fseek
1001248A |. 8BF8 mov edi, eax
1001248C |. 6A 02 push 2 ; /whence = SEEK_END
1001248E |. 6A 00 push 0 ; |offset = 0
10012490 |. 57 push edi ; |stream
10012491 |. FFD6 call esi ; \fseek
10012493 |. 57 push edi ; /stream
10012494 |. FF15 E8D50410 call dword ptr [1004D5E8] ; \ftell
1001249A |. 6A 00 push 0
1001249C |. 6A 00 push 0
1001249E |. 57 push edi
1001249F |. 8BE8 mov ebp, eax
100124A1 |. FFD6 call esi
100124A3 |. 55 push ebp
100124A4 |. E8 61670300 call 10048C0A ; jmp 到 mfc42.#operator new_823
100124A9 |. 57 push edi ; /stream
100124AA |. 8BF0 mov esi, eax ; |
100124AC |. 6A 01 push 1 ; |n = 1
100124AE |. 55 push ebp ; |size
100124AF |. 56 push esi ; |ptr
100124B0 |. FF15 ECD50410 call dword ptr [1004D5EC] ; \fread
100124B6 |. 57 push edi ; /stream
100124B7 |. FF15 0CD60410 call dword ptr [1004D60C] ; \fclose
100124BD |. 83C4 40 add esp, 40
100124C0 |. 8BCB mov ecx, ebx
100124C2 |. 55 push ebp ; 這裡NOP
100124C3 |. 56 push esi ; 這裡NOP
100124C4 |. E8 67DCFFFF call 10010130 ; 這裡NOP 解壓縮 Game.dat
100124C9 |. 56 push esi ; READ 第1段
100124CA |. E8 61C90200 call 1003EE30
100124CF |. 894424 1C mov dword ptr [esp+1C], eax
100124D3 |. 83C4 04 add esp, 4
100124D6 |. 99 cdq
100124D7 |. 2BC2 sub eax, edx
100124D9 |. 8B3D 6CD00410 mov edi, dword ptr [1004D06C] ; kernel32.WideCharToMultiByte
100124DF |. 8BE8 mov ebp, eax
100124E1 |. 6A 00 push 0 ; /pDefaultCharUsed = NULL
100124E3 |. 6A 00 push 0 ; |pDefaultChar = NULL
100124E5 |. 6A 00 push 0 ; |MultiByteCount = 0
100124E7 |. D1FD sar ebp, 1 ; |
100124E9 |. 8D46 04 lea eax, dword ptr [esi+4] ; |
100124EC |. 6A 00 push 0 ; |MultiByteStr = NULL
100124EE |. 55 push ebp ; |WideCharCount
100124EF |. 50 push eax ; |WideCharStr
100124F0 |. 6A 00 push 0 ; |Options = 0
100124F2 |. 6A 00 push 0 ; |CodePage = CP_ACP
100124F4 |. FFD7 call edi ; \WideCharToMultiByte
100124F6 |. 50 push eax
100124F7 |. 894424 14 mov dword ptr [esp+14], eax
100124FB |. E8 0A670300 call 10048C0A ; jmp 到 mfc42.#operator new_823
10012500 |. 8B4C24 14 mov ecx, dword ptr [esp+14]
10012504 |. 83C4 04 add esp, 4
10012507 |. 894424 1C mov dword ptr [esp+1C], eax
1001250B |. 6A 00 push 0
1001250D |. 6A 00 push 0
1001250F |. 51 push ecx
10012510 |. 50 push eax
10012511 |. 8D46 04 lea eax, dword ptr [esi+4]
10012514 |. 55 push ebp
10012515 |. 50 push eax
10012516 |. 6A 00 push 0
10012518 |. 6A 00 push 0
1001251A |. FFD7 call edi
1001251C |. 8B5424 10 mov edx, dword ptr [esp+10]
10012520 |. 8B6C24 1C mov ebp, dword ptr [esp+1C]
10012524 |. 52 push edx
10012525 |. 55 push ebp
10012526 |. 8BCB mov ecx, ebx
10012528 |. E8 43E4FFFF call 10010970 ; 第1段資料表處理
1001252D |. 55 push ebp ; /block
1001252E |. E8 D1660300 call 10048C04 ; \free
10012533 |. 8B4424 1C mov eax, dword ptr [esp+1C]
10012537 |. 83C0 04 add eax, 4
1001253A |. 894424 18 mov dword ptr [esp+18], eax
1001253E |. 03C6 add eax, esi
10012540 |. 50 push eax ; READ 第2段
10012541 |. E8 EAC80200 call 1003EE30
10012546 |. 8B4C24 1C mov ecx, dword ptr [esp+1C]
1001254A |. 894424 20 mov dword ptr [esp+20], eax
1001254E |. 99 cdq
1001254F |. 83C4 08 add esp, 8
10012552 |. 2BC2 sub eax, edx
10012554 |. 8BE8 mov ebp, eax
10012556 |. 8D0431 lea eax, dword ptr [ecx+esi]
10012559 |. 6A 00 push 0
1001255B |. 6A 00 push 0
1001255D |. D1FD sar ebp, 1
1001255F |. 6A 00 push 0
10012561 |. 83C0 04 add eax, 4
10012564 |. 6A 00 push 0
10012566 |. 55 push ebp
10012567 |. 50 push eax
10012568 |. 6A 00 push 0
1001256A |. 6A 00 push 0
1001256C |. 894424 40 mov dword ptr [esp+40], eax
10012570 |. FFD7 call edi
10012572 |. 50 push eax
10012573 |. 894424 14 mov dword ptr [esp+14], eax
10012577 |. E8 8E660300 call 10048C0A ; jmp 到 mfc42.#operator new_823
1001257C |. 8B5424 14 mov edx, dword ptr [esp+14]
10012580 |. 83C4 04 add esp, 4
10012583 |. 894424 1C mov dword ptr [esp+1C], eax
10012587 |. 6A 00 push 0
10012589 |. 6A 00 push 0
1001258B |. 52 push edx
1001258C |. 50 push eax
1001258D |. 8B4424 30 mov eax, dword ptr [esp+30]
10012591 |. 55 push ebp
10012592 |. 50 push eax
10012593 |. 6A 00 push 0
10012595 |. 6A 00 push 0
10012597 |. FFD7 call edi
10012599 |. 8B4C24 10 mov ecx, dword ptr [esp+10]
1001259D |. 8B6C24 1C mov ebp, dword ptr [esp+1C]
100125A1 |. 51 push ecx
100125A2 |. 55 push ebp
100125A3 |. 8BCB mov ecx, ebx
100125A5 |. E8 26E1FFFF call 100106D0 ; 第2段資料表處理
100125AA |. 55 push ebp ; /block
100125AB |. E8 54660300 call 10048C04 ; \free
100125B0 |. 8B5424 18 mov edx, dword ptr [esp+18]
100125B4 |. 8B4424 1C mov eax, dword ptr [esp+1C]
100125B8 |. 8D4402 04 lea eax, dword ptr [edx+eax+4]
100125BC |. 894424 18 mov dword ptr [esp+18], eax
100125C0 |. 03C6 add eax, esi
100125C2 |. 50 push eax ; READ 第3段
100125C3 |. E8 68C80200 call 1003EE30
100125C8 |. 894424 20 mov dword ptr [esp+20], eax
100125CC |. 83C4 08 add esp, 8
100125CF |. 99 cdq
100125D0 |. 2BC2 sub eax, edx
100125D2 |. 8B4C24 14 mov ecx, dword ptr [esp+14]
100125D6 |. 8BE8 mov ebp, eax
100125D8 |. 6A 00 push 0
100125DA |. 6A 00 push 0
100125DC |. 8D0431 lea eax, dword ptr [ecx+esi]
100125DF |. 6A 00 push 0
100125E1 |. D1FD sar ebp, 1
100125E3 |. 83C0 04 add eax, 4
100125E6 |. 6A 00 push 0
100125E8 |. 55 push ebp
100125E9 |. 50 push eax
100125EA |. 6A 00 push 0
100125EC |. 6A 00 push 0
100125EE |. 894424 40 mov dword ptr [esp+40], eax
100125F2 |. FFD7 call edi
100125F4 |. 50 push eax
100125F5 |. 894424 14 mov dword ptr [esp+14], eax
100125F9 |. E8 0C660300 call 10048C0A ; jmp 到 mfc42.#operator new_823
100125FE |. 8B5424 14 mov edx, dword ptr [esp+14]
10012602 |. 83C4 04 add esp, 4
10012605 |. 894424 1C mov dword ptr [esp+1C], eax
10012609 |. 6A 00 push 0
1001260B |. 6A 00 push 0
1001260D |. 52 push edx
1001260E |. 50 push eax
1001260F |. 8B4424 30 mov eax, dword ptr [esp+30]
10012613 |. 55 push ebp
10012614 |. 50 push eax
10012615 |. 6A 00 push 0
10012617 |. 6A 00 push 0
10012619 |. FFD7 call edi
1001261B |. 8B4C24 10 mov ecx, dword ptr [esp+10]
1001261F |. 8B6C24 1C mov ebp, dword ptr [esp+1C]
10012623 |. 51 push ecx
10012624 |. 55 push ebp
10012625 |. 8BCB mov ecx, ebx
10012627 |. E8 94020000 call 100128C0 ; 第3段資料表處理
1001262C |. 55 push ebp ; /block
1001262D |. E8 D2650300 call 10048C04 ; \free
10012632 |. 8B5424 18 mov edx, dword ptr [esp+18]
10012636 |. 8B4424 1C mov eax, dword ptr [esp+1C]
1001263A |. 8D6C02 04 lea ebp, dword ptr [edx+eax+4] ; 這裡以下NOP 改為 JMP <Patch1>
1001263E |. 8D0C2E lea ecx, dword ptr [esi+ebp]
10012641 |. 51 push ecx ; READ 第4段(技能資料表)
10012642 |. E8 E9C70200 call 1003EE30
10012647 |. 8D6C28 04 lea ebp, dword ptr [eax+ebp+4]
1001264B |. 896C24 1C mov dword ptr [esp+1C], ebp
1001264F |. 8D042E lea eax, dword ptr [esi+ebp] ; NOP到這裡******************
10012652 |. 50 push eax ; READ 第5段 <Patch Run 完跳回這裡>
10012653 |. E8 D8C70200 call 1003EE30
10012658 |. 894424 24 mov dword ptr [esp+24], eax
1001265C |. 83C4 0C add esp, 0C
1001265F |. 99 cdq
10012660 |. 2BC2 sub eax, edx
10012662 |. 8B5424 14 mov edx, dword ptr [esp+14]
10012666 |. 8BE8 mov ebp, eax
10012668 |. 6A 00 push 0
1001266A |. 8D0432 lea eax, dword ptr [edx+esi]
1001266D |. 6A 00 push 0
1001266F |. D1FD sar ebp, 1
10012671 |. 6A 00 push 0
10012673 |. 83C0 04 add eax, 4
10012676 |. 6A 00 push 0
10012678 |. 55 push ebp
10012679 |. 50 push eax
1001267A |. 6A 00 push 0
1001267C |. 6A 00 push 0
1001267E |. 894424 40 mov dword ptr [esp+40], eax
10012682 |. FFD7 call edi
10012684 |. 50 push eax
10012685 |. 894424 14 mov dword ptr [esp+14], eax
10012689 |. E8 7C650300 call 10048C0A ; jmp 到 mfc42.#operator new_823
1001268E |. 8B4C24 14 mov ecx, dword ptr [esp+14]
10012692 |. 8B5424 24 mov edx, dword ptr [esp+24]
10012696 |. 83C4 04 add esp, 4
10012699 |. 894424 1C mov dword ptr [esp+1C], eax
1001269D |. 6A 00 push 0
1001269F |. 6A 00 push 0
100126A1 |. 51 push ecx
100126A2 |. 50 push eax
100126A3 |. 55 push ebp
100126A4 |. 52 push edx
100126A5 |. 6A 00 push 0
100126A7 |. 6A 00 push 0
100126A9 |. FFD7 call edi
100126AB |. 8B4424 10 mov eax, dword ptr [esp+10]
100126AF |. 8B6C24 1C mov ebp, dword ptr [esp+1C]
100126B3 |. 50 push eax
100126B4 |. 55 push ebp
100126B5 |. 8BCB mov ecx, ebx
100126B7 |. E8 F4DAFFFF call 100101B0 ; 第5段資料表處理
100126BC |. 55 push ebp ; /block
100126BD |. E8 42650300 call 10048C04 ; \free
100126C2 |. 8B4C24 18 mov ecx, dword ptr [esp+18]
100126C6 |. 8B5424 1C mov edx, dword ptr [esp+1C]
100126CA |. 8D4411 04 lea eax, dword ptr [ecx+edx+4]
100126CE |. 894424 18 mov dword ptr [esp+18], eax
100126D2 |. 03C6 add eax, esi
100126D4 |. 50 push eax ; READ 第6段
100126D5 |. E8 56C70200 call 1003EE30
100126DA |. 894424 20 mov dword ptr [esp+20], eax
100126DE |. 83C4 08 add esp, 8
100126E1 |. 99 cdq
100126E2 |. 2BC2 sub eax, edx
100126E4 |. 6A 00 push 0
100126E6 |. 8BE8 mov ebp, eax
100126E8 |. 8B4424 18 mov eax, dword ptr [esp+18]
100126EC |. 03C6 add eax, esi
100126EE |. 6A 00 push 0
100126F0 |. D1FD sar ebp, 1
100126F2 |. 6A 00 push 0
100126F4 |. 83C0 04 add eax, 4
100126F7 |. 6A 00 push 0
100126F9 |. 55 push ebp
100126FA |. 50 push eax
100126FB |. 6A 00 push 0
100126FD |. 6A 00 push 0
100126FF |. 894424 40 mov dword ptr [esp+40], eax
10012703 |. FFD7 call edi
10012705 |. 50 push eax
10012706 |. 894424 14 mov dword ptr [esp+14], eax
1001270A |. E8 FB640300 call 10048C0A ; jmp 到 mfc42.#operator new_823
1001270F |. 8B4C24 14 mov ecx, dword ptr [esp+14]
10012713 |. 8B5424 24 mov edx, dword ptr [esp+24]
10012717 |. 83C4 04 add esp, 4
1001271A |. 894424 1C mov dword ptr [esp+1C], eax
1001271E |. 6A 00 push 0
10012720 |. 6A 00 push 0
10012722 |. 51 push ecx
10012723 |. 50 push eax
10012724 |. 55 push ebp
10012725 |. 52 push edx
10012726 |. 6A 00 push 0
10012728 |. 6A 00 push 0
1001272A |. FFD7 call edi
1001272C |. 8B4424 10 mov eax, dword ptr [esp+10]
10012730 |. 8B6C24 1C mov ebp, dword ptr [esp+1C]
10012734 |. 50 push eax
10012735 |. 55 push ebp
10012736 |. 8BCB mov ecx, ebx
10012738 |. E8 F3E8FFFF call 10011030 ; 第6段資料表處理
1001273D |. 55 push ebp ; /block
1001273E |. E8 C1640300 call 10048C04 ; \free
10012743 |. 8B4C24 18 mov ecx, dword ptr [esp+18]
10012747 |. 8B5424 1C mov edx, dword ptr [esp+1C]
1001274B |. 8D6C11 04 lea ebp, dword ptr [ecx+edx+4]
1001274F |. 8D042E lea eax, dword ptr [esi+ebp]
10012752 |. 50 push eax ; READ 第7段
10012753 |. E8 D8C60200 call 1003EE30
10012758 |. 8D6C28 04 lea ebp, dword ptr [eax+ebp+4] ; 這裡以下NOP 改為 JMP <Patch2>
1001275C |. 896C24 1C mov dword ptr [esp+1C], ebp
10012760 |. 8D042E lea eax, dword ptr [esi+ebp] ; NOP 到這裡
10012763 |. 50 push eax ; READ 第8段 <Patch Run 完跳回這裡>
10012764 |. E8 C7C60200 call 1003EE30
技能資料表 Patch 在 1001263A 的地方開始 Patch
改為
10012627 |. E8 94020000 call 100128C0 ; 第3段資料表處理
1001262C |. 55 push ebp ; /block
1001262D |. E8 D2650300 call 10048C04 ; \free
10012632 |. 8B5424 18 mov edx, dword ptr [esp+18]
10012636 |. 8B4424 1C mov eax, dword ptr [esp+1C]
1001263A E9 599F0300 jmp 1004C598 ; 這裡以下NOP 改為 JMP <Patch1>
1001263F 90 nop
10012640 90 nop
10012641 90 nop
10012642 90 nop
10012643 90 nop
10012644 90 nop
10012645 90 nop
10012646 90 nop
10012647 90 nop
10012648 90 nop
10012649 90 nop
1001264A 90 nop
1001264B 90 nop
1001264C 90 nop
1001264D 90 nop
1001264E 90 nop
1001264F 90 nop
10012650 90 nop
10012651 90 nop
10012652 |. 50 push eax ; READ 第5段 <Patch Run 完跳回這裡>
E9 59 9F 03 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90
<Patch1>
1004C598 > \8D4402 04 lea eax, dword ptr [edx+eax+4] ; 技能資料表 Patch1
1004C59C . 894424 18 mov dword ptr [esp+18], eax
1004C5A0 . 03C6 add eax, esi
1004C5A2 . 50 push eax ; READ 第4段
1004C5A3 . E8 8828FFFF call 1003EE30
1004C5A8 . 8B4C24 1C mov ecx, dword ptr [esp+1C]
1004C5AC . 894424 20 mov dword ptr [esp+20], eax
1004C5B0 . 99 cdq
1004C5B1 . 83C4 08 add esp, 8
1004C5B4 . 2BC2 sub eax, edx
1004C5B6 . 8BE8 mov ebp, eax
1004C5B8 . 8D0431 lea eax, dword ptr [ecx+esi]
1004C5BB . 6A 00 push 0
1004C5BD . 6A 00 push 0
1004C5BF . D1FD sar ebp, 1
1004C5C1 . 6A 00 push 0
1004C5C3 . 83C0 04 add eax, 4
1004C5C6 . 6A 00 push 0
1004C5C8 . 55 push ebp
1004C5C9 . 50 push eax
1004C5CA . 6A 00 push 0
1004C5CC . 6A 00 push 0
1004C5CE . 894424 40 mov dword ptr [esp+40], eax
1004C5D2 . FFD7 call edi
1004C5D4 . 50 push eax
1004C5D5 . 894424 14 mov dword ptr [esp+14], eax
1004C5D9 . E8 2CC6FFFF call 10048C0A ; jmp 到 mfc42.#operator new_823
1004C5DE . 8B5424 14 mov edx, dword ptr [esp+14]
1004C5E2 . 83C4 04 add esp, 4
1004C5E5 . 894424 1C mov dword ptr [esp+1C], eax
1004C5E9 . 6A 00 push 0
1004C5EB . 6A 00 push 0
1004C5ED . 52 push edx
1004C5EE . 50 push eax
1004C5EF . 8B4424 30 mov eax, dword ptr [esp+30]
1004C5F3 . 55 push ebp
1004C5F4 . 50 push eax
1004C5F5 . 6A 00 push 0
1004C5F7 . 6A 00 push 0
1004C5F9 . FFD7 call edi
1004C5FB . 8B4C24 10 mov ecx, dword ptr [esp+10]
1004C5FF . 8B6C24 1C mov ebp, dword ptr [esp+1C]
1004C603 . 51 push ecx
1004C604 . 55 push ebp
1004C605 . 8BCB mov ecx, ebx
1004C607 . E8 F43DFCFF call 10010400 ; 501 Case 紀錄下的 Call <技能資料表處理>
1004C60C . 55 push ebp ; /block
1004C60D . E8 F2C5FFFF call 10048C04 ; \free
1004C612 . 8B5424 18 mov edx, dword ptr [esp+18]
1004C616 . 8B4424 1C mov eax, dword ptr [esp+1C]
1004C61A . 8D4402 04 lea eax, dword ptr [edx+eax+4]
1004C61E . 894424 18 mov dword ptr [esp+18], eax
1004C622 . 03C6 add eax, esi
1004C624 .^ E9 2960FCFF jmp 10012652 ; JMP TO READ 第5段
8D 44 02 04 89 44 24 18 03 C6 50 E8 88 28 FF FF 8B 4C 24 1C 89 44 24 20 99 83 C4 08 2B C2 8B E8
8D 04 31 6A 00 6A 00 D1 FD 6A 00 83 C0 04 6A 00 55 50 6A 00 6A 00 89 44 24 40 FF D7 50 89 44 24
14 E8 2C C6 FF FF 8B 54 24 14 83 C4 04 89 44 24 1C 6A 00 6A 00 52 50 8B 44 24 30 55 50 6A 00 6A
00 FF D7 8B 4C 24 10 8B 6C 24 1C 51 55 8B CB E8 F4 3D FC FF 55 E8 F2 C5 FF FF 8B 54 24 18 8B 44
24 1C 8D 44 02 04 89 44 24 18 03 C6 E9 29 60 FC FF
怪物ID 資料表 Patch 在 10012758 的地方開始 Patch
10012738 |. E8 F3E8FFFF call 10011030 ; 第6段資料表處理
1001273D |. 55 push ebp ; /block
1001273E |. E8 C1640300 call 10048C04 ; \free
10012743 |. 8B4C24 18 mov ecx, dword ptr [esp+18]
10012747 |. 8B5424 1C mov edx, dword ptr [esp+1C]
1001274B |. 8D6C11 04 lea ebp, dword ptr [ecx+edx+4]
1001274F |. 8D042E lea eax, dword ptr [esi+ebp]
10012752 |. 50 push eax ; READ 第7段
10012753 |. E8 D8C60200 call 1003EE30
10012758 E9 CE9E0300 jmp 1004C62B ; 這裡以下NOP 改為 JMP <Patch2>
1001275D 90 nop
1001275E 90 nop
1001275F 90 nop
10012760 90 nop
10012761 90 nop
10012762 90 nop
10012763 |. 50 push eax ; READ 第8段 <Patch Run 完跳回這裡>
E9 CE 9E 03 00 90 90 90 90 90 90
<Patch2>
1004C62B > \83C4 08 add esp, 8 ; 怪物ID資料表 Patch2
1004C62E . 8D4C2E 04 lea ecx, dword ptr [esi+ebp+4]
1004C632 . 894424 18 mov dword ptr [esp+18], eax
1004C636 . 50 push eax
1004C637 . 51 push ecx
1004C638 . 8BCB mov ecx, ebx
1004C63A . E8 7164FCFF call 10012AB0 ; 502 Case 紀錄下的 Call <怪物ID資料表處理>
1004C63F . 8B5424 18 mov edx, dword ptr [esp+18]
1004C643 . 8D6C2A 04 lea ebp, dword ptr [edx+ebp+4]
1004C647 . 896C24 14 mov dword ptr [esp+14], ebp
1004C64B . 8D042E lea eax, dword ptr [esi+ebp]
1004C64E .^ E9 1061FCFF jmp 10012763 ; JMP TO READ 第8段
83 C4 08 8D 4C 2E 04 89 44 24 18 50 51 8B CB E8 71 64 FC FF 8B 54 24 18 8D 6C 2A 04 89 6C 24 14
8D 04 2E E9 10 61 FC FF
到這裡 Silk.dll 破解完成 完全免驗證...
====================================================
Silk.dll 被覆寫修改
====================================================
再來就是 Slik.dll 原始檔案放在 Game.dat 第12段 每次啟動 Srobot.exe 後 Slik.dll 都會被覆寫
所以必須修改 Srobot.exe 把覆寫的 Call NOP 或者進入 Call 在代碼頭改為 retn 8
打開 Srobot.exe 搜尋字串 \silk.dll
找到
00406EB0 /$ 81EC 04010000 sub esp, 104 ; 這裡改為 retn 8
00406EB6 |. A1 C8EC4000 mov eax, dword ptr [40ECC8]
00406EBB |. 53 push ebx
00406EBC |. 8B9C24 100100>mov ebx, dword ptr [esp+110]
00406EC3 |. 55 push ebp
00406EC4 |. 8BAC24 100100>mov ebp, dword ptr [esp+110]
00406ECB |. 56 push esi
00406ECC |. 57 push edi
00406ECD |. 50 push eax
00406ECE |. 53 push ebx
00406ECF |. 55 push ebp
00406ED0 |. E8 9BFFFFFF call 00406E70
00406ED5 |. 8B15 3CEF4000 mov edx, dword ptr [40EF3C] ; Srobot.00400000
00406EDB |. 8D4C24 14 lea ecx, dword ptr [esp+14]
00406EDF |. 68 04010000 push 104 ; /BufSize = 104 (260.)
00406EE4 |. 51 push ecx ; |PathBuffer
00406EE5 |. 52 push edx ; |hModule => 00400000 (Srobot)
00406EE6 |. 90 nop ; |
00406EE7 |. E8 7346407C call kernel32.GetModuleFileName>; \GetModuleFileNameA
00406EEC |. 8D4424 14 lea eax, dword ptr [esp+14]
00406EF0 |. 6A 5C push 5C ; /c = 5C ('\')
00406EF2 |. 50 push eax ; |s
00406EF3 |. 90 nop ; |
00406EF4 |. E8 E70C8177 call msvcrt.strrchr ; \strrchr
00406EF9 |. 8BD0 mov edx, eax
00406EFB |. BF 58EE4000 mov edi, 0040EE58
00406F00 |. 83C9 FF or ecx, FFFFFFFF
00406F03 |. 33C0 xor eax, eax
00406F05 |. 83C4 08 add esp, 8
00406F08 |. F2:AE repne scas byte ptr es:[edi]
00406F0A |. F7D1 not ecx
00406F0C |. 2BF9 sub edi, ecx
00406F0E |. 8BC1 mov eax, ecx
00406F10 |. 8BF7 mov esi, edi
00406F12 |. 8BFA mov edi, edx
00406F14 |. C1E9 02 shr ecx, 2
00406F17 |. F3:A5 rep movs dword ptr es:[edi], d>
00406F19 |. 8BC8 mov ecx, eax
00406F1B |. 33C0 xor eax, eax
00406F1D |. 83E1 03 and ecx, 3
00406F20 |. F3:A4 rep movs byte ptr es:[edi], by>
00406F22 |. BF DCEC4000 mov edi, 0040ECDC ; ASCII "\silk.dll"
00406F27 |. 83C9 FF or ecx, FFFFFFFF
00406F2A |. F2:AE repne scas byte ptr es:[edi]
00406F2C |. F7D1 not ecx
00406F2E |. 2BF9 sub edi, ecx
00406F30 |. 8BC1 mov eax, ecx
00406F32 |. 8BF7 mov esi, edi
00406F34 |. 8BFA mov edi, edx
00406F36 |. 8BD0 mov edx, eax
00406F38 |. 83C9 FF or ecx, FFFFFFFF
00406F3B |. 33C0 xor eax, eax
00406F3D |. F2:AE repne scas byte ptr es:[edi]
00406F3F |. 8BCA mov ecx, edx
00406F41 |. 4F dec edi
00406F42 |. C1E9 02 shr ecx, 2
00406F45 |. F3:A5 rep movs dword ptr es:[edi], d>
00406F47 |. 8BCA mov ecx, edx
00406F49 |. 8D4424 14 lea eax, dword ptr [esp+14]
00406F4D |. 83E1 03 and ecx, 3
00406F50 |. 50 push eax ; /FileName
00406F51 |. F3:A4 rep movs byte ptr es:[edi], by>; |
00406F53 |. 90 nop ; |
00406F54 |. E8 6CAF427C call kernel32.DeleteFileA ; \DeleteFileA
00406F59 |. 8D4C24 14 lea ecx, dword ptr [esp+14]
00406F5D |. 68 C0E24000 push 0040E2C0 ; /mode = "w+b"
00406F62 |. 51 push ecx ; |path
00406F63 |. 90 nop ; |
00406F64 |. E8 A7808077 call msvcrt.fopen ; \fopen
00406F69 |. 8BF0 mov esi, eax
00406F6B |. 83C4 08 add esp, 8
00406F6E |. 85F6 test esi, esi
00406F70 |. 74 27 je short 00406F99
00406F72 |. 56 push esi ; /stream
00406F73 |. 6A 01 push 1 ; |n = 1
00406F75 |. 53 push ebx ; |size
00406F76 |. 55 push ebp ; |ptr
00406F77 |. 90 nop ; |
00406F78 |. E8 BEA78077 call msvcrt.fwrite ; \fwrite
00406F7D |. 56 push esi ; /stream
00406F7E |. 90 nop ; |
00406F7F |. E8 2D9B8077 call msvcrt.fclose ; \fclose
00406F84 |. 83C4 14 add esp, 14
00406F87 |. B8 01000000 mov eax, 1
00406F8C |. 5F pop edi
00406F8D |. 5E pop esi
00406F8E |. 5D pop ebp
00406F8F |. 5B pop ebx
00406F90 |. 81C4 04010000 add esp, 104
00406F96 |. C2 0800 retn 8
00406F99 |> 5F pop edi
00406F9A |. 5E pop esi
00406F9B |. 5D pop ebp
00406F9C |. 33C0 xor eax, eax
00406F9E |. 5B pop ebx
00406F9F |. 81C4 04010000 add esp, 104
00406FA5 \. C2 0800 retn 8
00406EB0 的位置改為 retn 8 即可
若下載的 Srobot.exe 有加密, 如加上Themida的殼.
那方法有二
一 DUMP 下來,修復OEP代碼,修復部分輸入表的 call ,讓他可以正常運行掛載即可.
二 找舊版沒加密的 Srobot.exe 來改