在一个文件中,主程序调用RYDLL32.dll文件,我在OD中将dll文件修改后,文件大小不变,指令也无误,保存后,再次调试主程序,加载此动态库时出错,为什么?请高手指点一二:
00424517 FF15 E4604400 call dword ptr ds:[4460E4] ;Rydll32.Rockey
F7进入后代码:{ 00BD1270 R> 81EC 7C020000 sub esp,27C
00BD1276 A1 8C80BD00 mov eax,dword ptr ds:[BD808C]
00BD127B 8B0D 9080BD00 mov ecx,dword ptr ds:[BD8090]
00BD1281 8A15 9480BD00 mov dl,byte ptr ds:[BD8094]
00BD1287 53 push ebx
00BD1288 55 push ebp
00BD1289 56 push esi
00BD128A 57 push edi
00BD128B 8BBC24 90020000 mov edi,dword ptr ss:[esp+290]
00BD1292 |. 66:85FF test di,di
00BD1295 |. C74424 10 0000000>mov dword ptr ss:[esp+10],0
00BD129D |. 894424 14 mov dword ptr ss:[esp+14],eax
00BD12A1 |. 894C24 18 mov dword ptr ss:[esp+18],ecx
00BD12A5 |. 885424 1C mov byte ptr ss:[esp+1C],dl
00BD12A9 |. 75 11 jnz short Rydll32.00BD12BC
00BD12AB |. 5F pop edi
00BD12AC |. 5E pop esi
00BD12AD |. 5D pop ebp
00BD12AE |. 66:B8 0800 mov ax,8
00BD12B2 |. 5B pop ebx
00BD12B3 |. 81C4 7C020000 add esp,27C
00BD12B9 |. C2 2400 retn 24
00BD12BC |> A1 90AABD00 mov eax,dword ptr ds:[BDAA90]
00BD12C1 |. 85C0 test eax,eax
00BD12C3 |. 0F85 A1020000 jnz Rydll32.00BD156A
00BD12C9 |. FF15 3C70BD00 call dword ptr ds:[<&KERNEL32.Ge>;
kernel32.GetVersion
00BD12CF |. 6A 00 push 0 ;
/hTemplateFile = NULL
00BD12D1 |. 68 80000000 push 80 ;
|Attributes = NORMAL
00BD12D6 |. 6A 03 push 3 ;
|Mode = OPEN_EXISTING
00BD12D8 |. 6A 00 push 0 ;
|pSecurity = NULL
00BD12DA |. 3D 00000080 cmp eax,80000000 ; |
00BD12DF |. 6A 00 push 0 ;
|ShareMode = 0
00BD12E1 |. 68 000000C0 push C0000000 ;
|Access = GENERIC_READ|GENERIC_WRITE
00BD12E6 |. 0F83 19020000 jnb Rydll32.00BD1505 ; |
00BD12EC |. 68 7C80BD00 push Rydll32.00BD807C ;
|FileName = "\\.\ROCKEYNT"
00BD12F1 |. FF15 2470BD00 call dword ptr ds:[<&KERNEL32.Cr>;
\CreateFileA
00BD12F7 |. 83F8 FF cmp eax,-1
00BD12FA |. A3 90AABD00 mov dword ptr ds:[BDAA90],eax
00BD12FF |. 0F85 65020000 jnz Rydll32.00BD156A
00BD1305 |. 68 3F000F00 push 0F003F
00BD130A |. 6A 00 push 0
00BD130C |. 6A 00 push 0
00BD130E |. FF15 0070BD00 call dword ptr ds:[<&ADVAPI32.Op>;
advapi32.OpenSCManagerA
00BD1314 |. 8BD8 mov ebx,eax
00BD1316 |. 85DB test ebx,ebx
00BD1318 |. 75 11 jnz short Rydll32.00BD132B
00BD131A |. 5F pop edi
00BD131B |. 5E pop esi
00BD131C |. 5D pop ebp
00BD131D |. 66:0D FFFF or ax,0FFFF
00BD1321 |. 5B pop ebx
00BD1322 |. 81C4 7C020000 add esp,27C
00BD1328 |. C2 2400 retn 24
}
改为如下代码,并用OD菜单命令全部修正保存:
00BD1270 R> 81EC 7C020000 sub esp,27C
00BD1276 A1 8C80BD00 mov eax,dword ptr ds:[BD808C]
00BD127B 8B0D 9080BD00 mov ecx,dword ptr ds:[BD8090]
00BD1281 8A15 9480BD00 mov dl,byte ptr ds:[BD8094]
00BD1287 E9 D7020000 jmp Rydll32.00BD1563
00BD128C 90 nop
00BD128D 90 nop
00BD128E 90 nop
00BD128F 90 nop
00BD1290 90 nop
00BD1291 90 nop
00BD1292 |. 66:85FF test di,di
00BD1295 |. C74424 10 0000000>mov dword ptr ss:[esp+10],0
00BD129D |. 894424 14 mov dword ptr ss:[esp+14],eax
00BD12A1 |. 894C24 18 mov dword ptr ss:[esp+18],ecx
00BD12A5 |. 885424 1C mov byte ptr ss:[esp+1C],dl
00BD12A9 |. 75 11 jnz short Rydll32.00BD12BC
00BD12AB |. 5F pop edi
00BD12AC |. 5E pop esi
00BD12AD |. 5D pop ebp
00BD12AE |. 66:B8 0800 mov ax,8
00BD12B2 |. 5B pop ebx
00BD12B3 |. 81C4 7C020000 add esp,27C
00BD12B9 |. C2 2400 retn 24
00BD12BC |> A1 90AABD00 mov eax,dword ptr ds:[BDAA90]
00BD12C1 |. 85C0 test eax,eax
00BD12C3 |. 0F85 A1020000 jnz Rydll32.00BD156A
00BD12C9 |. FF15 3C70BD00 call dword ptr ds:[<&KERNEL32>;
kernel32.GetVersion
00BD12CF |. 6A 00 push 0 ;
/hTemplateFile = NULL
00BD12D1 |. 68 80000000 push 80 ;
|Attributes = NORMAL
00BD12D6 |. 6A 03 push 3 ; |Mode
= OPEN_EXISTING
00BD12D8 |. 6A 00 push 0 ;
|pSecurity = NULL
00BD12DA |. 3D 00000080 cmp eax,80000000 ; |
00BD12DF |. 6A 00 push 0 ;
|ShareMode = 0
00BD12E1 |. 68 000000C0 push C0000000 ;
|Access = GENERIC_READ|GENERIC_WRITE
00BD12E6 |. 0F83 19020000 jnb Rydll32.00BD1505 ; |
00BD12EC |. 68 7C80BD00 push Rydll32.00BD807C ;
|FileName = "\\.\ROCKEYNT"
00BD12F1 |. FF15 2470BD00 call dword ptr ds:[<&KERNEL32>;
\CreateFileA
00BD12F7 |. 83F8 FF cmp eax,-1
00BD12FA |. A3 90AABD00 mov dword ptr ds:[BDAA90],eax
00BD12FF |. 0F85 65020000 jnz Rydll32.00BD156A
00BD1305 |. 68 3F000F00 push 0F003F
00BD130A |. 6A 00 push 0
00BD130C |. 6A 00 push 0
00BD130E |. FF15 0070BD00 call dword ptr ds:[<&ADVAPI32>;
advapi32.OpenSCManagerA
00BD1314 |. 8BD8 mov ebx,eax
00BD1316 |. 85DB test ebx,ebx
00BD1318 |. 75 11 jnz short Rydll32.00BD132B
00BD131A |. 5F pop edi
00BD131B |. 5E pop esi
00BD131C |. 5D pop ebp
00BD131D |. 66:0D FFFF or ax,0FFFF
00BD1321 |. 5B pop ebx
00BD1322 |. 81C4 7C020000 add esp,27C
00BD1328 |. C2 2400 retn 24
[注意]传递专业知识、拓宽行业人脉——看雪讲师团队等你加入!