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

Get address via signature on non pointers?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hlstriker
Green Gaben
Join Date: Mar 2006
Location: OH-IO!
Old 12-22-2014 , 22:53   Get address via signature on non pointers?
Reply With Quote #1

You can get an address using signatures for pointer variables but can you get an address from non-pointer variables?

Here is an example getting the address of the g_pGameRules pointer then calling CCSGameRules::FreezePlayers.

Gamedata:
Spoiler


Example plugin:
Spoiler


As you can see this works perfectly fine because g_pGameRules is a pointer. What if instead we had the signature to a variable called g_GameRules which was the object itself? Is there any method available to us to get the address of said object so we can still call its member functions?
hlstriker is offline
psychonic

BAFFLED
Join Date: May 2008
Old 12-23-2014 , 07:47   Re: Get address via signature on non pointers?
Reply With Quote #2

The above isn't bad as an example, but unnecessary due to there already being a SDKCall_GameRules call type, not requiring SDKCall_Raw.

As for the actual question, can you say more specifically what exact function you're wanting to call?
psychonic is offline
hlstriker
Green Gaben
Join Date: Mar 2006
Location: OH-IO!
Old 12-23-2014 , 11:50   Re: Get address via signature on non pointers?
Reply With Quote #3

Yeah the above was just an example to help explain what I'm trying to do.

My goal is to call:
bool CPlayerVoiceListener::IsPlayerSpeaking( int nPlayerIndex )

Looking at player_voice_listener.cpp you can see there is g_PlayerVoiceListener which I would like the address of.
hlstriker is offline
psychonic

BAFFLED
Join Date: May 2008
Old 12-23-2014 , 14:18   Re: Get address via signature on non pointers?
Reply With Quote #4

In this case, you might not be able to do everything from a SourceMod plugin. If using an extension, it would be easiest and not require gamedata to just lookup the corresponding vscript function in the scriptdesc at the top of the file and call that.

You could try calling PlayerVoiceListener() itself to get the ptr, but I'm not sure if you can easily get and pass it in SM, and even so, it wouldn't be viable on Windows as finding a unique signature would be near impossible.

Edit: alternatively, use DHooks to hook IServerGameClients::ClientVoice and reimplement the CPlayerVoiceListener logic in a plugin, tracking it exactly as the game does.

Last edited by psychonic; 12-23-2014 at 14:21.
psychonic is offline
hlstriker
Green Gaben
Join Date: Mar 2006
Location: OH-IO!
Old 12-23-2014 , 15:24   Re: Get address via signature on non pointers?
Reply With Quote #5

Alright, I was hoping there would be a method without using a custom extension but the DHooks solution will work fine. Thanks :>
hlstriker 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 22:25.


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