M
m911
Unregistered / Unconfirmed
GUEST, unregistred user!
004DAFA0 /$ 83EC 14 sub esp, 14
004DAFA3 ¦. 8B4424 18 mov eax, dword ptr [esp+18]
004DAFA7 ¦. 8D5424 01 lea edx, dword ptr [esp+1]
004DAFAB ¦. C64424 00 98 mov byte ptr [esp], 98
004DAFB0 ¦. 2BD0 sub edx, eax
004DAFB2 ¦> 8A08 /mov cl, byte ptr [eax]
004DAFB4 ¦. 880C02 ¦mov byte ptr [edx+eax], cl
004DAFB7 ¦. 40 ¦inc eax
004DAFB8 ¦. 84C9 ¦test cl, cl
004DAFBA ¦.^ 75 F6 /jnz short 004DAFB2
004DAFBC ¦. A1 D00A5B00 mov eax, dword ptr [5B0AD0]
004DAFC1 ¦. 85C0 test eax, eax
004DAFC3 ¦. 74 18 je short 004DAFDD
004DAFC5 ¦. 8D5424 18 lea edx, dword ptr [esp+18]
004DAFC9 ¦. C74424 18 110>mov dword ptr [esp+18], 11
004DAFD1 ¦. 8B08 mov ecx, dword ptr [eax]
004DAFD3 ¦. 52 push edx
004DAFD4 ¦. 8D5424 04 lea edx, dword ptr [esp+4]
004DAFD8 ¦. 52 push edx
004DAFD9 ¦. 50 push eax
004DAFDA ¦. FF51 20 call dword ptr [ecx+20]
004DAFDD ¦> 83C4 14 add esp, 14
004DAFE0 /. C2 0400 retn 4
以上这个call 是我用OD 调试出来的,我已经HOOK到了004DAFA0 位置,当我做完我要做的工作后,如何能够用汇编跳转回call的004DAFA0 原位置 让程序继续正常运行?(我怎么写程序都会崩溃).
HOOK注入部分是这样写的
procedure InjectJmpCode(ADDRS,ADDRDWORD);
var
tOldPoint:Cardinal;
begin
VirtualProtect(Pointer(ADDRS), $7, PAGE_READWRITE, tOldPoint); //是不是这里出问题了????
PByte(ADDRS)^:=$E9;
PDWORD(ADDRS+$1)^:=ADDRD-ADDRS-$5; //是不是这里出问题了????
pword(ADDRS+5)^:=$9090; //是不是这里出问题了????
end;
procedure JmpStorage;
begin
asm
......//我需要做的工作
...........//这里该如何写?????
CONST_GET_CKPASS_JMP //跳转
end;
end;
const CONST_JMP=$004DB440;
const CONST_GET_CKPASS_JMP:Integer=$XXXXXX?????;
procedure TFrm_Pop.Button1Click(Sender: TObject);
begin
InjectJmpCode(CONST_JMP, DWORD(@JmpStorage));
end;
004DAFA3 ¦. 8B4424 18 mov eax, dword ptr [esp+18]
004DAFA7 ¦. 8D5424 01 lea edx, dword ptr [esp+1]
004DAFAB ¦. C64424 00 98 mov byte ptr [esp], 98
004DAFB0 ¦. 2BD0 sub edx, eax
004DAFB2 ¦> 8A08 /mov cl, byte ptr [eax]
004DAFB4 ¦. 880C02 ¦mov byte ptr [edx+eax], cl
004DAFB7 ¦. 40 ¦inc eax
004DAFB8 ¦. 84C9 ¦test cl, cl
004DAFBA ¦.^ 75 F6 /jnz short 004DAFB2
004DAFBC ¦. A1 D00A5B00 mov eax, dword ptr [5B0AD0]
004DAFC1 ¦. 85C0 test eax, eax
004DAFC3 ¦. 74 18 je short 004DAFDD
004DAFC5 ¦. 8D5424 18 lea edx, dword ptr [esp+18]
004DAFC9 ¦. C74424 18 110>mov dword ptr [esp+18], 11
004DAFD1 ¦. 8B08 mov ecx, dword ptr [eax]
004DAFD3 ¦. 52 push edx
004DAFD4 ¦. 8D5424 04 lea edx, dword ptr [esp+4]
004DAFD8 ¦. 52 push edx
004DAFD9 ¦. 50 push eax
004DAFDA ¦. FF51 20 call dword ptr [ecx+20]
004DAFDD ¦> 83C4 14 add esp, 14
004DAFE0 /. C2 0400 retn 4
以上这个call 是我用OD 调试出来的,我已经HOOK到了004DAFA0 位置,当我做完我要做的工作后,如何能够用汇编跳转回call的004DAFA0 原位置 让程序继续正常运行?(我怎么写程序都会崩溃).
HOOK注入部分是这样写的
procedure InjectJmpCode(ADDRS,ADDRDWORD);
var
tOldPoint:Cardinal;
begin
VirtualProtect(Pointer(ADDRS), $7, PAGE_READWRITE, tOldPoint); //是不是这里出问题了????
PByte(ADDRS)^:=$E9;
PDWORD(ADDRS+$1)^:=ADDRD-ADDRS-$5; //是不是这里出问题了????
pword(ADDRS+5)^:=$9090; //是不是这里出问题了????
end;
procedure JmpStorage;
begin
asm
......//我需要做的工作
...........//这里该如何写?????
CONST_GET_CKPASS_JMP //跳转
end;
end;
const CONST_JMP=$004DB440;
const CONST_GET_CKPASS_JMP:Integer=$XXXXXX?????;
procedure TFrm_Pop.Button1Click(Sender: TObject);
begin
InjectJmpCode(CONST_JMP, DWORD(@JmpStorage));
end;