最新TP的资料清0也有
void HandleDebugZero(ULONG uImageBase) //主要清零处理函数{
ULONG uAddr_1=uImageBase + 0x4082;//清零CRC检测首地址
ULONG uAddr_2=uImageBase + 0x6ea8;//清零处1首地址
ULONG uAddr_3=uImageBase + 0x2228;//清零处2首地址
GetDnfEprocessAddr(uImageBase); //取得DNF 进程基址
//这个进程基址在处理第三和第四处清零的时候用到
if(uImageBase==0)
{
return;
}
DisableWP(); //清除CR0
*(PUSHORT)uAddr_1=0xc3;
//由于这个检测函数没压入参数,所以直接ret
//0x6ea8 //第一处清零首地址,也是直接ret
*(PUCHAR)(uAddr_2)=0xc3;
//0x2228 //第二处清零首地址,还是直接ret
*(PUCHAR)(uAddr_3)=0xc3;
EnableWP();//恢复CR0
g_uDebugPortOffset=g_uDebugPortOffset+0xbc;
//取到清零位置的地址
HandleDebugPortPop(true,uImageBase);//处理第三处清零
HandleDebugPortPush(true,uImageBase);//处理第四处清零
}
void HandleDebugPortPop(BOOLEAN bHook,ULONG uImageBase)
{
if(bHook)
{
//hook pop
if(uImageBase==0)
{
return ;
}
g_uDebugPortPopHookAddr=uImageBase+0xbb0f0;//pop hook地址
g_uDebugPortPopRetAddr=uImageBase+0xba2bc;//pop retn 地址
if(g_uDebugPortPopHookAddr==0)
{
return;
}
RtlCopyMemory((PVOID)g_szBackupDebugPortPop,
(PVOID)g_uDebugPortPopHookAddr,
5);//保存hook地址,用于恢复
InLineHookEngine(g_uDebugPortPopHookAddr,(int)FuckDebugPortPop);
//__asm int 3
}
else
{
if(g_uDebugPortPopHookAddr==0)
{
return;
}
// 最好判断下 TP是否 已经卸载
int TesSafe=GetTesSafeBassAddr();
if(TesSafe!=0)
{
//KIRQL Irql=KeRaiseIrqlToDpcLevel();
DisableWP();
RtlCopyMemory((PVOID)g_uDebugPortPopHookAddr,
(PVOID)g_szBackupDebugPortPop,
5);//保存hook地址,用于恢复
EnableWP();
}
}
}
void HandleDebugPortPush(BOOLEAN bHook,ULONG uImageBase)
{
if(bHook)
{
//hook pop
if(uImageBase==0)
{
return ;
}
g_uDebugPortPushHookAddr=uImageBase+0xba4ca;//push hook地址
g_uDebugPortPushRetAddr=uImageBase+0xba2bc;//push retn 地址
if(g_uDebugPortPushHookAddr==0)
{
return;
}
RtlCopyMemory((PVOID)g_szBackupDebugPortPush,
(PVOID)g_uDebugPortPushHookAddr,
5);//保存hook地址,用于恢复
InLineHookEngine(g_uDebugPortPushHookAddr,(int)FuckDebugPortPush);
//__asm int 3
}
else
{
if(g_uDebugPortPushHookAddr==0)
{
return;
}
// 最好判断下 TP是否 已经卸载
int TesSafe=GetTesSafeBassAddr();
if(TesSafe!=0)
{
//KIRQL Irql=KeRaiseIrqlToDpcLevel();
DisableWP();
RtlCopyMemory((PVOID)g_uDebugPortPushHookAddr,
(PVOID)g_szBackupDebugPortPush,
5);//保存hook地址,用于恢复
EnableWP();
}
}
}
__declspec(naked)void FuckDebugPortPop()
{
//DbgPrint("Pop");
__asm
{
pushfd
cmp edx,g_uDebugPortOffset //判断入栈的参数是否是清零位置的地址
jnz POPLABLE
popfd
add esp,0x4
jmp g_uDebugPortPopRetAddr
POPLABLE:
popfd
pop dword ptr
jmp g_uDebugPortPopRetAddr
}
}
__declspec(naked)void FuckDebugPortPush()
{
//DbgPrint("Push");
__asm
{
pushfd
cmp edx,g_uDebugPortOffset//判断入栈的参数是否是清零位置的地址
jnz PUSHLABLE
popfd
push 0
jmp g_uDebugPortPushRetAddr
PUSHLABLE:
popfd
push dword ptr
jmp g_uDebugPortPushRetAddr
}
}
强烈支持楼主ing……
页:
[1]