Jump to content
Moopler
Nanoteck

Tutorial How to setup the new XignCode bypass (Noob friendly video guide) Updated: No more Detour

Recommended Posts

Hey!

Since so manny people seam to have problems building the new bypass I have made a pretty noob friendly video guide.
I will continiously update this to make it easier to follow and troubleshoot.

I just wanna say thanks to everyone who helped me figure all of this out in the other tutorial thread.
Special thanks to Sprux, Hippo, xScritZx, Razz and DAVHEED

Before you ask questions in this thread make sure they have not yet been awnserd in Hippos tutorial thread. links to his thread at the bottom of this post.

What do I need?

  • This guide requires you to have visual studio installed.
    Visual studio 2013 be downloded from here:
    https://go.microsoft.com/fwlink/?LinkId=532495&clcid=0x409
     
  • you will also need to have a MSCRC bypass installed on the computer you will use to hack.
    Downloads and instructions can be foud at the bottom of this post.
     
  • 2 computers. or a virtual machine.

 

 

Video Guide (Updated: No need for Detour!)

 

In order to remove detour Delete this code from XignCode Client>Source>main.cpp. Delete the code that is marked in red below.

Spoiler

#pragma once

#include <Windows.h>
#include <stdio.h>

#include <detours.h>
#pragma comment(lib, "detours")

namespace detours
{
    bool redirect(bool enable, void** function, void* redirection)
    {
        if (DetourTransactionBegin() != NO_ERROR)
        {
            return false;
        }

        if (DetourUpdateThread(GetCurrentThread()) != NO_ERROR)
        {
            return false;
        }

        if ((enable ? DetourAttach : DetourDetach)(function, redirection) != NO_ERROR)
        {
            return false;
        }

        if (DetourTransactionCommit() == NO_ERROR)
        {
            return true;
        }

        DetourTransactionAbort();
        return false;
    }
}

BOOL APIENTRY DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
    if (fdwReason == DLL_PROCESS_ATTACH)
    {    
        AllocConsole();
        SetConsoleTitle(L"XignCode Client");
        AttachConsole(GetCurrentProcessId());
    
        FILE* pFile = nullptr;
        freopen_s(&pFile, "CON", "r", stdin);
        freopen_s(&pFile, "CON", "w", stdout);
        freopen_s(&pFile, "CON", "w", stderr);
        
        DisableThreadLibraryCalls(hinstDLL);
    }
    else if (fdwReason == DLL_PROCESS_DETACH)
    {
        FreeConsole();
    }

    return TRUE;
}


The line that you should add at line 3 in XignCode CLient>Network>Client.cpp is marked in red below.

Spoiler

#ifndef _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_WARNINGS
#define _WINSOCK_DEPRECATED_NO_WARNINGS
#endif

#include "client.hpp"

#include <WS2tcpip.h>
#pragma comment(lib, "ws2_32")

#include <string>

namespace network
{
    client::client(unsigned short port) 
        : sock(INVALID_SOCKET), port(port)
    {

    }

    client::~client()
    {
        if (this->sock != INVALID_SOCKET)
        {
            this->uninitialize();
        }
    }

    bool client::make_interaction(interaction_handler finalize_handler)
    {
        if (!this->initialize())
        {
            this->output_wsa_error(error_type::connect);
            return false;
        }
        
        bool result = finalize_handler(this);

        this->uninitialize();
        return result;
    }
    
    int client::read(unsigned char* buffer, std::size_t assumed_size)
    {
        unsigned short data_length = 0;
        int data_length_size = this->raw_read(reinterpret_cast<unsigned char*>(&data_length), sizeof(unsigned short));

        if (!data_length_size || data_length_size != sizeof(unsigned short))
        {
            return 0;    
        }
        
        if (assumed_size && data_length != assumed_size)
        {
            return 0;
        }
        
        unsigned char data_buffer[16384];
        
        for (int data_read = 0, offset = 0, data_to_read = data_length; data_to_read > 0; data_to_read -= data_read, offset += data_read)
        {
            data_read = this->raw_read(data_buffer + offset, data_to_read);

            if (!data_read || data_read == SOCKET_ERROR)
            {
                return 0;
            }
        }

        memcpy(buffer, data_buffer, data_length);
        return data_length;
    }
    
    bool client::write(unsigned char const* buffer, std::size_t size)
    {
        unsigned short data_length = static_cast<unsigned short>(size);

        if (!this->raw_write(reinterpret_cast<unsigned char*>(&data_length), sizeof(unsigned short)))
        {
            return false;
        }

        unsigned char* data_buffer = new unsigned char;
        memcpy(data_buffer, buffer, size);

        if (!this->raw_write(data_buffer, size))
        {
            delete[] data_buffer;
            return false;
        }

        delete[] data_buffer;
        return true;
    }

    bool client::initialize()
    {
        if (WSAStartup(MAKEWORD(2, 0), new WSADATA))
        {
            return false;
        }

        this->sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);

        if (this->sock == INVALID_SOCKET)
        {
            return false;
        }

        sockaddr_in addr;
        addr.sin_family = AF_INET;
        addr.sin_port = htons(this->port);
        addr.sin_addr.s_addr = inet_addr("192.168.1.44"); // inet_addr("127.0.0.1");
        std::fill(addr.sin_zero, addr.sin_zero + sizeof(addr.sin_zero), 0);

        return (connect(this->sock, reinterpret_cast<sockaddr*>(&addr), sizeof(sockaddr_in)) != SOCKET_ERROR);
    }

    bool client::uninitialize()
    {
        return (shutdown(this->sock, SD_BOTH) != SOCKET_ERROR && closesocket(this->sock) != SOCKET_ERROR && WSACleanup() == 0);
    }

    int client::raw_read(unsigned char* buffer, std::size_t size)
    {
        int bytes_read = recv(this->sock, reinterpret_cast<char*>(buffer), size, 0);
        
        if (bytes_read == 0 || bytes_read == SOCKET_ERROR)
        {
            if (bytes_read == SOCKET_ERROR)
            {
                this->output_wsa_error(error_type::read);
            }

            return bytes_read;
        }
        else if (bytes_read < static_cast<int>(size))
        {
            int remaining_bytes_read = recv(this->sock, reinterpret_cast<char*>(buffer + bytes_read), size - bytes_read, 0);
        
            if (remaining_bytes_read == 0 || remaining_bytes_read == SOCKET_ERROR)
            {
                if (remaining_bytes_read == SOCKET_ERROR)
                {
                    this->output_wsa_error(error_type::read, false);
                }

                return remaining_bytes_read;
            }

            bytes_read += remaining_bytes_read;
        }

        return bytes_read;
    }

    bool client::raw_write(unsigned char const* buffer, std::size_t size)
    {
        for (int data_sent = 0, offset = 0, data_to_send = size; data_to_send > 0; data_to_send -= data_sent, offset += data_sent)
        {
            data_sent = send(this->sock, reinterpret_cast<const char*>(buffer) + offset, data_to_send, 0);
    
            if (data_sent == 0 || data_sent == SOCKET_ERROR)
            {
                if (data_sent == SOCKET_ERROR)
                {
                    this->output_wsa_error(error_type::write);
                }

                return false;
            }
        }

        return true;
    }
    
    void client::output_wsa_error(error_type type, bool first)
    {
        int error_code = WSAGetLastError();

        char error_message[1024];
        memset(error_message, 0, sizeof(error_message));

        strcpy(error_message, "Failed to ");
        
        switch (type)
        {
        case error_type::connect:
            strcat(error_message, "connect to ");
            break;

        case error_type::read:
            strcat(error_message, (first ? "receive (0) data from " : "receive (1) data from "));
            break;

        case error_type::write:
            strcat(error_message, "send data to ");
            break;
        }

        strcat(error_message, "the server.\nReason: ");

        switch (error_code)
        {
        case WSAECONNRESET:
            strcat(error_message, "You've been disconnected; the server terminated the connection.");
            break;

        case WSAETIMEDOUT:
            strcat(error_message, "You've timed out; it took you more than 10 seconds to communicate with the server.");
            break;

        default:
            strcat(error_message, "Unknown. Error code: ");
            strcat(error_message, std::to_string(error_code).c_str());
            strcat(error_message, ".");
            break;
        }
        
        printf("Client networking error: %s\n", error_message);
    }
}

 

 

Troubleshooting

  • XignCode Host.exe closes as soon as i start it.
    this is because your filepath is incorrect. Dubblechect the path and copy past it to eliminate spelling errors.
    Make sure that the path has dubble \\ insted of singel \ by each folder.
    make sure that the folder name in XignCode Host>XignCode>XignCode.cpp matches your own. I needed to change it from XingCode3 to XingCode.
     
The game sends heartbeat but the host does not reply.
Check your firewall. You will need to let thrugh trafic on port 38666. To test this out ty to disabel your entire firewall on both your main computer and server computer.
  When building the solution i get errors
if the error is simular to this:
error MSB3073: The command "copy /Y "C:\XignCode3 Bypass\Release\XignCode Client.dll" "G:\Games\MapleStory (Europe)\XignCode\x3.xem"
then the dll is still created and will work.

if the error is simular to this:
error C4996: 'inet_addr': Use inet_pton() or InetPton() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
then add: #define _WINSOCK_DEPRECATED_NO_WARNINGS to the top of Xingcode Client>Network>clinent.cpp document, so it will be like this:
#ifndef _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_WARNINGS
#define _WINSOCK_DEPRECATED_NO_WARNINGS
#endif
 

 

 

Changes

  • Removed the need for Detour, credits to Sprux for showing me this.
Remade the Video so its now alot easier to follow. Added spoilers with easy to follow instructions, as a compliment to the video. Edited by Nanoteck
  • Like 16

Share this post


Link to post

vcvarsall.bat, there 's not this in this folder,and when i try C:\Program Files (x86)\Microsoft Research\Detours Express 3.0 , and then nmake , it didn't find this command .

Edited by Progity

Share this post


Link to post
Guest

The bypass doesn't actually need detours - I have no clue why I even put it in there in the first place (probably some debugging I did). You can remove the include, library-loading and the 'detours' namespace from main.cpp in XignCode Client and you won't need detours anymore.

Share this post


Link to post

i don't understand about this kind of thing .. sry u.u ,someone can help me?

Edited by Progity

Share this post


Link to post

Hey, when I  try to build solution the .dll doesnt get created (also if I rebuild) and I get this error: Cannot open include file: 'XignDefs.hpp': No such file or directory

 

What can I do to fix this?

 

Btw: thanks for posting this all of you :D

Share this post


Link to post
4 hours ago, Progity said:

vcvarsall.bat, there 's not this in this folder,and when i try C:\Program Files (x86)\Microsoft Research\Detours Express 3.0 , and then nmake , it didn't find this command .

As Sprux explained in the next post, you dont need Detour (I thought you did). the workaround is to remove this part bellow in the spoiler from XignCode Client > Source > main.cpp. Then just skip the Detour step in my video tutorial. I will re-record it tomorrow with the new fix. You should thank Sprux for this.

Spoiler

#include <detours.h>
#pragma comment(lib, "detours")

namespace detours
{
    bool redirect(bool enable, void** function, void* redirection)
    {
        if (DetourTransactionBegin() != NO_ERROR)
        {
            return false;
        }

        if (DetourUpdateThread(GetCurrentThread()) != NO_ERROR)
        {
            return false;
        }

        if ((enable ? DetourAttach : DetourDetach)(function, redirection) != NO_ERROR)
        {
            return false;
        }

        if (DetourTransactionCommit() == NO_ERROR)
        {
            return true;
        }

        DetourTransactionAbort();
        return false;
    }
}

4 hours ago, Progity said:

when i try to build it , just keep appearing this error http://prntscr.com/9qkqim no matter what i do .

you have probobly erased to much code or added code in some random code somwere. What I would do is to open up your bypass folder and replace your XignCode3 Bypass\XignCode Host\XignCode.cpp with a clean one from the bypass zip file. then just redo the step where you name your XignCode path.

2 hours ago, oulieman said:

Hey, when I  try to build solution the .dll doesnt get created (also if I rebuild) and I get this error: Cannot open include file: 'XignDefs.hpp': No such file or directory

 

What can I do to fix this?

 

Btw: thanks for posting this all of you :D

have you checked that the file is present in your bypass folder(XignCode3 Bypass\XignCode Host\XignDefs.hpp)?
Are you running Visual Studio as admin?

Share this post


Link to post

when i try to build solution, the .dll doesn't get created and i don't know what should i do.

@edit

nvm, it finnally works, thank you everybody <3

Edited by Progity

Share this post


Link to post
Guest
2 hours ago, tan said:

Does this work for other maple ? such as MapleSEA , KMS ...

Yes, it should work for any game that uses XignCode.

Share this post


Link to post

Hey nanoteck, thanks for the response :D

I do run visual studio as admin, but the Xingdefs.hpp isnt present in my bypass folder, where can i add it? 

 

Share this post


Link to post
26 minutes ago, oulieman said:

Hey nanoteck, thanks for the response :D

I do run visual studio as admin, but the Xingdefs.hpp isnt present in my bypass folder, where can i add it? 

 

Re-extract the XingCode3 Bypass rar file, and start over. If you wait 45 min I will have an updated video guide up that is easier to follow.

Share this post


Link to post

Hey man thanks for the tutorial it all works, but after 1 or 2 min dmg hack i get the error: maplestory doesnt work anymore, because there is a problem with the program. It will now shut down and i get dced. Do you know how to avoid that?

 

Share this post


Link to post
2 hours ago, Mationga said:

ok, but can i still use detours?

Yes, it's just that the code doesn't really do anything useful.

Share this post


Link to post

Great video, but I still have some problems with the bypass and maplestory.

Running maplestory for like 2 minutes, maplestory crashes and XignCode client shows this error - 

http://i.imgur.com/rnufykO.png

What should I do now?

Edited by Kyle

Share this post


Link to post
2 minutes ago, Kyle said:

Great video, but I still have some problems with the bypass and maplestory.

Running maplestory for like 2 minutes, maplestory crashes and XignCode client shows this error - 

%7Boption%7Dhttp://i.imgur.com/rnufykO.png

What should I do now?

Deactivate your firewall (in the VPS).

Share this post


Link to post
23 minutes ago, Razz said:

Deactivate your firewall (in the VPS).

Deactivated the firewall, but the error still persists.

lyyjlAG.png

Share this post


Link to post
10 minutes ago, Kyle said:

Deactivated the firewall, but the error still persists.

lyyjlAG.png

Then the IP address configured is incorrect.

  • Like 1

Share this post


Link to post

I have problems with the host.exe file , even though I checked that is the IP from the VMWare and I put the path from the game in the VMWare it still closes .

Edited by SgtHexcs

Share this post


Link to post
2 hours ago, SgtHexcs said:

I have problems with the host.exe file , even though I checked that is the IP from the VMWare and I put the path from the game in the VMWare it still closes .

Did you rebuild the source? 

If the .exe is closing, there must be something wrong

Share this post


Link to post

 

8 hours ago, SgtHexcs said:

I have problems with the host.exe file , even though I checked that is the IP from the VMWare and I put the path from the game in the VMWare it still closes .

you also need to run it as admin.

  • Like 1

Share this post


Link to post
Guest
This topic is now closed to further replies.
×