Retour Function

Posts 114 of 14 · Page 1 of 1
Retour Function
I've been working on learning about Detours and such lately cuz i wanna learn more about hacking and D3D and i came across something called "retour functions"

i didn't read it all yet, but i'll post what i learned from it. This may be useless for now on CA, but maybe in the future it will be useful


Main.h
Code:
bool RetourFunc(BYTE *src, BYTE *restore, const int len);

Main.cpp
Code:
bool RetourFunc(BYTE *src, BYTE *restore, const int len)
{
	DWORD dwback;
		
	if(!VirtualProtect(src, len, PAGE_READWRITE, &dwback))	{ return false; }
	if(!memcpy(src, restore, len))							{ return false; }

	restore[0] = 0xE9;
	*(DWORD*)(restore+1) = (DWORD)(src - restore) - 5;

	if(!VirtualProtect(src, len, dwback, &dwback))			{ return false; }
	
	return true;
}
Hey dumbfuck, that's just a jmp hook with a different name.
Quote Originally Posted by Jason View Post
Hey dumbfuck, that's just a jmp hook with a different name.
I love your in your face attitude.
Quote Originally Posted by Jason View Post
Hey dumbfuck, that's just a jmp hook with a different name.
why are you so pissed all the time. he said he was learning at least he isn't begging. so bro for real chill out.
Quote Originally Posted by speedforyou View Post


why are you so pissed all the time. he said he was learning at least he isn't begging. so bro for real chill out.
'Cos Ari Gold is my idol. 'Nuff said.
Quote Originally Posted by Jason View Post
Hey dumbfuck, that's just a jmp hook with a different name.
at least i'm sharing you shit face cock master

/south park for the win LOL
Nice man !
Good Job Bro ! ;D
how does this even relate to combat arms?
and why did did you rename it to retour it doesn't make sense
If you want the detour to be removed, Just copy the bytes before you add the detour, then Memcpy it back
Quote Originally Posted by supercarz1991 View Post
he's talking about your dumbass comment, at least i share. i know a lot of people here who just take n take n take and never give credits, then they find something new, and never share.


i share and take, so stfu
I share also. Better still; my sharing isn't a repost of existing code with a new name :3
Ladies please, calm down.
Posts 114 of 14 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?