BorderGame

Versione completa: [Release] NosTale Encryption & Decryption
Al momento stai visualizzando i contenuti in una versione ridotta. Visualizza la versione completa e formattata.
Pagine: 1 2 3 4

Trollface-

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
Good Big Grin
ke sarebbe??
Se lo capisci riesci anche a fare un pserver Big Grin
good trollface.. Smile

WK4ever è roba che tu non riuscirai mai a capiree!
1.000 pserver usciranno fuori da oggi XD
Ok, da domani ci saranno 342309480239842834 pserver attivi. BRAVI RAGAZZI!
Speriamo :O
Excellent Job TrollFace, you're doing an'excellent Job, Congratulation!
Good job TrollFace °-° Big Grin
Si parte Smile
Addio Nos.it menomale ancora non ho riniziato dovevo riniziare a metà mese dopo fine lavoro xD
Questi non sono tutti i codici xD
Per cui, non tutti riusciranno a svilupparlo..
Ma molti ci proveranno Wink
Nice job
Devil addio ai tuoi progetti di guadagno :\
Traduzione?
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 ^^
Good Smile
Grandee
(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
Ehm xk addio?
non sono tutti i decrypt/encrypt e non tutti riusciranno a proseguire xD..
questo mi manderà avanti col lavoro ^^
Speriamo che abbia breve termine Big Grin
Pagine: 1 2 3 4
URL di riferimento