Hooking s2s

Posts 1–11 of 11 · Page 1 of 1
Hooking s2s
So ive tried to do this in my hack(thanks CC) and although it says im detouring and removing detours fine, it never runs s2s code. Any ideas why? I can post source if you would like me to.
never runs any s2s code meaning what?

You can see it being logged but it doesnt get sent?

or

Nothing logs?

If you can see it logging, but doesnt get sent, you need to call the real s2s function after reading the ID's.
If you dont see logs, well its not hooked correctly.
Quote Originally Posted by ac1d_buRn View Post
never runs any s2s code meaning what?

You can see it being logged but it doesnt get sent?

or

Nothing logs?

If you can see it logging, but doesnt get sent, you need to call the real s2s function after reading the ID's.
If you dont see logs, well its not hooked correctly.
This is what im doing
Code:
void hook()
{
  add_log("Detouring"); //happens
  os2s= (ps2s)Detour(s2s_addy,s2s_thread);
  add_log("Detoured"); //happens
}
HRESULT and some other things i forget off the top of my head(params,and more params)
{
   add_log("s2s hooked"); //never happens
   return something;
}
Has anyone been able to hook s2s that is NA?
yup shit is so easy that it gets boring.
Quote Originally Posted by RagedYet View Post
yup shit is so easy that it gets boring.
Wow, that was a useless response... (yes, it is easy, but that is beside the point...)
@OP, yes, please post some code so we can better debug this.
Quote Originally Posted by Saltine View Post

Wow, that was a useless response... (yes, it is easy, but that is beside the point...)
@OP, yes, please post some code so we can better debug this.
Code:
	add_log("Start_s2s_hook");//happens
	while(true)
	{
		if(Ingame() && s2s_hooked == false )
		{
			add_log("51");//happens
			mfnSendToServer = (tfnSendToServer)DetourFunction((PBYTE)ADDR_S2SE, (PBYTE)&hooked_SendToServer);
			s2s_hooked = true;
			add_log("52");//happens
		}
		if(!Ingame() && s2s_hooked == true)
		{
			add_log("61"); //happens
			DetourRemove((PBYTE)ADDR_S2SE, (PBYTE)&hooked_SendToServer); 
			s2s_hooked = false;
			add_log("62");//happens
		}
		add_log("7");//happens

		Sleep(100);
	}
Code:
unsigned int __stdcall hooked_SendToServer(ILTMessage_Read *pMsg, unsigned __int32 flags)
{
	__asm pushad;
	int iRetn;
	add_log("a"); //Doesnt Happen
	int id = pMsg->Readuint8();
	add_log("e"); //Doesnt Happen
	__asm popad;
	return iRetn;
}
you forgot to return original function.
Proper way:

Code:
iRetn = mfnSendToServer(pMsg, flags);
BTW: Try another detours, length is 7 bytes.
Quote Originally Posted by Ch40zz-C0d3r View Post
you forgot to return original function.
Proper way:

Code:
iRetn = mfnSendToServer(pMsg, flags);
BTW: Try another detours, length is 7 bytes.
I have it doing something like that, and let me try the 7

-After trying the length 7-

freezes at login screen ?
You need another detours, MC detours handle this different.
Try a pub detours with length 7, and get the right updated address.
This should work.
Quote Originally Posted by Ch40zz-C0d3r View Post
You need another detours, MC detours handle this different.
Try a pub detours with length 7, and get the right updated address.
This should work.
I tried this, and it still doesnt work, im going to double check my addy really fast. I will look it up on my on so I know its not wrong.
Posts 1–11 of 11 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us