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

[TS] Finding offsets with IDA?


Post New Thread Reply   
 
Thread Tools Display Modes
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 08-19-2017 , 14:56   Re: [TS] Finding offsets with IDA?
Reply With Quote #21

i try it in kali system and it worked thx ^^
I have another question :
how i can know linux dif 5 or 4 ?
__________________

Last edited by abdobiskra; 08-19-2017 at 14:56.
abdobiskra is offline
Send a message via Skype™ to abdobiskra
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 08-19-2017 , 15:18   Re: [TS] Finding offsets with IDA?
Reply With Quote #22

It looks like pointers to member functions on GCC (Linux) are 16 instead of 8 bytes long like with the MSVC compiler (Windows). Because of that, for every pointer to a member function in entity classes 1 offset is added to every member after that one on Linux.

In the newest HLSDK there are 4 pointers to member functions in CBaseEntity (for Think, Touched, Used and Blocked events), and because every entity class inherits from that, pretty much all classes at least have +4 on Linux.

Last edited by klippy; 08-19-2017 at 15:19.
klippy is offline
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 08-19-2017 , 16:14   Re: [TS] Finding offsets with IDA?
Reply With Quote #23

Yes i get it now thx again for greate info
__________________
abdobiskra is offline
Send a message via Skype™ to abdobiskra
MrPickles
Senior Member
Join Date: Aug 2022
Location: Colombia
Old 03-25-2023 , 03:41   Re: [TS] Finding offsets with IDA?
Reply With Quote #24

Can Anyone help me with this?

Code:
.text:000F61A0 ; CBasePlayer *__cdecl CBasePlayer::SetBodyPart(CBasePlayer *this, float, int)
.text:000F61A0                 public SetBodyPart__11CBasePlayerfi
.text:000F61A0 SetBodyPart__11CBasePlayerfi proc near  ; DATA XREF: LOAD:000176DC↑o
.text:000F61A0                                         ; .eh_frame:001EA1B8↓o
.text:000F61A0
.text:000F61A0 arg_0           = dword ptr  8
.text:000F61A0 arg_4           = dword ptr  0Ch
.text:000F61A0 arg_8           = dword ptr  10h
.text:000F61A0
.text:000F61A0 ; __unwind {
.text:000F61A0                 push    ebp
.text:000F61A1                 mov     ebp, esp
.text:000F61A3                 mov     eax, [ebp+8]
.text:000F61A6                 fld     [ebp+arg_4]
.text:000F61A9                 mov     edx, [ebp+arg_8]
.text:000F61AC                 fstp    dword ptr [eax+598h]
.text:000F61B2                 mov     [eax+584h], edx
.text:000F61B8                 mov     esp, ebp
.text:000F61BA                 pop     ebp
.text:000F61BB                 retn
.text:000F61BB ; } // starts at F61A0
.text:000F61BB SetBodyPart__11CBasePlayerfi endp
i need the offset and the parameters, i think is a pdata_float

CBasePlayer *__cdecl CBasePlayer::SetBodyPart(CBasePlayer *this, float, int)
its linux version

Code:
CBasePlayer *__cdecl CBasePlayer::SetBodyPart(CBasePlayer *this, float a2, int a3)
{
  CBasePlayer *result; // eax

  result = this;
  *((float *)this + 358) = a2;
  *((_DWORD *)this + 353) = a3;
  return result;
}
and the pseudo code

Last edited by MrPickles; 03-25-2023 at 03:43.
MrPickles 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 01:47.


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