2nd Recv Hook Problem

01/02/2018 21:12 MenPirate#1
Hello Guys .

i m trying to hook the 2nd Recv function the hook is success and just recv 1 packet after that the game is crash Here the code

Source code
Code:
int MyRecvBack = 0x0052E860 + 4;

int Naked RecvDetour(char* Data, LPCSTR format,...)
{
	__asm
	{
		push    ebp
		mov     ebp, esp
		push    ecx
	}

	Color(15);
	printf(RecvText, 1, format);

	__asm

	{

		jmp MyRecvBack;

	}
}

Intercept( INST_JMP , 0x0052E860, ( DWORD) RecvDetour , 5);
Here is the function in ollydbg

[Only registered and activated users can see links. Click Here To Register...]
01/03/2018 03:54 A.k.A.#2
show the bytes after your hook and jmp is 5 bytes you jumping back +4 bytes
01/03/2018 11:59 MenPirate#3
i tried it and the game still crashing

near 128 view and no one can help ? wake up guys :)
01/03/2018 19:14 TheRealPower#4
Well idk if you are playing on int or a pserver, (got no idea about any pserver or how they check and prevent these stuffs), but as you posted this in august 2016 "https://www.elitepvpers.com/forum/kal-online/4102752-intercept-not-working-int-server.html" i assume you are talking about int, and luki respond with "Xtra detects changes in engine code section. But it will allow you to use send function as your own" = you can use kal their sendfunction as your own, but doing the intercept to check what you send will kick you out the game (xtrap), same with recv (not that u could use recv function as you would use send), so i doubt u'll get recv working with intercept....

Quote:
Originally Posted by nokia999 View Post
If u read at last few posts u will know that:
a) don't hook recv / send function in kal (or you must patch xtrap to work it)
b) hook recv / send in ws2_32 and place hook 5 bytes after func start to work ( xtrap check this functions prolog).
c) use other magic metods xD
d) 0xfffffffffffff topics about it here and on other forums.....
or use detours for recv, there are alot of topics where u could actually leech a function for it (maybe u need small edits)
01/03/2018 22:57 A.k.A.#5
Quote:
Originally Posted by MenPirate View Post
i tried it and the game still crashing

near 128 view and no one can help ? wake up guys :)
ofc game will still crash you overwritting 5 bytes but you restoring only 3 bytes on your hook function i asked you to post olly screen after your hook is set