帮忙看下这个hook怎么写???(200)

X

xernet

Unregistered / Unconfirmed
GUEST, unregistred user!
这是段反汇编代码要hook的地方004FBCA1 。004FBC95 |8B15 28F68800 mov edx, dword ptr [88F628]004FBC9B |8B82 48C80000 mov eax, dword ptr [edx+C848]004FBCA1 |8B0D A0A86800 mov ecx, dword ptr [68A8A0] 004FBCA7 |3B88 B0000000 cmp ecx, dword ptr [eax+B0]004FBCAD |75 1E jnz short 004FBCCD要hook的地方 004FBCA1 |8B0D A0A86800 mov ecx, dword ptr [68A8A0] 先转到我的程序HookFun()处理,再回来继续往下执行。 procedure HookFun();stdcall; var L:DWORD; begin asm pushad mov ecx, dword ptr [$68A8A0] mov L,ecx; end; TestWindow.edt_Test.Text:=IntToStr(L); asm popad; end; end; procedure JmpHook(); var P:pointer; begin p:=@HookFun; asm mov al,$E8 mov [$4FBCA1],al lea eax,P mov eax,[eax] sub eax,$4FBCA7 mov [$4FBCA2],eax mov al,$90 mov [$4FBCA7],al end; end;procedure TestWindow.btn_TestClick(Sender: TObject);begin JmpHook();end;这代码一执行然后就出错,TestWindow.edt_Test.Text:=IntToStr(L)没有得到期待的值是JmpHook()函数里面的嵌入汇编代码问题吗?
 
T

tseug

Unregistered / Unconfirmed
GUEST, unregistred user!
1、看看是否在同一地址空间,确定准确的地址2、保存好现场
 
X

xernet

Unregistered / Unconfirmed
GUEST, unregistred user!
我已经解决了,只要有人吱声分就全部给谁,tseug都给你了!
 
Top Bottom