[Tutorial] Hooking CallBack(s) - How to Hook any callback
#1

Hooking CallBack(s) - How to Hook any callback

Hello all,
This tutorial is about hooking callback(s)-(any).

Let's start with simple example of OnFIlterScriptInit hook:
Код:
public OnFilterScriptInit()
{
	CallLocalFunction("RL@_OnFilterScriptInit", "");
	//Your code here!
}
#if defined _ALS_OnFilterScriptInit
	#undef OnFilterScriptInit
#else
	#define _ALS_OnFilterScriptInit
#endif
#define OnFilterScriptInit RL@_OnFilterScriptInit
forward RL@_OnFilterScriptInit();
First we need to call the public that we want no hook:
Код:
public OnFilterScriptInit()
{
	
}
Next we need to add this code to hook the callback:
Код:
#if defined _ALS_OnFilterScriptInit
	#undef OnFilterScriptInit
#else
	#define _ALS_OnFilterScriptInit
#endif
#define OnFilterScriptInit PRE_OnFilterScriptInit
And the last step, we need to forward the hook callbcack:
Код:
forward PRE_ OnFilterScriptInit();
Now, when OnFilterScript will called the hook public wiil called to.

Enjoy!

Reply
#2

Well since there is finally a tutorial about hooking
Can someone please tell me what does hooking mean?
What's the benefit of hooking a callback?
Reply
#3

And why don't you use y_hooks it will save you from all the hassle anyways just hook TheCallback

and as ****** said this is not explained good, i think even you don't know what those codes do.
Reply
#4

Really I didn't understand nothing from this tutorial and what you are talking about. What ALS and PRE mean?
Reply
#5

The tutorial is not explained well.

Anyway, use y_hook its more faster than ALS.
Reply
#6

Quote:
Originally Posted by ******
Посмотреть сообщение
There's been a tutorial on hooking since the technique was first developed, people just don't bother searching. I may start deleting "tutorials" like this one that don't explain anything so that they don't bury the actually good ones.
Excuse me sir, but i did bother and searched, but i couldn't find exactly what does Hooking mean, i just found hooking methods without explaination.
If you can send me the tutorial through PM would be appreciated.
Reply
#7

Quote:
Originally Posted by Romel
Посмотреть сообщение
The tutorial is not explained well.

Anyway, use y_hook its more faster than ALS.
And I can't see any single reason to post it after a few users have already done that. :X

Quote:
Originally Posted by ******
Посмотреть сообщение
There's been a tutorial on hooking since the technique was first developed, people just don't bother searching. I may start deleting "tutorials" like this one that don't explain anything so that they don't bury the actually good ones.
Please do so! (No offence Swimor, he just has pointed something important, and i'm agree with him)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)