HelpHow to edit rotmg.sol

Posts 1–7 of 7 · Page 1 of 1
How to edit rotmg.sol
I asked a few people for help, but it didn't work so I'm asking here.
I'm trying to find a way to edit rotmg.sol and change the password and guid with code

So far I have tried to convert muledump's one click login to C#, but and here's the code.
Muledump:
Func _build()
;header
$string = "0x 00 BF" ;Magic Number 2 bytes
$string &= "?? ?? ?? ??" ;Size 4 bytes
$string &= "54 43 53 4F 00 04 00 00 00 00" ;Marker 10 bytes
$string &= "00 05" ;Name Size 2 bytes
$string &= "52 6F 74 4D 47" ;"RotMG" 5 bytes
$string &= "00 00 00" ;Padding 3 bytes
$string &= "03" ;AMF Version 1 byte

;data
$string &= "11" ;Length 1 byte
$string &= "50 61 73 73 77 6F 72 64" ;"Password" 8 bytes
$string &= "06" ;Type (string) 1 byte
$string &= _length($password) ;Length 1 byte
$string &= $password ;Actual Password ? bytes
$string &= "00" ;AMF Padding 1 byte

$string &= "09" ;Length 1 byte
$string &= "47 55 49 44" ;"GUID" 4 bytes
$string &= "06" ;Type (string) 1 byte
$string &= _length($email) ;Length 1 byte
$string &= $email ;Email ? bytes
$string &= "00" ;AMF Padding 1 byte

$string = StringReplace($string," ","")
$string = StringRegExpReplace($string,"\?{8}",Hex(Int(String Len(StringMid($string,15))/2)))
EndFunc

Here is mine:
String text = "0x 00 BF";
text += "?? ?? ?? ??";
text += "54 43 53 4F 00 04 00 00 00 00";
text += "00 05";
text += "52 6F 74 4D 47";
text += "00 00 00";
text += "03";
text += "11";
text += "50 61 73 73 77 6F 72 64";
text += "06";
text += password.Length;
text += password;
text += "00";
text += "09";
text += "47 55 49 44";
text += "06";
text += guid.Length;
text += guid;
text += "00";
text = text.Replace(" ", "");
var regex = new Regex(@"\?{8}");
text = regex.Replace(text, ((text.Substring(15).Length / 2).ToString("X")));

If you can fix my code, or provide a better way to do it in C# that would be great
rotmg.sol I believe is the file containing your e-mail & password.

What are you exactly attempting to do?
Quote Originally Posted by Austen_Dayton View Post
rotmg.sol I believe is the file containing your e-mail & password.

What are you exactly attempting to do?
Yes sir!
for an mbox to log in to multiple accounts you need to edit rotmg.sol in between each login
you should probably go with One Click Login on that? If you don't want to you'll need to put in account the loading times of your Adobe and mess with that. Hope it helps ;0
This seemed interesting so I decided to take a stab at it.
 
C#
Code:
static readonly byte[] constBytes =
    new byte[] {
        0x00, 0xbf, //magic number
        0x54, 0x43, 0x53, 0x4f, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x52, 0x6f, 0x74, 0x4d, 0x47, 0x00, 0x00, 0x00, 0x03, //file header
        0x09, 0x47, 0x55, 0x49, 0x44, 0x06, //guid header
        0x11, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x06 //password header
    };

static void WriteSol(string guid, string password)
{
    using (FileStream file = new FileStream("RotMG.sol", FileMode.Create, FileAccess.Write))
    {
        file.Write(constBytes, 0, 2);

        byte[] temp = BitConverter.GetBytes(41 + guid.Length + password.Length);
        if (BitConverter.IsLittleEndian)
            Array.Reverse(temp);
        file.Write(temp, 0, temp.Length);

        file.Write(constBytes, 2, 27);

        temp[0] = (byte)(guid.Length * 2 + 1);
        file.Write(temp, 0, 1);

        temp = Encoding.ASCII.GetBytes(guid);
        file.Write(temp, 0, temp.Length);

        byte[] pad = new byte[] { 0x00 };
        file.Write(pad, 0, pad.Length);

        file.Write(constBytes, 29, 10);

        temp[0] = (byte)(password.Length * 2 + 1);
        file.Write(temp, 0, 1);

        temp = Encoding.ASCII.GetBytes(password);
        file.Write(temp, 0, temp.Length);
        
        file.Write(pad, 0, pad.Length);
    }
}
 
C++
Code:
#include <string>
#include <fstream>

const char fileHeader[27] = { 0x00, 0xbf, 0x00, 0x00, 0x00, 0x00, 0x54, 0x43, 0x53, 0x4f, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x52, 0x6f, 0x74, 0x4d, 0x47, 0x00, 0x00, 0x00, 0x03 };
const char guidHeader[6] = { 0x09, 0x47, 0x55, 0x49, 0x44, 0x06 };
const char passHeader[10] = { 0x11, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x06 };

void writeSol(std::string guid, std::string password)
{
    int size = 47 + guid.size() + password.size();
    char* buffer = new char[size];

    memcpy(buffer, fileHeader, 27);
    int dataLength = size - 6;
    int num = 1;
    if (*(char*)&num == 1) //little endian
    {
        char* ptr = (char*)&dataLength;
        buffer[2] = ptr[3];
        buffer[3] = ptr[2];
        buffer[4] = ptr[1];
        buffer[5] = ptr[0];
    }
    else //big endian
        memcpy(buffer+2, &dataLength, 4);

    memcpy(buffer + 27, guidHeader, 6);
    buffer[33] = guid.size() * 2 + 1;
    memcpy(buffer + 34, guid.c_str(), buffer[33] + 1);

    memcpy(buffer + 35 + guid.size(), passHeader, 10);
    buffer[45 + guid.size()] = password.size() * 2 + 1;
    memcpy(buffer + 46 + guid.size(), password.c_str(), buffer[45 + guid.size()] + 1);

    std::fstream bin("RotMG.sol", std::ios::out | std::ios::binary);
    bin.write(buffer, size);
    bin.close();

    delete[] buffer;
}
Here's a solution in Node.js for those that are interested.

Code:
/**
 * Creates a sol file with the email and password.
 * @param {string} email The email.
 * @param {string} password The password.
 */
function createSol(email, password) {
  const sol = [
    '00bf000000005443534f0004000000000005526f744d4700000003094755494406',
    (email.length * 2 + 1).toString(16),
    Buffer.from(email).toString('hex'),
    '001150617373776f726406',
    (password.length * 2 + 1).toString(16),
    Buffer.from(password).toString('hex'),
    '00'
  ].join('');
  const buffer = Buffer.from(sol, 'hex');
  buffer.writeInt32BE(buffer.length - 6, 2);
  return buffer;
}
The function returns a Buffer so it can be piped right into a WriteStream like so
Code:
const fs = require('fs');

const sol = createSol('test@email.com', 'password');

fs.createWriteStream('RotMG.sol').end(sol);
Posts 1–7 of 7 · Page 1 of 1

Post a Reply

Similar Threads

Talk with us