Raised This Month: $32 Target: $400
 8% 

[IDA/DHooks]How to get vtable offsets


Post New Thread Reply   
 
Thread Tools Display Modes
Peace-Maker
SourceMod Plugin Approver
Join Date: Aug 2008
Location: Germany
Old 03-01-2016 , 22:21   Re: [IDA/DHooks]How to get vtable offsets
Reply With Quote #31

Quote:
Originally Posted by Spirit_12 View Post
PHP Code:
int g_SurvivorCountsOffset = -1;

charSurvCounts=((char*)this)+g_SurvivorCountsOffset;

g_pGameConf->GetOffset("SurvivorCounters",&g_SurvivorCountsOffset); 
These are the 3 incidents where this offset is being used. Am I looking at the wrong function then?

Extension Thread: https://forums.alliedmods.net/showthread.php?t=121945
"SurvivorCounters" != "CTerrorGameRules::CalculateSurvivalMultiplie r" ?!
__________________
Peace-Maker is offline
Spirit_12
Veteran Member
Join Date: Dec 2012
Location: Toronto, CA
Old 03-01-2016 , 22:31   Re: [IDA/DHooks]How to get vtable offsets
Reply With Quote #32

Quote:
Originally Posted by Miu View Post
You were talking about "CTerrorGameRules::CalculateSurvivalMultiplie r" before, not "SurvivorCounters", and it looks like it's not a virtual method, but the offset of a member of CTerrorGameRules
Like I said, I'm clueless to the whole offset idea. Can you give me more information on how to tackle this problem ?
__________________
Spirit_12 is offline
Miu
Veteran Member
Join Date: Nov 2013
Old 03-04-2016 , 22:17   Re: [IDA/DHooks]How to get vtable offsets
Reply With Quote #33

How to find the offset? You find some place it's referenced in the disassembly of the methods of the class. You should ask the person who created the extension, ideally.
Miu is offline
Spirit_12
Veteran Member
Join Date: Dec 2012
Location: Toronto, CA
Old 03-04-2016 , 23:08   Re: [IDA/DHooks]How to get vtable offsets
Reply With Quote #34

Quote:
Originally Posted by Miu View Post
How to find the offset? You find some place it's referenced in the disassembly of the methods of the class. You should ask the person who created the extension, ideally.
He has been inactive, so chances of that are not ideal. I'm just looking for an overview and not the exacts. Like if I knew what I was finding that would have helped.
__________________
Spirit_12 is offline
Dr!fter
The Salt Boss
Join Date: Mar 2007
Old 03-05-2016 , 19:47   Re: [IDA/DHooks]How to get vtable offsets
Reply With Quote #35

First, you haven't exactly asked what you need help with, second this is probably not the right thread for it. However, from looking at the gamedata, the offsets are offsets into a certain function. There is very little overview we can give (without looking at the code) since its all dependent on what it is that the offset is for, which we probably dont know since we didnt write the extension.

Last edited by Dr!fter; 03-05-2016 at 19:49.
Dr!fter is offline
Spirit_12
Veteran Member
Join Date: Dec 2012
Location: Toronto, CA
Old 03-05-2016 , 20:00   Re: [IDA/DHooks]How to get vtable offsets
Reply With Quote #36

How can one find the offsets in a certain function? I followed your tutorial and I can find the offsets from the vtables, but like you said the offsets are offsets into a certain function. Is there a tutorial to figure that out?
__________________
Spirit_12 is offline
Miu
Veteran Member
Join Date: Nov 2013
Old 03-05-2016 , 20:58   Re: [IDA/DHooks]How to get vtable offsets
Reply With Quote #37

it looks like a member variable of cterrorgamerules, so references to it would show up like ds:[ecx + offset] on windows and I think something like ds[ebp + offset] on linux since gcc puts this on the stack iirc, but it might be offset by other things on the stack in that case

if calculatesurvivalmultiplier needs to use the survivor count, I'd assume it'd be referenced there
Miu is offline
Spirit_12
Veteran Member
Join Date: Dec 2012
Location: Toronto, CA
Old 03-06-2016 , 01:23   Re: [IDA/DHooks]How to get vtable offsets
Reply With Quote #38

This is what I found by searching.

Spoiler
__________________
Spirit_12 is offline
donrevan
AlliedModders Donor
Join Date: Jul 2010
Old 03-08-2016 , 11:46   Re: [IDA/DHooks]How to get vtable offsets
Reply With Quote #39

Quote:
Originally Posted by Miu View Post
(...) and I think something like ds[ebp + offset] on linux since gcc puts this on the stack iirc (...)
No. It's GPR + offset too.

@Spirit_12
try this offsets(linux): 1040
I don't really know what the function(CalculateSurvivalMultiplier) is supposed to do so this is just a guess.

Last edited by donrevan; 03-08-2016 at 11:59.
donrevan is offline
Spirit_12
Veteran Member
Join Date: Dec 2012
Location: Toronto, CA
Old 03-08-2016 , 22:55   Re: [IDA/DHooks]How to get vtable offsets
Reply With Quote #40

Quote:
Originally Posted by donrevan View Post
No. It's GPR + offset too.

@Spirit_12
try this offsets(linux): 1040
I don't really know what the function(CalculateSurvivalMultiplier) is supposed to do so this is just a guess.
Can I know how did you get to that number?
__________________
Spirit_12 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 15:28.


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