Raised This Month: $ Target: $400
 0% 

[Solved] How to find pvPrivateData offsets using IDA?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
yokomo
Surprise Ascot!
Join Date: May 2010
Location: Malaysia
Old 12-27-2012 , 05:50   [Solved] How to find pvPrivateData offsets using IDA?
Reply With Quote #1

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?
__________________
Team-MMG CS1.6 Servers:
✅ MultiMod -- 103.179.44.152:27016
✅ Zombie Plague -- 103.179.44.152:27015
✅ Zombie Escape -- 103.179.44.152:27017
✅ Klassik Kombat -- 103.179.44.152:27018
✅ Boss-Battle -- 103.179.44.152:27019

Last edited by yokomo; 12-28-2012 at 06:58.
yokomo is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 12-27-2012 , 05:55   Re: [Help] How to find pvPrivateData offsets using IDA?
Reply With Quote #2

http://forums.alliedmods.net/showpos...01#post1712101 ?
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 12-27-2012 , 06:59   Re: [Help] How to find pvPrivateData offsets using IDA?
Reply With Quote #3

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.

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.
__________________
Arkshine is offline
teh ORiON
Member
Join Date: Sep 2011
Location: Denmark
Old 12-27-2012 , 20:00   Re: [Help] How to find pvPrivateData offsets using IDA?
Reply With Quote #4

Quote:
Originally Posted by Arkshine View Post
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.

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 ^^.
teh ORiON is offline
yokomo
Surprise Ascot!
Join Date: May 2010
Location: Malaysia
Old 12-28-2012 , 06:56   Re: [Help] How to find pvPrivateData offsets using IDA?
Reply With Quote #5

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.
__________________
Team-MMG CS1.6 Servers:
✅ MultiMod -- 103.179.44.152:27016
✅ Zombie Plague -- 103.179.44.152:27015
✅ Zombie Escape -- 103.179.44.152:27017
✅ Klassik Kombat -- 103.179.44.152:27018
✅ Boss-Battle -- 103.179.44.152:27019
yokomo 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 13:25.


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