Best way to connect with server on dynamic IP. I have hostname. Hosts?

Results 1 to 9 of 9
  1. #1
    Novice morozaw is offline
    MemberRank
    Sep 2013 Join Date
    3Posts

    Best way to connect with server on dynamic IP. I have hostname. Hosts?

    Hello guys, i'm looking for from about 3 hours a solution for this problem.
    How i can connect to my server on dynamic ip with or without editing l2.ini?
    Editing and patching system is the only best way or did You have better solution of this problem?
    Client H5 - server l2j newest. I've find two scripts / program to automatic editing hosts file but of course links are dead.

    My server dns:
    morozaw.dyndns.org

    Cheers!


  2. #2
    ~ksemer~ DaRkAnGeL is offline
    MemberRank
    Oct 2006 Join Date
    Java_HomeLocation
    5,115Posts

    Re: Best way to connect with server on dynamic IP. I have hostname. Hosts?

    The best way is adding your server dns in l2.ini file

  3. #3
    Novice morozaw is offline
    MemberRank
    Sep 2013 Join Date
    3Posts

    Re: Best way to connect with server on dynamic IP. I have hostname. Hosts?

    How to make it in good way?
    When I decode l2.ini and encrypt it i have wrong characters at the end.
    I would like to do it with the best method.
    Is there any other better or good method to connect with server without system patch?

  4. #4
    ~ksemer~ DaRkAnGeL is offline
    MemberRank
    Oct 2006 Join Date
    Java_HomeLocation
    5,115Posts

    Re: Best way to connect with server on dynamic IP. I have hostname. Hosts?

    download a system from another server and just edit the l2.ini

  5. #5
    Guss decarvk is offline
    MemberRank
    Jul 2008 Join Date
    /home/bed/Location
    381Posts

    Re: Best way to connect with server on dynamic IP. I have hostname. Hosts?

    Quote Originally Posted by DaRkAnGeL View Post
    download a system from another server and just edit the l2.ini
    very bad solution...

    take a clean system and patch it. (there is many way less or more efficient)
    after that you can edit all your file. (and your .dat file will be clean in this way)

    my Client admin use l2Datencdec to patch our system folder (you can found it with some search on google, and it easy to use).

  6. #6
    ~ksemer~ DaRkAnGeL is offline
    MemberRank
    Oct 2006 Join Date
    Java_HomeLocation
    5,115Posts

    Re: Best way to connect with server on dynamic IP. I have hostname. Hosts?

    Quote Originally Posted by decarvk View Post
    very bad solution...

    take a clean system and patch it. (there is many way less or more efficient)
    after that you can edit all your file. (and your .dat file will be clean in this way)

    my Client admin use l2Datencdec to patch our system folder (you can found it with some search on google, and it easy to use).
    Do not suggest ways when you cannot provide the links. It was easier for me to suggest him patching the system folder, but as I have not the patcher fo Hi5 I cannot suggest that.

    Also l2Datencdec latest version is for Gracia Epilogue not Hi5.

    PS: try this one:
    http://www.4shared.com/rar/5Er8ckbx/...hed_System.htm
    Last edited by DaRkAnGeL; 17-09-13 at 02:59 PM.

  7. #7
    Guss decarvk is offline
    MemberRank
    Jul 2008 Join Date
    /home/bed/Location
    381Posts

    Re: Best way to connect with server on dynamic IP. I have hostname. Hosts?


  8. #8
    Novice morozaw is offline
    MemberRank
    Sep 2013 Join Date
    3Posts

    Re: Best way to connect with server on dynamic IP. I have hostname. Hosts?

    Many many thanks for reply, BiggBoss from official l2j board send me a code:
    Code:
    
    
    1. #include <windows.h>
    2. #include <winsock2.h>
    3. #include <stdlib.h>
    4. #pragma comment(lib,"ws2_32.lib");
    5. typedef int (__stdcall* new_connect)(SOCKET socket, sockaddr *name, int namelen);
    6. new_connect hook;
    7. int __stdcall InjectedConnect(SOCKET socket, sockaddr *name, int namelen) {
    8. sockaddr_in * name_in = (sockaddr_in*)name;
    9. name_in->sin_addr->S_un.S_addr = inet_addr("your.hostname.goes.here");
    10. return hook(socket,name,namelen);
    11. }
    12. void inject() {
    13. char * alloc_mem = (char*)VirtualAlloc(NULL, 0x1000, MEM_COMMIT, PAGE_EXECUTE_READWRITE);
    14. HMODULE ws2_32 = GetModuleHandle(L"ws2_32.dll");
    15. if(ws2_32 == 0) {
    16. ws2_32 = LoadLibrary(L"ws2_32.dll");
    17. }
    18. char * old_connect_addr = (char*)GetProcAddress(ws2_32, "connect");
    19. if(*old_connect_addr == 0xe9) {
    20. int old_relative = *(int*)(old_connect_addr + 1);
    21. DWORD32 absolute = (DWORD32)(old_connect_addr + old_relative + 5);
    22. *alloc_mem = 0xe9;
    23. *(int*)(alloc_mem + 1) = (int)(absolute - (alloc_mem + 5));
    24. } else {
    25. memcpy(alloc_mem,old_connect_addr,5);
    26. *(alloc_mem + 5)= 0xe9;
    27. *(int*)(alloc_mem + 6) = (int)(old_connect_addr + 5 - (alloc_mem + 10));
    28. }
    29. DWORD prot;
    30. VirtualProtect(old_connect_addr,5,PAGE_EXECUTE_READWRITE, &prot);
    31. *old_connect_addr = 0xe9;
    32. *(int*)(old_connect_addr + 1) = (int)( &InjectedConnect - (old_connect_addr + 5));
    33. VirtualProtect(old_connect_addr,5,prot,&prot);
    34. hook = (new_connect)alloc_mem;
    35. }
    36. _declspec(dllexport) BOOL APIENTRY DllMain( HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) {
    37. if(ul_reason_for_call == DLL_PROCESS_ATTACH || ul_reason_for_call == DLL_THREAD_ATTACH)
    38. inject();
    39. return TRUE;
    40. }
    Maybe this is better solution for this?
    He recomend me to compile it to dll and add into l2.exe header.
    Maybe anyone could write how to do it? What do You think about it?

  9. #9
    Guss decarvk is offline
    MemberRank
    Jul 2008 Join Date
    /home/bed/Location
    381Posts

    Re: Best way to connect with server on dynamic IP. I have hostname. Hosts?

    if you don't know how to make a dll click on my link get th svn address get full projetcts file and compile l2dat_encdec (open with visual studio 2010 -> generate solution) -> after that open l2dat_encdec give him path to your system directory, and use patcher forum tools menu to patch your client after that have fun.

    after made a dll injection, for change connect ip ..., more esay, and more clean to set your host in the l2.ini file I think, if I remember .ini are config file, so this his the cleaner solution).



Advertisement