forked from faggotman69/Prometheus
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIsHltv.h
More file actions
31 lines (26 loc) · 776 Bytes
/
IsHltv.h
File metadata and controls
31 lines (26 loc) · 776 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#pragma once
#include "HookIncludes.h"
#include <intrin.h>
using is_hltv_t = bool(__thiscall*)(void*);
bool __fastcall hkIsHltv(void* ecx, void* edx)
{
static auto ofunc = hooks::engine.get_original<is_hltv_t>(93);
uintptr_t pvs_entity;
__asm
{
mov pvs_entity, edi
}
void* returna = _ReturnAddress();
static auto v1 = (DWORD)U::pattern_scan(GetModuleHandleW(L"client.dll"), "84 C0 0F 85 ? ? ? ? A1 ? ? ? ? 8B B7");
if (reinterpret_cast<DWORD>(returna) == (v1))
{
if (pvs_entity)
{
*(int*)(pvs_entity + 0xA24) = -1;
*(int*)(pvs_entity + 0xA2C) = *(int *)(pvs_entity + 0xA28);
*(int*)(pvs_entity + 0xA28) = 0;
return true;
}
}
return ofunc(ecx);
}