template<class T>
static T* FindHudElement(const char* name)
{
static auto pThis = *reinterpret_cast<DWORD**>(ssdgfadefault(GetModuleHandleA("client.dll"), ("B9 ? ? ? ? E8 ? ? ? ? 8B 5D 08")) + 1);
static auto find_hud_element = reinterpret_cast<DWORD(__thiscall*)(void*, const char*)>(ssdgfadefault(GetModuleHandleA("client.dll"), ("55 8B EC 53 8B 5D 08 56 57 8B F9 33 F6 39 77 28")));
return (T*)find_hud_element(pThis, name);
}
struct hud_weapons_t {
std::int32_t* get_weapon_count() {
return reinterpret_cast<std::int32_t*>(std::uintptr_t(this) + 0x80);
}
};
void Inventory::force_full_update()
{
static auto fn = reinterpret_cast<std::int32_t(__thiscall*)(void*, std::int32_t)>(ssdgfadefault(GetModuleHandleA("client.dll"), ("55 8B EC 51 53 56 8B 75 08 8B D9 57 6B FE 2C")));
auto element = FindHudElement<std::uintptr_t*>(("CCSGO_HudWeaponSelection"));
auto hud_weapons = reinterpret_cast<hud_weapons_t*>(std::uintptr_t(element) - 0xA0);
if (hud_weapons == nullptr)
return;
if (!*hud_weapons->get_weapon_count())
return;
for (std::int32_t i = 0; i < *hud_weapons->get_weapon_count(); i++)
i = fn(hud_weapons, i);
в инвентарь ченджере
if (MessageType == k_EMsgGCAdjustItemEquippedState) {
обновляем инвентарь.
csgo.m_client_state()->m_iDeltaTick = -1;
force_full_update();
}
}