Baaleos
Joined: 02 Sep 2007 Posts: 830
|
Posted: Thu Mar 31, 2016 12:56 Post subject: Converting windows hook to linux |
|
|
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. |
|