BigPackets Forum

Community => Discussion => Programmers => Topic started by: KittoniuM on August 21, 2018, 02:01:57 pm

Title: Find Globals Pointer on Source Engine Games
Post by: KittoniuM on August 21, 2018, 02:01:57 pm
(https://i.imgur.com/vDXycTJ.png)
achievements/%s.vmt

here r some sigs in kitterengine

Code: [Select]
size_t GlobalsSigGmod = FindSignature("client.dll", "A1 ? ? ? ? C1 E6 08 03 B3 ? ? ? ?");
if (GlobalsSigGmod != 0)
{
s_Globals = **(CGlobals***)(GlobalsSigGmod + 1);
return;
}

size_t GlobalsSigBlackmesa = FindSignature("client.dll", "A1 ? ? ? ? F3 0F 10 40 ? 0F 2F 81 ? ? ? ? 72 03");
if (GlobalsSigBlackmesa != 0)
{
s_Globals = **(CGlobals***)(GlobalsSigBlackmesa + 1);
return;
}

size_t GlobalsSigSynergy = FindSignature("client.dll", "A1 ? ? ? ? F3 0F 10 40 ? 0F 2F C1 76 12");
if (GlobalsSigSynergy != 0)
{
s_Globals = **(CGlobals***)(GlobalsSigSynergy + 1);
return;
}

//"gameui_preventescapetoshow\n" above it is call to globals->curtime + 0.25
size_t GlobalsSigL4D1 = FindSignature("client.dll", "A1 ? ? ? ? 83 78 14 01 74 0C 8B 49 14 85 C9 74 05 E9 ? ? ? ?");
if (GlobalsSigL4D1 != 0)
{
s_Globals = **(CGlobals***)(GlobalsSigL4D1 + 1);
return;
}
Title: Re: Find Globals Pointer on Source Engine Games
Post by: Kelse on August 22, 2018, 10:07:14 am
I personally prefer to use CHLClient->HudUpdate ( https://github.com/VSES/SourceEngine2007/blob/43a5c90a5ada1e69ca044595383be67f40b33c61/se2007/game/client/cdll_client_int.cpp#L903-L925 ) to grab globals.

(https://b.catgirlsare.sexy/xGJQ.png)

Code: [Select]
CGlobals = **(CGlobalVarsBase***) (Util::FindPattern((DWORD)GetModuleHandleA("client.dll"), 0x7FFFFFFF, "\x8B\x0D????\xD8\x49\x0C") + 0x02);

The + 2 is an exercise for the reader to figure out, I suppose. ?\_(ツ)_/?