- UID
- 232374
- 帖子
- 16
- 主題
- 6
- 精華
- 0
- 積分
- 10
- 楓幣
- 80
- 威望
- 8
- 存款
- 0
- 贊助金額
- 0
- 推廣
- 0
- GP
- 15
- 閱讀權限
- 10
- 性別
- 保密
- 在線時間
- 32 小時
- 註冊時間
- 2018-4-20
- 最後登入
- 2023-10-14
|
我記得這個功能以前有人開源過 鼠標地址+xx 寫0 需要開個線程循環寫 非常浪費CPU資源
目前可以用以下這幾種方法實現
第壹種 HOOK V_CalcRefdef
對pparams->punchangle 清零操作 我目前就是用的這種方法
if (g_Vars.AibBot.Enable && g_Vars.AibBot.AntiJitter )
{
VectorClear(pparams->punchangle);
}
第二種 對寫0地址Nop
bool g_AntiJitterError = false;
void AntiJitter()
{
static bool InitData = false;
static DWORD dwAddres, dwAddres2;
static char* Buff[4] = { nullptr,nullptr,nullptr,nullptr };
static bool IsOK = false;
if (!InitData)
{
InitData = true;
if (AntiHookGetScanCode((char*)("f3 0f 11 05 ?? ?? ?? ?? F3 0F 10 8F 78 01 00 00"), dwAddres, (HMODULE)Engine::g_Offset.GetHwBase()))
{
DWORD dwOldProtect;
VirtualProtect((void*)dwAddres, 1024, PAGE_EXECUTE_READWRITE, &dwOldProtect);
}
else
{
LPSTR Msg = UnicodeToUTF8(L"AntiJitter Error1!");
g_Util.GameCsoMsg(Msg);
g_AntiJitterError = true;
return;
}
if (AntiHookGetScanCode((char*)("F3 0F 10 81 A0 00 00 00 F3 0F 11 05"), dwAddres2, (HMODULE)Engine::g_Offset.GetHwBase()))
{
DWORD dwOldProtect;
VirtualProtect((void*)dwAddres2, 1024, PAGE_EXECUTE_READWRITE, &dwOldProtect);
}
else
{
LPSTR Msg = UnicodeToUTF8(L"AntiJitter Error2!");
g_Util.GameCsoMsg(Msg);
g_AntiJitterError = true;
return;
}
}
else
{
if (g_Vars.AibBot.AntiJitter)
{
if (Buff[0] == nullptr)
{
Buff[0] = new char[8];
for (int i = 0; i < 8; i++)
{
Buff[0][i] = *(byte*)(dwAddres + i);
}
Buff[1] = new char[8];
for (int i = 0; i < 8; i++)
{
Buff[1][i] = *(byte*)((dwAddres+0x24) + i);
}
Buff[2] = new char[0x18];
for (int i = 0; i < 0x18; i++)
{
Buff[2][i] = *(byte*)((dwAddres2) + i);
}
}
if (!IsOK)
{
IsOK = true;
for (int i = 0; i < 8; i++)
{
*(byte*)(dwAddres + i) = 0x90;
}
for (int i = 0; i < 8; i++)
{
*(byte*)((dwAddres + 0x24) + i) = 0x90;
}
for (int i = 0; i < 0x18; i++)
{
*(byte*)((dwAddres2)+i) = 0x90;
}
LPSTR Msg = UnicodeToUTF8(L"AntiJitter OK!");
g_Util.GameCsoMsg(Msg);
}
}
else
{
//恢复
if (IsOK && Buff[0] != nullptr)
{
IsOK = false;
for (int i = 0; i < 8; i++)
{
*(byte*)(dwAddres + i) = Buff[0][i];
}
for (int i = 0; i < 8; i++)
{
*(byte*)((dwAddres + 0x24) + i) = Buff[1][i];
}
for (int i = 0; i < 0x18; i++)
{
*(byte*)((dwAddres2)+i) = Buff[2][i];
}
LPSTR Msg = UnicodeToUTF8(L"AntiJitter off!");
g_Util.GameCsoMsg(Msg);
}
}
}
/*374308E0 - F3 0F11 05 A0757E39 - movss [397E75A0],xmm0
374308E8 - F3 0F10 8F 78010000 - movss xmm1,[edi+00000178]
f3 0f 11 05 ?? ?? ?? ?? F3 0F 10 8F 78 01 00 00
F3 0F 10 45 CC F3 0F 11 05 ?? ?? ?? ??
37517736 - F3 0F10 81 A0000000 - movss xmm0,[ecx+000000A0]
3751773E - F3 0F11 05 A0757E39 - movss [397E75A0],xmm0
37517746 - F3 0F10 81 A4000000 - movss xmm0,[ecx+000000A4]
3751774E - F3 0F11 05 A4757E39 - movss [397E75A4],xmm0
F3 0F 10 81 A0 00 00 00 F3 0F 11 05*/
}
第三種就是循環寫0啦 就不多說了
反正各有優缺點 這個功能只是視覺上沒有後坐力
|
-
總評分: 楓幣 + 5
查看全部評分
|