能力值:
( LV6,RANK:90 )
|
-
-
2 楼
int WINAPI MyAddr()
{
__asm
{
pushad
//do something .....
popad
jmp oldnextaddr ;跳到修改地址的下一条指令,使程序正常执行
}
}
_asm
{
lea edi,oldaddr ;保存老的内容
mov esi,wanthookaddr
cld
movsd
movsb
}
newsend[0]=0xe9;
_asm
{
lea eax,MyAddr
mov ebx,wanthookaddr
sub eax,ebx
sub eax,5
mov dword ptr [newsend+1],eax
}
HANDLE hProc;
dwIdNew=GetCurrentProcessId();
dwIdOld=dwIdNew;
hProc=OpenProcess(PROCESS_ALL_ACCESS,0,dwIdOld);
VirtualProtectEx(hProc,wanthookaddr,5,PAGE_READWRITE,&dwIdOld);
WriteProcessMemory(hProc,wanthookaddr,newsend,5,0);
VirtualProtectEx(hProc,wanthookaddr,5,dwIdOld,&dwIdOld);
不知道对否?
|
|
|