detours.cpp
detours.h

Created for Game-Deception by Matthew L (Azorbix)
Dom1n1k, LanceVorgin, P47R!CK

----------
DetourFunc
----------
return: Pointer to a call back function, similar typedef to detoured
	function.

p1_src: The source pointer of the function you want to detour
	eg: (BYTE*)GetProcAddress(hModule, "SomeFunction")

p2_dst: The destination pointer of the function you want to detour to
	eg: (BYTE*)MySomeFunction

p3_len: Number of complete opcodes >= 5, eg, push 0xFFFFFFFF = 6bytes
	eg: 6

---------------
DetourClassFunc
---------------
Purpose:
	This function should only be used when a virtual function is to be
	detoured *AND* the calling convention is __thiscall, if it is specified
	to be __cdecl or __stdcall, then use DetourFunc.
	This function will edit the call so the ECX pointer is pushed onto the stack
	and thus preserving the THIS pointer from the detour.
	Basically, it converts the __thiscall calling convention to __stdcall.
	
	eg: 	class method definition = virtual void CMyClass::MyFunction(int x, int y);
		new prototype = void __stdcall MyFunction(CMyClass *This, int x, int y);


return: Pointer to a call back function, similar typedef to detoured
	function.

p1_src: The source pointer of the class function you want to detour
	eg: (BYTE*)vTable[10]

p2_src: The destination pointer of the function you want to detour to
	eg: (BYTE*)MySomeFunction

p3_len: Number of complete opcodes >= 8, eg, push 0xFFFFFFFF, push 0x1 = 8bytes
	eg: 8
