pa1n-dev / nixware_x64

Cheat for Garry's Mod (x64)
https://pa1n-dev.github.io/nixware/showcase/
GNU General Public License v3.0
45 stars 5 forks source link

Netvars #23

Open Ceypi opened 3 months ago

Ceypi commented 3 months ago

Ok so im writing up a spectator list.

This is my c_base_entity code right now. ( doesnt compile obviously ) How would you approach @pa1n-dev ?

I'm new to C++ and don't exactly understand how you got the index numbers.

c_base_entity* get_observer_target()
{
    uint32_t m_hObserverTarget = *(uint32_t*)((uintptr_t)this + 0x2c88);
    return interfaces::entity_list->get_entity_from_handle(m_hObserverTarget);
}
Ceypi commented 3 months ago

Was looking at gmodsdk,cranium and CFF for information about their ways of getting netvars but they use macro's instead of the system that is inplace in nixware

Ceypi commented 3 months ago

Got it to work. ( From Cranium ) c_base_entity get_observer_target() { using fn = void (__fastcall)(void); static fn f; if (!f) f = (fn)memory::pattern_scanner("client.dll", "40 53 48 83 EC 20 48 39 0D ? ? ? ? 48 8B D9 75 26"); return (c_base_entity*)f(this); }

pa1n-dev commented 3 months ago

Thank you very much for your contribution to the project