Raised This Month: $51 Target: $400
 12% 

pointer offset


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
AltPluzF4
Senior Member
Join Date: Aug 2007
Old 08-25-2008 , 08:55   pointer offset
Reply With Quote #1

A lot of things make use of g_pGameRules, by getting it's offset of CreateGameRulesObject.

I understand how the signature for CreateGameRulesObject is found, but how does one go about getting the offset for g_pGameRules?

Thanks for any info on this.
AltPluzF4 is offline
teame06
i have a hat
Join Date: Feb 2005
Location: Hat City
Old 08-25-2008 , 10:13   Re: pointer offset
Reply With Quote #2

Look at sdktools ext from sourcemod. It make use of getting g_pGameRules.
__________________
No private support via Instant Message
GunGame:SM Released
teame06 is offline
Send a message via AIM to teame06
AltPluzF4
Senior Member
Join Date: Aug 2007
Old 08-25-2008 , 10:34   Re: pointer offset
Reply With Quote #3

Yes, that is what I was referring to. They have the offset for g_pGameRules set to 2 in the gamedata text file.

What I'm asking, is how did they come up with that offset of 2?

Thanks for the response though.
AltPluzF4 is offline
DS
SourceMod Developer
Join Date: Sep 2004
Location: WI, USA
Old 08-25-2008 , 15:38   Re: pointer offset
Reply With Quote #4

Code:
.text:22188970 8B 0D 84 7A 57 22                       mov     ecx, dword_22577A84
.text:22188976 85 C9                                   test    ecx, ecx
.text:22188978 74 07                                   jz      short loc_22188981
.text:2218897A 8B 01                                   mov     eax, [ecx]
.text:2218897C 6A 01                                   push    1
.text:2218897E FF 50 2C                                call    dword ptr [eax+2Ch]
The above is the beginning of the disassembly for CreateGameRulesObject.

And for quick reference, this is the signature used by SDKTools:
Code:
\x8B\x0D\x2A\x2A\x2A\x2A\x85\xC9\x74\x2A\x8B\x01\x6A\x01\xFF\x50
Two bytes into the signature is a wildcard of four bytes (\x2A). That is intended to be the address of the variable that holds g_pGameRules. That would be dword_22577A84 in the disassembly above.
__________________
エル・プサイ・コングルゥ
DS is offline
AltPluzF4
Senior Member
Join Date: Aug 2007
Old 08-25-2008 , 16:29   Re: pointer offset
Reply With Quote #5

Alright, I believe I understand now. Thank you.
AltPluzF4 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 13:31.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode