BorderGame
[Release] NosTale Encryption & Decryption - Versione stampabile

+- BorderGame (https://www.bordergame.it)
+-- Forum: NosTale (/Forum-NosTale)
+--- Forum: Server Privati Nostale (/Forum-Server-Privati-Nostale)
+--- Discussione: [Release] NosTale Encryption & Decryption (/Thread-Release-NosTale-Encryption-Decryption)

Pagine: 1 2 3 4


[Release] NosTale Encryption & Decryption - Trollface- - 01-09-2012 02:36 PM

JUST TRANSLATE TO YOUR LANGUAGE
CREDITS: Trollface-
##################################
FOR PEOPLE WHO WANTS TO CREATE PSERVER



Für alle Developer die einen Privat Server erstellen wollen.

Da ich häufig gefragt werde und am Server sowieso kaum/garnicht arbeite weil ich andere Projekte am start habe, release ich die Verschlüsselungen hierfür.

Dies soll allen Entwicklern helfen die einen Privat Server erstellen wollen oder eventuell auch was anderes vorhaben.

Ich kann euch nicht 100% Garantieren ob die Verschlüsselung 1:1 so ist, ich hab sie so Reversed und funktioniert auch einwandfrei.

Zum Teil ist der Code unschön aber diesen könnt ihr ja nach belieben einfach umändern. ;p

Login Decryption:

Codice:
std::string DecryptLoginPacket(std::string str)
{
    std::string decrypted_string;

    for (int i = 0; i < str.length(); i++) { decrypted_string += str[i] - 0xF ^ 0xC3; }

    return decrypted_string;
}

Login Encryption:

Codice:
std::string EncryptLoginPacket(std::string str)
{
    std::string encrypted_string;

    for (int i = 0; i < str.length(); i++) { encrypted_string += str[i] + 0xF; }

    return encrypted_string += 0x19;
}

Password Hash Decryption (Hässliger Code):

Codice:
std::string DecryptHashPassword(std::string str)
{
    std::string decrypted_string;
    int count = 1;
    int convert;

    if (str.length() %2 == 0)
    {
        str.erase(0, 3);
    } else
    {
        str.erase(0, 4);
    }

    for (int i = 0; i < str.length(); i+=2)
    {
        decrypted_string += str[i];

        if (count %2 == 0)
        {
            decrypted_string += ' ';
        }
        count++;
    }

    std::stringstream ss(decrypted_string);
    decrypted_string.clear();

    while (ss >> std::hex >> convert)
    {
        decrypted_string.push_back(convert);
    }

    return decrypted_string;
}

Session Packet Decryption:
(Die Sessionid braucht ihr um die Gamepackets entschlüsseln zu können)

Codice:
std::string DecryptSessionPacket(std::string str)
{
    std::string    encrypted_string;

    for (int i = 1; i < str.length(); i++)
    {
                if (str[i] == 0xE) { return encrypted_string; }

        unsigned char firstbyte = str[i] - 0xF;
        unsigned char secondbyte = firstbyte;
        secondbyte &= 0xF0;
        firstbyte =    firstbyte - secondbyte;
        secondbyte >>=    0x4;

        switch (secondbyte)
        {
        case 0:
            encrypted_string +=    '\0';
        break;

        case 1:
            encrypted_string +=    ' ';
        break;

        case 2:
            encrypted_string +=    '-';
        break;

        case 3:
            encrypted_string +=    '.';
        break;

        default:
            secondbyte += 0x2C;
            encrypted_string +=    secondbyte;
        break;
        }

        switch (firstbyte)
        {
        case 0:
            encrypted_string +=    '\0';
        break;

        case 1:
            encrypted_string += ' ';
        break;

        case 2:
            encrypted_string += '-';
        break;

        case 3:
            encrypted_string += '.';
        break;

        default:
            firstbyte += 0x2C;
            encrypted_string +=    firstbyte;
        break;
        }
    }

    return encrypted_string;
}

Game Packet Decryption (2 Parts):

Codice:
std::string DecryptGamePacket(int session_id, unsigned char *str, int length)
{
    std::string encrypted_string = "";
    int session_key = session_id & 0xFF;
    unsigned char session_number = session_id >> 6;
    session_number &= 0xFF;
    session_number &= 0x80000003;

    switch (session_number)
    {
    case 0:
        for (int i = 0; i < length; i++)
        {
                unsigned char firstbyte = session_key + 0x40;
                unsigned char highbyte = str[i] - firstbyte;
                encrypted_string += highbyte;
        }
    break;

    case 1:
        for (int i = 0; i < length; i++)
        {
                unsigned char firstbyte = session_key + 0x40;
                unsigned char highbyte = str[i] + firstbyte;
                encrypted_string += highbyte;
        }
    break;

    case 2:
        for (int i = 0; i < length; i++)
        {
                unsigned char firstbyte = session_key + 0x40;
                unsigned char highbyte = str[i] - firstbyte ^ 0xC3;
                encrypted_string += highbyte;
        }
    break;

    case 3:
        for (int i = 0; i < length; i++)
        {
                unsigned char firstbyte = session_key + 0x40;
                unsigned char highbyte = str[i] + firstbyte ^ 0xC3;
                encrypted_string += secondbyte;
        }
    break;

    default:
        encrypted_string += 0xF;
    break;
    }

    std::vector<std::string> temp = split(encrypted_string, 0xFF);
    std::string save = "";

    for (int i = 0; i < temp.size(); i++)
    {
        save += DecryptGamePacket2(temp[i].c_str());
        save += 0xFF;
    }

    return save;
}

  std::string DecryptGamePacket2(unsigned char str[])
{
    std::string decrypted_string;
    char table[] = {' ','-','.','0','1','2','3','4','5','6','7','8','9','\n'};
    int count = 0;

    for (count = 0; count < strlen(str); )
    {
        if (str[count] <= 0x7A)
        {
            unsigned char len = str[count];

            for (int i = 0; i < (int)len; i++)
            {
                count++;
                decrypted_string += str[count] ^ 0xFF;
            }

            count++;
        } else
        {
            unsigned char len = str[count];
            len &= 0x7F;

            for (int i = 0; i < (int)len;)
            {
                count++;

                unsigned char highbyte = str[count];
                highbyte &= 0xF0;
                highbyte >>= 0x4;

                unsigned char lowbyte = str[count];
                lowbyte &= 0x0F;

                if (highbyte != 0x0 && highbyte != 0xF)
                {
                    decrypted_string += table[highbyte-1];
                    i++;
                }

                if (lowbyte != 0x0 && lowbyte != 0xF)
                {
                    decrypted_string += table[lowbyte-1];
                    i++;
                }
            }
            count ++;
        }
    }

    return decrypted_string;
}

Game Packet Encryption

Codice:
std::string EncryptGamePacket(string str)
{
    std::string encrypted_string;
    std::vector<std::string> buffer;

    buffer = split(str, ' ');
    encrypted_string +=    buffer[0].length();

    for (int i = 0 ; i < str.length(); i++)
    {
        if (i == buffer[0].length())
        {
            int    size = str.length() - buffer[0].length();
            encrypted_string +=    size;
        }

        encrypted_string +=    str[i] ^ 0xFF;
    }

    return encrypted_string += 0xFF;
}

Viel spaß noch. Wink


RE: [Release] NosTale Encryption & Decryption - *Axel - 01-09-2012 02:41 PM

Good Big Grin


RE: [Release] NosTale Encryption & Decryption - WK4ever - 01-09-2012 02:42 PM

ke sarebbe??


RE: [Release] NosTale Encryption & Decryption - *Axel - 01-09-2012 02:45 PM

Se lo capisci riesci anche a fare un pserver Big Grin


RE: [Release] NosTale Encryption & Decryption - Ð3V!L - 01-09-2012 02:46 PM

good trollface.. Smile

WK4ever è roba che tu non riuscirai mai a capiree!
1.000 pserver usciranno fuori da oggi XD


RE: [Release] NosTale Encryption & Decryption - SuicideSilence~ - 01-09-2012 02:53 PM

Ok, da domani ci saranno 342309480239842834 pserver attivi. BRAVI RAGAZZI!


RE: [Release] NosTale Encryption & Decryption - *Axel - 01-09-2012 03:06 PM

Speriamo :O


RE: [Release] NosTale Encryption & Decryption - riciardgo - 01-09-2012 03:22 PM

Excellent Job TrollFace, you're doing an'excellent Job, Congratulation!


RE: [Release] NosTale Encryption & Decryption - ~Giorigo1~ - 01-09-2012 03:31 PM

Good job TrollFace °-° Big Grin


RE: [Release] NosTale Encryption & Decryption - minusto - 01-09-2012 03:39 PM

Si parte Smile


RE: [Release] NosTale Encryption & Decryption - Sl4mDunk - 01-09-2012 03:58 PM

Addio Nos.it menomale ancora non ho riniziato dovevo riniziare a metà mese dopo fine lavoro xD


RE: [Release] NosTale Encryption & Decryption - minusto - 01-09-2012 04:01 PM

Questi non sono tutti i codici xD
Per cui, non tutti riusciranno a svilupparlo..
Ma molti ci proveranno Wink


RE: [Release] NosTale Encryption & Decryption - Releo - 01-09-2012 04:01 PM

Nice job
Devil addio ai tuoi progetti di guadagno :\


RE: [Release] NosTale Encryption & Decryption - giox90 - 01-09-2012 04:04 PM

Traduzione?


RE: [Release] NosTale Encryption & Decryption - Sl4mDunk - 01-09-2012 04:04 PM

No cmq Devil potrà fare un suo Retro con un Nosmall a pagamento minore rispetto a Nos.it ci sn molti retro di Metin ad esempio ke fanno così e sn fatti molto bn e durano da molto tempo ^^


RE: [Release] NosTale Encryption & Decryption - ‎iConnect - 01-09-2012 04:08 PM

Good Smile


RE: [Release] NosTale Encryption & Decryption - OMG!ChePro - 01-09-2012 04:22 PM

Grandee


RE: [Release] NosTale Encryption & Decryption - *Axel - 01-09-2012 04:35 PM

(01-09-2012 04:04 PM)giox90 Ha scritto:  Traduzione?

giox tu non ci capisci niente lì ma molti programmatori sanno che c'è scritto e se aspettiamo ancora un pò ci faranno il regalo di natale Big Grin


RE: [Release] NosTale Encryption & Decryption - Ð3V!L - 01-09-2012 04:50 PM

Ehm xk addio?
non sono tutti i decrypt/encrypt e non tutti riusciranno a proseguire xD..
questo mi manderà avanti col lavoro ^^


RE: [Release] NosTale Encryption & Decryption - *Axel - 01-09-2012 06:17 PM

Speriamo che abbia breve termine Big Grin