[Discussion]The Client ip

Results 1 to 14 of 14
  1. #1
    Member ARTYOMT is offline
    MemberRank
    Mar 2009 Join Date
    RussiaLocation
    57Posts

    [Discussion]The Client ip

    I am not a pro of coding for now but I know the game very much and I am good at setting up servers so I have some experience and I think the client ip is maybe:
    1) The launcher or the exe file
    2) The patch files
    3) The agt extension files
    4) The dlls

    Maybe I am wrong but I think it can be in the launcher or the patch files.
    Last edited by ARTYOMT; 12-10-10 at 05:48 PM.


  2. #2
    The Sky's the Limit ^_^ GzFKoron is offline
    MemberRank
    Jul 2010 Join Date
    1,118Posts

    Re: The Client ip

    Alright thanks, I have installed the client now but its all in korean, so.. yea. lol

    I don't really know how I would edit the AGT files, tbh we need a runnable that can be ran without using the launcher, because even if we do find the IP, we need to know the files of the update server, so it would actually work.

  3. #3
    Member ARTYOMT is offline
    MemberRank
    Mar 2009 Join Date
    RussiaLocation
    57Posts

    Re: The Client ip

    Maybe yes but updating is needed too. But we need to unrar the agt files to make updates and to find the ip and other things.

  4. #4
    The Sky's the Limit ^_^ GzFKoron is offline
    MemberRank
    Jul 2010 Join Date
    1,118Posts

    Re: The Client ip

    Quote Originally Posted by ARTYOMT View Post
    Maybe yes but updating is needed too. But we need to unrar the agt files to make updates and to find the ip and other things.
    I was hoping for now there was some type of skip update.

  5. #5
    ...[ White Rabbit ]... MentaL is offline
      Administrator  Rank
    Jan 2001 Join Date
    31,636Posts

    Re: The Client ip

    if the IP is hardcoded or what not.. thats easy to get around!!! Use edit the windows host list.

    C:\Windows\System32\drivers\etc\hosts

  6. #6
    Member ARTYOMT is offline
    MemberRank
    Mar 2009 Join Date
    RussiaLocation
    57Posts

    Re: The Client ip

    I will try then. Thx

  7. #7
    Account Upgraded | Title Enabled! CheckPoint is offline
    MemberRank
    Sep 2009 Join Date
    507Posts

    Re: The Client ip

    1.The IP appears to be hardcoded on DriftCity.exe
    2.Editing /etc/hosts isn't gonna work unfortunately
    3.Try setting up a loopback.
    4.If you don't want to do that,use the DriftHook I posted
    Code:
    #define _WIN32_WINNT 0x0501
    #include <winsock2.h>
    #include <windows.h>
    #include <intrin.h>
    #include <Detours.h>
    #include <stdio.h>
    #include <io.h>
    #include <fcntl.h>
    #pragma comment(lib, "ws2_32.lib")
    #pragma comment(lib, "psapi.lib")
    
    typedef int (WINAPI* Prototype_Connect)(SOCKET, const struct sockaddr*, int);
    Prototype_Connect Original_Connect;
    
    
    typedef int (WINAPI *MessageBoxt) (int, char *, char *, int);
    MessageBoxt MessageBoxOrg;
    int WINAPI MessageBoxHook (int a, char *b, char *c, int d)
    {
    	  	return MessageBoxOrg(a,b,c,d);
    }
    
    int WINAPI Hooked_Connect(SOCKET s, const struct sockaddr* name, int namelen)
    {
        sockaddr_in* service = (sockaddr_in*)name;
            unsigned long address = inet_addr("127.0.0.1");
            memcpy(&service->sin_addr, &address, sizeof(unsigned long));
        return Original_Connect(s, name, namelen);
    }
    
    void HidePEB(HINSTANCE hModule) {
    
    DWORD dwPEB_LDR_DATA = 0;
    	_asm{
    		pushad;
    		pushfd;
    		mov eax, fs:[30h]
    			mov eax, [eax+0Ch]
    			mov dwPEB_LDR_DATA, eax
    
    InLoadOrderModuleList:
    		mov esi, [eax+0Ch]
    			mov edx, [eax+10h]
    
    LoopInLoadOrderModuleList: 
    		lodsd
    			mov esi, eax
    			mov ecx, [eax+18h]
    			cmp ecx, hModule
    			jne SkipA
    			mov ebx, [eax]
    			mov ecx, [eax+4]
    			mov [ecx], ebx
    			mov [ebx+4], ecx
    			jmp InMemoryOrderModuleList
    
    SkipA:
    		cmp edx, esi
    			jne LoopInLoadOrderModuleList
    
    InMemoryOrderModuleList:
    		mov eax, dwPEB_LDR_DATA
    			mov esi, [eax+14h]
    			mov edx, [eax+18h]
    
    LoopInMemoryOrderModuleList: 
    		lodsd
    			mov esi, eax
    			mov ecx, [eax+10h]
    			cmp ecx, hModule
    			jne SkipB
    			mov ebx, [eax] 
    			mov ecx, [eax+4]
    			mov [ecx], ebx
    			mov [ebx+4], ecx
    			jmp InInitializationOrderModuleList
    
    SkipB:
    		cmp edx, esi
    			jne LoopInMemoryOrderModuleList
    
    InInitializationOrderModuleList:
    		mov eax, dwPEB_LDR_DATA
    			mov esi, [eax+1Ch]
    			mov edx, [eax+20h]
    
    LoopInInitializationOrderModuleList: 
    		lodsd
    			mov esi, eax
    			mov ecx, [eax+08h]
    			cmp ecx, hModule
    			jne SkipC
    			mov ebx, [eax] 
    			mov ecx, [eax+4]
    			mov [ecx], ebx
    			mov [ebx+4], ecx
    			jmp Finished
    
    SkipC:
    		cmp edx, esi
    			jne LoopInInitializationOrderModuleList
    
    Finished:
    		popfd;
    		popad;
    	}
    }
    
    
    
    DWORD WINAPI DriftHook(LPVOID lpReserved)
    {
        AllocConsole();
    
        HANDLE handle_out = GetStdHandle(STD_OUTPUT_HANDLE);
        int hCrt = _open_osfhandle((long) handle_out, _O_TEXT);
        FILE* hf_out = _fdopen(hCrt, "w");
        setvbuf(hf_out, NULL, _IONBF, 1);
        *stdout = *hf_out;
    
        HANDLE handle_in = GetStdHandle(STD_INPUT_HANDLE);
        hCrt = _open_osfhandle((long) handle_in, _O_TEXT);
        FILE* hf_in = _fdopen(hCrt, "r");
        setvbuf(hf_in, NULL, _IONBF, 128);
        *stdin = *hf_in;
    	system("title DriftHook");
    	printf("DriftHook(C) Cosmos 2010\n");
        printf("Debug mode started!\n");
    	Sleep(500);
    	printf("Hooks set!\n");
    	MessageBoxOrg = (MessageBoxt)DetourFunction ((PBYTE)GetProcAddress (GetModuleHandleA ("user32.dll"), "MessageBoxA"), (PBYTE)MessageBoxHook);
    	Sleep(500);
    	printf("Redirecting connections to localhost...\n");
    	Original_Connect = (Prototype_Connect)DetourFunction((PBYTE)GetProcAddress(GetModuleHandle("ws2_32.dll"), "connect"), (PBYTE)Hooked_Connect);
    	Sleep(500);
    	printf("Done!\n");
    	return true;
    }
    
    
    
    BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
    {
        UNREFERENCED_PARAMETER(lpReserved);
        if(ul_reason_for_call == DLL_PROCESS_ATTACH)
        {
    		HidePEB(hModule);
            DisableThreadLibraryCalls(hModule);
    		CreateThread (NULL, NULL, DriftHook, NULL, NULL, NULL);
        }
        return true;
    }

  8. #8
    Member ARTYOMT is offline
    MemberRank
    Mar 2009 Join Date
    RussiaLocation
    57Posts

    Re: The Client ip

    WoW Well done I will try this later
    Last edited by ARTYOMT; 11-10-10 at 03:17 PM.

  9. #9
    The Sky's the Limit ^_^ GzFKoron is offline
    MemberRank
    Jul 2010 Join Date
    1,118Posts

    Re: The Client ip

    Quote Originally Posted by dio98 View Post
    1.The IP appears to be hardcoded on DriftCity.exe
    2.Editing /etc/hosts isn't gonna work unfortunately
    3.Try setting up a loopback.
    4.If you don't want to do that,use the DriftHook I posted
    Code:
    #define _WIN32_WINNT 0x0501
    #include <winsock2.h>
    #include <windows.h>
    #include <intrin.h>
    #include <Detours.h>
    #include <stdio.h>
    #include <io.h>
    #include <fcntl.h>
    #pragma comment(lib, "ws2_32.lib")
    #pragma comment(lib, "psapi.lib")
    
    typedef int (WINAPI* Prototype_Connect)(SOCKET, const struct sockaddr*, int);
    Prototype_Connect Original_Connect;
    
    
    typedef int (WINAPI *MessageBoxt) (int, char *, char *, int);
    MessageBoxt MessageBoxOrg;
    int WINAPI MessageBoxHook (int a, char *b, char *c, int d)
    {
    	  	return MessageBoxOrg(a,b,c,d);
    }
    
    int WINAPI Hooked_Connect(SOCKET s, const struct sockaddr* name, int namelen)
    {
        sockaddr_in* service = (sockaddr_in*)name;
            unsigned long address = inet_addr("127.0.0.1");
            memcpy(&service->sin_addr, &address, sizeof(unsigned long));
        return Original_Connect(s, name, namelen);
    }
    
    void HidePEB(HINSTANCE hModule) {
    
    DWORD dwPEB_LDR_DATA = 0;
    	_asm{
    		pushad;
    		pushfd;
    		mov eax, fs:[30h]
    			mov eax, [eax+0Ch]
    			mov dwPEB_LDR_DATA, eax
    
    InLoadOrderModuleList:
    		mov esi, [eax+0Ch]
    			mov edx, [eax+10h]
    
    LoopInLoadOrderModuleList: 
    		lodsd
    			mov esi, eax
    			mov ecx, [eax+18h]
    			cmp ecx, hModule
    			jne SkipA
    			mov ebx, [eax]
    			mov ecx, [eax+4]
    			mov [ecx], ebx
    			mov [ebx+4], ecx
    			jmp InMemoryOrderModuleList
    
    SkipA:
    		cmp edx, esi
    			jne LoopInLoadOrderModuleList
    
    InMemoryOrderModuleList:
    		mov eax, dwPEB_LDR_DATA
    			mov esi, [eax+14h]
    			mov edx, [eax+18h]
    
    LoopInMemoryOrderModuleList: 
    		lodsd
    			mov esi, eax
    			mov ecx, [eax+10h]
    			cmp ecx, hModule
    			jne SkipB
    			mov ebx, [eax] 
    			mov ecx, [eax+4]
    			mov [ecx], ebx
    			mov [ebx+4], ecx
    			jmp InInitializationOrderModuleList
    
    SkipB:
    		cmp edx, esi
    			jne LoopInMemoryOrderModuleList
    
    InInitializationOrderModuleList:
    		mov eax, dwPEB_LDR_DATA
    			mov esi, [eax+1Ch]
    			mov edx, [eax+20h]
    
    LoopInInitializationOrderModuleList: 
    		lodsd
    			mov esi, eax
    			mov ecx, [eax+08h]
    			cmp ecx, hModule
    			jne SkipC
    			mov ebx, [eax] 
    			mov ecx, [eax+4]
    			mov [ecx], ebx
    			mov [ebx+4], ecx
    			jmp Finished
    
    SkipC:
    		cmp edx, esi
    			jne LoopInInitializationOrderModuleList
    
    Finished:
    		popfd;
    		popad;
    	}
    }
    
    
    
    DWORD WINAPI DriftHook(LPVOID lpReserved)
    {
        AllocConsole();
    
        HANDLE handle_out = GetStdHandle(STD_OUTPUT_HANDLE);
        int hCrt = _open_osfhandle((long) handle_out, _O_TEXT);
        FILE* hf_out = _fdopen(hCrt, "w");
        setvbuf(hf_out, NULL, _IONBF, 1);
        *stdout = *hf_out;
    
        HANDLE handle_in = GetStdHandle(STD_INPUT_HANDLE);
        hCrt = _open_osfhandle((long) handle_in, _O_TEXT);
        FILE* hf_in = _fdopen(hCrt, "r");
        setvbuf(hf_in, NULL, _IONBF, 128);
        *stdin = *hf_in;
    	system("title DriftHook");
    	printf("DriftHook(C) Cosmos 2010\n");
        printf("Debug mode started!\n");
    	Sleep(500);
    	printf("Hooks set!\n");
    	MessageBoxOrg = (MessageBoxt)DetourFunction ((PBYTE)GetProcAddress (GetModuleHandleA ("user32.dll"), "MessageBoxA"), (PBYTE)MessageBoxHook);
    	Sleep(500);
    	printf("Redirecting connections to localhost...\n");
    	Original_Connect = (Prototype_Connect)DetourFunction((PBYTE)GetProcAddress(GetModuleHandle("ws2_32.dll"), "connect"), (PBYTE)Hooked_Connect);
    	Sleep(500);
    	printf("Done!\n");
    	return true;
    }
    
    
    
    BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
    {
        UNREFERENCED_PARAMETER(lpReserved);
        if(ul_reason_for_call == DLL_PROCESS_ATTACH)
        {
    		HidePEB(hModule);
            DisableThreadLibraryCalls(hModule);
    		CreateThread (NULL, NULL, DriftHook, NULL, NULL, NULL);
        }
        return true;
    }
    Thanks, now I need to learn coding.

  10. #10
    Member ARTYOMT is offline
    MemberRank
    Mar 2009 Join Date
    RussiaLocation
    57Posts

    Re: The Client ip

    No need just edit ur ip in the code (127.0.0.1) and make it work.

  11. #11
    ...[ White Rabbit ]... MentaL is offline
      Administrator  Rank
    Jan 2001 Join Date
    31,636Posts

    Re: The Client ip

    so if this hardcoded ip you cannot find, why not open up command prompt and run nbtstat -a and check all the outbound connections and find the ip that way.

  12. #12
    Account Upgraded | Title Enabled! CheckPoint is offline
    MemberRank
    Sep 2009 Join Date
    507Posts

    Re: The Client ip

    Quote Originally Posted by MentaL View Post
    so if this hardcoded ip you cannot find, why not open up command prompt and run nbtstat -a and check all the outbound connections and find the ip that way.
    Tbh,that's not the main issue at the moment.The server files have no database connection,there is no default connection,and the packets appear to be changed since the last update.It would be better to work on an emulator imho.

  13. #13
    Member Delteros is offline
    MemberRank
    Mar 2009 Join Date
    302Posts

    Re: The Client ip

    Quote Originally Posted by dio98 View Post
    Tbh,that's not the main issue at the moment.The server files have no database connection,there is no default connection,and the packets appear to be changed since the last update.It would be better to work on an emulator imho.
    If you have the time and skills to make an emulator, then you can make one if you want to.

  14. #14
    ...[ White Rabbit ]... MentaL is offline
      Administrator  Rank
    Jan 2001 Join Date
    31,636Posts

    Re: The Client ip

    so then your main issue is finding an old compatible client then?



Advertisement