did anyone make a loader for ArabicCo?

03/29/2012 17:53 Mr_PoP#1
am creating a loader and am hooking the connect method using Detours like so

Code:
int WINAPI DetouredConnect(SOCKET s, const sockaddr *sokaddr , int len)
{
	sockaddr_in *addr = (sockaddr_in*)sokaddr ;  
	addr->sin_addr.s_addr = inet_addr("5.230.189.19"); 
	addr->sin_port = 9966;
    return OriginalConnect(s, (const sockaddr*)addr, len);
}
but it's not working idk why!

while the singout hooking method works fine

Code:
HINSTANCE WINAPI DetouredShell(HWND hWnd, LPCSTR lpOperation, LPCSTR lpFile, LPCSTR lpParameters, LPCSTR lpDirectory, int nShowCmd)
{
    if(strcmp("http://qahr.91.com/signout/", lpFile) == 0)
    {
        lpFile = "http://www.google.com";
    }

    return OriginalShell(hWnd, lpOperation, lpFile, lpParameters, lpDirectory, nShowCmd);
}
did anyone face similar problem? or have a clue what is causing that?
03/29/2012 23:19 -impulse-#2
Well, first of all when you set the port in a sockaddr you have to use htons on the port first.
Secondly, you should redirect only the auth ports (9958 - 9960) not all ports.
03/29/2012 23:52 Mr_PoP#3
Quote:
Originally Posted by -impulse- View Post
Well, first of all when you set the port in a sockaddr you have to use htons on the port first.
Secondly, you should redirect only the auth ports (9958 - 9960) not all ports.
yeah it was the htons I totally forgot about it thanks.