Raised This Month: $7 Target: $400
 1% 

Not able to create a unique signature


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Spirit_12
Veteran Member
Join Date: Dec 2012
Location: Toronto, CA
Old 08-18-2018 , 04:43   Not able to create a unique signature
Reply With Quote #1

I'm trying to hook a function, but couldn't create a unique signature for it. What are my other options?
__________________
Spirit_12 is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 08-18-2018 , 05:32   Re: Not able to create a unique signature
Reply With Quote #2

The easiest way is to just include some bytes from the next function, which'll work fine until they're reordered - the more stable way is to create a signature to a (part of a) function that calls the function you're after, then extract the pointer to the function you want at runtime.
__________________
asherkin is offline
Spirit_12
Veteran Member
Join Date: Dec 2012
Location: Toronto, CA
Old 08-18-2018 , 11:42   Re: Not able to create a unique signature
Reply With Quote #3

In your first suggestion, am I to believe that even if the signature ends on the next function the hook is still being created on the starting function?

As for the second option. I don’t think it is being called by any other function for me to extract pointer. Maybe one offset, but I’ll have to check again.
__________________
Spirit_12 is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 08-18-2018 , 11:54   Re: Not able to create a unique signature
Reply With Quote #4

Quote:
Originally Posted by Spirit_12 View Post
In your first suggestion, am I to believe that even if the signature ends on the next function the hook is still being created on the starting function?
Correct, the signature just finds the first byte.
__________________
asherkin is offline
Spirit_12
Veteran Member
Join Date: Dec 2012
Location: Toronto, CA
Old 08-18-2018 , 14:31   Re: Not able to create a unique signature
Reply With Quote #5

The make signature script in sourcemod tools is not able to do this?
__________________
Spirit_12 is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 08-18-2018 , 14:51   Re: Not able to create a unique signature
Reply With Quote #6

Quote:
Originally Posted by Spirit_12 View Post
The make signature script in sourcemod tools is not able to do this?
No, it does its best to avoid letting you accidentally shoot yourself in the foot.

You could just comment out the end of function check.
__________________
asherkin is offline
Reply


Thread Tools
Display Modes

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 07:52.


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