Hooking
From Wikipedia, the free encyclopedia
For the slang term generally indicating female prostitution see prostitution.
Hooking in programming is a technique employing so called hooks to make a chain of procedures as a handler. Thus, after the handled event occurs, control flow follows the chain in specific order. New hook registers its own address as handler for the event and is expected to call the original handler at some point, usually at the end. Each hook is required to pass execution to the previous handler, eventually arriving to the default one, otherwise the chain is broken. Unregistering the hook means setting the original procedure as the event handler.
Hooking can be used for many purposes including debugging and extending original functionality, but also misused to inject (potentially malicious) code to the event handler.

