-
-
[求助]hook inject问题,不知是否和数据段属性相关?
-
发表于:
2006-7-17 17:37
4444
-
[求助]hook inject问题,不知是否和数据段属性相关?
写了一dll完成函数RtlFreeHeap的hook 。
DllMain ()
{
case DLL_PROCESS_ATTACH:
hook() ;//实现RtlFreeHeap的hook
..........
}
hook()
{
strncpy( api_RtlFreeHeap.ModuleName, "ntdll.dll", 16 );
strncpy( api_RtlFreeHeap.ApiName,"RtlFreeHeap", 16);
hook_api_RtlFreeHeap= new CHookApi_Jmp( api_RtlFreeHeap.ModuleName, api_RtlFreeHeap.ApiName, reinterpret_cast <FARPROC> (My_RtlFreeHeap) );
api_RtlFreeHeap.MyFunc = reinterpret_cast <FARPROC>(&hook_api_RtlFreeHeap->m_OldFunc[0]);
return true;
}
__declspec (naked)BOOLEAN WINAPI My_RtlFreeHeap( HANDLE hHeap,ULONG dwFlags, PVOID pAddress)
{
__asm{
}
}
[注意]传递专业知识、拓宽行业人脉——看雪讲师团队等你加入!