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

Using Offset or Signature of a function?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
steambob
Member
Join Date: Sep 2007
Old 09-27-2007 , 06:53   Using Offset or Signature of a function?
Reply With Quote #1

Do I understand right that a virtual function can be found and then called either by an offset or by using a signature? Can these two methods be applied to any function or are there limits for one of the methods? Which way is the best and the easiest?

And how do I find an offset for a function for a certain mod? Is there any plugin that could do that?

Thanks.
steambob is offline
Nican
Veteran Member
Join Date: Jan 2006
Location: NY
Old 09-27-2007 , 15:19   Re: Using Offset or Signature of a function?
Reply With Quote #2

http://wiki.alliedmods.net/Signature_Scanning

http://forums.alliedmods.net/showthread.php?t=53893

http://wiki.alliedmods.net/Useful_Si...s_%28Source%29
__________________
http://www.nican132.com
I require reputation!
Nican is offline
Send a message via ICQ to Nican Send a message via MSN to Nican
steambob
Member
Join Date: Sep 2007
Old 09-27-2007 , 16:32   Re: Using Offset or Signature of a function?
Reply With Quote #3

Thanks for the links.

But what I really mean is how it is possible to find offsets for functions. Such that you can put, like for example in sdktools.games.txt,
Code:
"Offsets"
        {
            "CommitSuicide"
            {
                "windows"    "360"
                "linux"        "361"
            }
        }
Such offsets are often used in many plugins.
My questions are:
1) are there functions that can be called only via offsets and not sigscanning or vice versa,
or both ways are in principle applicable to the same function;
2) how do I find the function offsets?

Or may be I miss something fundamental?

Last edited by steambob; 09-27-2007 at 16:35.
steambob is offline
pRED*
Join Date: Dec 2006
Old 09-27-2007 , 16:50   Re: Using Offset or Signature of a function?
Reply With Quote #4

1) Yes. I think. Well you can only find the offset for some functions. You can probably sig scan these as well if you wanted...

2) Try http://plugins.mfzb.de/offsets/http://plugins.mfzb.de/offsets/

Has text files with the list of offsets for each mod (and all the ent props for each mod)
pRED* is offline
Nican
Veteran Member
Join Date: Jan 2006
Location: NY
Old 09-27-2007 , 18:06   Re: Using Offset or Signature of a function?
Reply With Quote #5

Hm.. you can by signatures or by offset
offsets are more made for plugins and game play
signatures is basically forcing to call a function within the game

You can find list of offsets here:
http://plugins.mfzb.de/offsets/


EDIT:
Dang, pRED beat me to it
__________________
http://www.nican132.com
I require reputation!
Nican is offline
Send a message via ICQ to Nican Send a message via MSN to Nican
steambob
Member
Join Date: Sep 2007
Old 09-27-2007 , 18:09   Re: Using Offset or Signature of a function?
Reply With Quote #6

Thank you guys !
steambob is offline
sumguy14
Senior Member
Join Date: Apr 2006
Old 09-27-2007 , 18:36   Re: Using Offset or Signature of a function?
Reply With Quote #7

You should probably try to use vitual functions hooking if you can. If you can set a players model with a signature and a vfunc, then pick the vfunc.

Signature scanning is like engine hacking basically and are more likely to break on updates than vfuncs.
__________________
Don't think of them as bugs think of them as unexpected features
sumguy14 is offline
mooman2
Member
Join Date: Apr 2007
Old 09-27-2007 , 23:14   Re: Using Offset or Signature of a function?
Reply With Quote #8

Shouldn't vfuncs break more easily? I'm not sure how the vtable is arranged, but I think if valve decides to insert another virtual function before the one you want, the offset you used would be defunct. And signatures would be less likely to break unless valve drastically changed the content. example: the teleport function should always contain three unique instructions that involve the new coordinates.
mooman2 is offline
sumguy14
Senior Member
Join Date: Apr 2006
Old 09-27-2007 , 23:19   Re: Using Offset or Signature of a function?
Reply With Quote #9

Not so sure about that.

Signature scanning is finding the function by it's place in memory (i think), so if anything with the functions we hook through sigscanning is changed in the engines code, I am pretty sure it could break the signature, in which case someone would have to find the new one.
__________________
Don't think of them as bugs think of them as unexpected features
sumguy14 is offline
pRED*
Join Date: Dec 2006
Old 09-28-2007 , 05:55   Re: Using Offset or Signature of a function?
Reply With Quote #10

Sigscanning finds a unique pattern in memory that identifies the function you want to call.
For a signature to change, yes there'd have to be a change in the actual function, whereas vtables could change due to an extra function being added
pRED* 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 14:04.


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