__forceinline uint8_t* c_base_player::get_server_edict() {
static uintptr_t server_addr = **(uintptr_t**)((utils::find_sig_ida(_("server.dll"), _("8B 15 ? ? ? ? 33 C9 83 7A 18 01"))) + 0x2);
int max_clients = *(int*)((uintptr_t)server_addr + 0x18);
int index = this->ent_index();
if (index > 0 && max_clients >= 1) {
if (index <= max_clients) {
int v10 = index * 16;
uintptr_t v11 = *(uintptr_t*)(server_addr + 96);
if (v11) {
if (!((*(uintptr_t*)(v11 + v10) >> 1) & 1)) {
uintptr_t v12 = *(uintptr_t*)(v10 + v11 + 12);
if (v12) {
uint8_t* _return = nullptr;
__asm
{
pushad
mov ecx, v12
mov eax, dword ptr[ecx]
call dword ptr[eax + 0x14]
mov _return, eax
popad
}
return _return;
}
}
}
}
}
return nullptr;
}
void c_base_player::draw_server_hitboxes() {
float duration = i::globalvars->m_interval_per_tick * 2.0f;
auto server_player = get_server_edict();
if (server_player) {
static uintptr_t called = patterns::server_hitbox;
__asm
{
pushad
movss xmm1, duration
push 1 //bool monoColor
mov ecx, server_player
call called
popad
}
}
}