-
Notifications
You must be signed in to change notification settings - Fork 0
/
engine.cpp
69 lines (46 loc) · 2.46 KB
/
engine.cpp
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#include "includes.h"
/*bool Hooks::IsConnected( ) {
Stack stack;
static Address IsLoadoutAllowed{ pattern::find( g_csgo.m_client_dll, XOR( "84 C0 75 04 B0 01 5F" ) ) };
if( g_menu.main.misc.unlock.get( ) && stack.ReturnAddress( ) == IsLoadoutAllowed )
return false;
return g_hooks.m_engine.GetOldMethod< IsConnected_t >( IVEngineClient::ISCONNECTED )( this );
}
bool Hooks::IsHLTV( ) {
Stack stack;
static Address SetupVelocity{ pattern::find( g_csgo.m_client_dll, XOR( "84 C0 75 38 8B 0D ? ? ? ? 8B 01 8B 80" ) ) };
// AccumulateLayers
if( g_bones.m_running )
return true;
// fix for animstate velocity.
if( stack.ReturnAddress( ) == SetupVelocity )
return true;
return g_hooks.m_engine.GetOldMethod< IsHLTV_t >( IVEngineClient::ISHLTV )( this );
}*/
bool Hooks::IsConnected() {
if (!this || !g_csgo.m_engine)
return false;
Stack stack;
static Address IsLoadoutAllowed{ pattern::find(g_csgo.m_client_dll, XOR("84 C0 75 04 B0 01 5F")) };
if (g_menu.main.misc.unlock.get() && stack.ReturnAddress() == IsLoadoutAllowed)
return false;
return g_hooks.m_engine.GetOldMethod< IsConnected_t >(IVEngineClient::ISCONNECTED)(this);
}
bool Hooks::IsHLTV() {
if (!this || !g_csgo.m_engine)
return false;
Stack stack;
static const Address return_to_setup_velocity{ pattern::find(g_csgo.m_client_dll, XOR("84 C0 75 38 8B 0D ? ? ? ? 8B 01 8B 80")) };
static const Address return_to_accumulate_layers = pattern::find(g_csgo.m_client_dll, XOR("84 C0 75 0D F6 87"));
if (stack.ReturnAddress() == return_to_setup_velocity)
return true;
if (stack.ReturnAddress() == return_to_accumulate_layers)
return true;
return g_hooks.m_engine.GetOldMethod< IsHLTV_t >(IVEngineClient::ISHLTV)(this);
}
void Hooks::EmitSound( IRecipientFilter& filter, int iEntIndex, int iChannel, const char* pSoundEntry, unsigned int nSoundEntryHash, const char* pSample, float flVolume, float flAttenuation, int nSeed, int iFlags, int iPitch, const vec3_t* pOrigin, const vec3_t* pDirection, void* pUtlVecOrigins, bool bUpdatePositions, float soundtime, int speakerentity ) {
if( strstr( pSample, "null" ) ) {
iFlags = ( 1 << 2 ) | ( 1 << 5 );
}
g_hooks.m_engine_sound.GetOldMethod<EmitSound_t>( IEngineSound::EMITSOUND )( this, filter, iEntIndex, iChannel, pSoundEntry, nSoundEntryHash, pSample, flVolume, flAttenuation, nSeed, iFlags, iPitch, pOrigin, pDirection, pUtlVecOrigins, bUpdatePositions, soundtime, speakerentity );
}