-
Автор темы
- #1
I did it on the example of Legendware, since many people face this problem on this source.
IWeaponSystem.hpp (create this in interfaces):
C++:
#pragma once
class weapon_info_t;
class IWeaponSystem
{
public:
virtual ~IWeaponSystem() = 0;
virtual void pad04() = 0;
virtual weapon_info_t* GetWpnData(int weaponId) = 0;
};
C++:
#undef m_weaponsys /// ~ 41 line
IWeaponSystem* C_CSGO::m_weaponsys() {
if (!p_weaponsys)
p_weaponsys = *reinterpret_cast<IWeaponSystem**>(util::FindSignature(crypt_str("client.dll"), g_ctx.signatures.at(21).c_str()) + 2);
return p_weaponsys;
} /// ~340 line
C++:
#include "../interfaces/IWeaponSystem.hpp" // ~31 line
IWeaponSystem* m_weaponsys(); /// ~86 line
IWeaponSystem* p_weaponsys = nullptr; /// ~126 line
C++:
crypt_str("8B 35 ? ? ? ? FF 10 0F B7 C0") /// ~68 line
C++:
#define m_weaponsys g_csgo.m_weaponsys /// ~97 line
C++:
weapon_info_t* weapon_t::get_csweapon_info() /// ~66 line
{
if (!m_weaponsys())
return nullptr;
return m_weaponsys()->GetWpnData(this->m_iItemDefinitionIndex());
}