logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Converting windows hook to linux

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Linux development
View previous topic :: View next topic  
Author Message
Baaleos



Joined: 02 Sep 2007
Posts: 830

PostPosted: Thu Mar 31, 2016 12:56    Post subject: Converting windows hook to linux Reply with quote

Code:

int __fastcall CNWSEffectListHandler__OnApplyDamage( void * pThis, void*, CNWSObject * obj, CGameEffect * effect, int iArg )

int (__fastcall *CNWSEffectListHandler__OnApplyDamageNext)( void * pThis, void*, CNWSObject * obj, CGameEffect * effect, int iArg );




That was the hook I had in Windows for hooking the EffectList_OnApplyDamage etc

I am unsure how to represent this in Linux.
I have the offset etc
I am just out of practice with the arguments.

In Linux, the Symbols puts it here:

0816c7e4 T CNWSEffectListHandler::OnApplyDamage(CNWSObject *, CGameEffect *, int)


Should this be represented in the hook as :


Note - I found this declaration in lib\nwn_data.c - Is there some way I can use this as a shortcut? Eg: Change the = NULL to be = 0x0816c7e4;
Code:


int (*CNWSEffectListHandler__OnApplyDamage)(CNWSEffectListHandler *, CNWSObject *, CGameEffect *, int32_t)




I've started my first plugin from scratch -(almost) - using nwnx_strucs as a starting point.
So i just need to get to grips with creating my first hook in linux.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Linux development All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group