I just started looking into reverse engineering, hooks and things like that.
So I would have some questions about these things. I tried to search after these but I couldn't find any description/tutorial that could help me :/.
1. What is hooking exactly? What do we do when we are hooking, and what kind of hooking methods can I use/which is the "best"?
2. What is detouring, and how can I do it?
I have a very basic knowledge of reverse engineering.
Thanks in advance!
Last edited by Fleep; 11-02-2013 at 04:42 AM. Reason: Invalid title
Generally hook is a jump to your code. Id doesnt have to be in the first API bytes, but you can for example gather interesting register value in some moment of programs flow, for example when function resolves player pointer you can just jump out and store it. Thats the basic option
You can also hook entire functions. Professional way is about reconstructing the function params and call convention, writing own function to handle the real api call and decide what to do (if you want execute normally, or if you want to spoof smth).
I think there are also system-wide (global) and specific hooks for just 1 program.
You could make a hook everywhere in the function, in the beginning,mid-hook or when it's about to return.
Hooking = detouring. Which means modifying the programs flow so it would at a specific point execute your code.