[C#] iSro Loader help

07/26/2016 01:17 tarek1500#16
I'm trying to execute my connect function and I successfully receive the IP & Port from the game , and then try to call the real connect function to connect to my proxy. So should I provide something else?
07/26/2016 10:16 pergian#17
like the code you are trying to execute.
07/26/2016 15:26 tarek1500#18
Here is my connect function.
Code:
[DllExport("Detour_Connect", CallingConvention = CallingConvention.Cdecl)]
public static int Detour_Connect(IntPtr s, ref Functions.sockaddr name, int namelen)
{
	if (namelen == 16)
	{
		if (name.sa_data[2] == 121 && name.sa_data[3] == 128 && name.sa_data[4] == 133 && (name.sa_data[5] == 53 || name.sa_data[5] == 54 || name.sa_data[5] == 55 || name.sa_data[5] == 56))
		{
			if (name.sa_data[0] * 256 + name.sa_data[1] == 15779)
			{
				name.sa_data[0] = (15778) / 256;
				name.sa_data[1] = (15778) % 256;
				name.sa_data[2] = 127;
				name.sa_data[3] = 0;
				name.sa_data[4] = 0;
				name.sa_data[5] = 1;
			}
		}
	}

	int ReturnValue = Functions.connect(s, ref name, namelen);

	return ReturnValue;
}
and this is Function.connect
Code:
[DllImport("ws2_32")]
public static extern int connect(IntPtr s, ref sockaddr name, int namelen);