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

Hook abstract class function


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kadet.89
Veteran Member
Join Date: Nov 2012
Location: Serbia
Old 03-01-2014 , 15:06   Hook abstract class function
Reply With Quote #1

In the source code, I see the function:

physconstraint.cpp
PHP Code:
IPhysicsConstraint *CreateConstraintIPhysicsConstraintGroup *pGroup, const hl_constraint_info_t &info )
{
    ...
    return 
physenv->CreateHingeConstraintinfo.pObjects[0], info.pObjects[1], pGroupm_hinge );

But I do not see it in IDA. And I also can not find its implementation in sdk. However, it exists and works. Is there a way to know the implementation of this function and how can I hook it?

vphysics_interface.h
PHP Code:
abstract_class IPhysicsEnvironment
{
public:
    ...
    
virtual IPhysicsConstraint    *CreateHingeConstraintIPhysicsObject *pReferenceObjectIPhysicsObject *pAttachedObjectIPhysicsConstraintGroup *pGroup, const constraint_hingeparams_t &hinge ) = 0;
    ...

kadet.89 is offline
Send a message via Skype™ to kadet.89
donrevan
AlliedModders Donor
Join Date: Jul 2010
Old 03-01-2014 , 18:52   Re: Hook abstract class function
Reply With Quote #2

I guess you're searching in the wrong place(most-likely server/engine binary). Take a look into the vphysics.dll/so
donrevan is offline
kadet.89
Veteran Member
Join Date: Nov 2012
Location: Serbia
Old 03-02-2014 , 03:15   Re: Hook abstract class function
Reply With Quote #3

I use Total commander for sdk directory autoscaning. So I'm sure that it does not exist in the sdk. I see a similar thing in IDA. Where there should be a call to this function, I only see weird code. And the function scanner does not return positive results.
kadet.89 is offline
Send a message via Skype™ to kadet.89
donrevan
AlliedModders Donor
Join Date: Jul 2010
Old 03-02-2014 , 18:39   Re: Hook abstract class function
Reply With Quote #4

I just had some old csgo *.so's on hand so I took a quick look at csgo-ds/bin/vphysics.so:
Code:
CPhysicsEnvironment::CreateLimitedHingeConstraint(IPhysicsObject *, IPhysicsObject *, IPhysicsConstraintGroup *, constraint_limitedhingeparams_t  const&)
It's right in there.

VTable offset for it is 79. As I said I got this from a rather "old" csgo binary but I highly doubt the offset for it has changed.

Last edited by donrevan; 03-02-2014 at 18:40.
donrevan 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:42.


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