AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [Solved] How to find pvPrivateData offsets using IDA? (https://forums.alliedmods.net/showthread.php?t=204057)

yokomo 12-27-2012 05:50

[Solved] How to find pvPrivateData offsets using IDA?
 
Hi, i want to learn how to find pvPrivateData offsets using IDA for any mods.

For example these offsets:
m_pActiveItem, m_rgAmmo, m_flFlashLightTime, m_fLongJump and so on. I already install IDA Pro 6.1 in my PC. Any tutorial for it?

bibu 12-27-2012 05:55

Re: [Help] How to find pvPrivateData offsets using IDA?
 
http://forums.alliedmods.net/showpos...01#post1712101 ?

Arkshine 12-27-2012 06:59

Re: [Help] How to find pvPrivateData offsets using IDA?
 
It's actually very easy. I wanted to do some tutorial (my sig lol), but it requires you explain the context before and such, and it's a pain. :P

Fast explanation :

Let's take CBasePlayer class as example. You know that inside members are declared like m_iYokomo. When we're talking about 'offset', it means 'position' from the base. If you see CBasePlayer::Killed() (windows), when you decompile, the first line:

*(this + 300)

this = it's the CBasePlayer object passed.

300 is thefull offset. It's actually what you're looking for. It's the position from the base which points out to something, here member.
'Full' because it includes the size of each members. Most of time it's 4 ( int, float, pointer, etc.), but not always, something you will see in IDA. Here a int.

To get the offset, to be used with [get|set]_pdata_[int|float] natives, you just divide the full offset by it's size : 300 / 4 = 75 = m_LastHitGroup

Just a simple example, it doesn't cover all situations (char/bool/short, etc.), just to show you fastly how you can retrieve them from IDA.

teh ORiON 12-27-2012 20:00

Re: [Help] How to find pvPrivateData offsets using IDA?
 
Quote:

Originally Posted by Arkshine (Post 1861147)
It's actually very easy. I wanted to do some tutorial (my sig lol), but it requires you explain the context before and such, and it's a pain. :P

Fast explanation :

Let's take CBasePlayer class as example. You know that inside members are declared like m_iYokomo. When we're talking about 'offset', it means 'position' from the base. If you see CBasePlayer::Killed() (windows), when you decompile, the first line:

*(this + 300)

this = it's the CBasePlayer object passed.

300 is thefull offset. It's actually what you're looking for. It's the position from the base which points out to something, here member.
'Full' because it includes the size of each members. Most of time it's 4 ( int, float, pointer, etc.), but not always, something you will see in IDA. Here a int.

To get the offset, to be used with [get|set]_pdata_[int|float] natives, you just divide the full offset by it's size : 300 / 4 = 75 = m_LastHitGroup

Just a simple example, it doesn't cover all situations (char/bool/short, etc.), just to show you fastly how you can retrieve them from IDA.

Interesting, looking forward to that tutorial ^^.

yokomo 12-28-2012 06:56

Re: [Help] How to find pvPrivateData offsets using IDA?
 
Finally i can do this, thanks Connor for teaching me step by step, and thanks Arkshine for the fast explanation, but i think tutorial is still needed to help others.


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

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