Convert RBXM to RBXMX, or the other way around

I just recently got into C# and made a console application to convert model files from binary to xml or the other way around. I’m not the best programmer but I think I got it right.

If anyone else is learning C# and wants to make stuff together I’m glad to do so because I need some more experience in this language.

Paygammy/RBXMLConvert (github.com)

Here’s the very basic source code that I wrote.

using RobloxFiles;

Console.Title = "RBXMLConvert Console Application";
Console.WriteLine("Thank you for using my conversion tool!\nBig credit to MaximumADHD for the API.\n\nPlease input the path to your file.");

string? FilePath = Console.In.ReadLine();

if (File.Exists(FilePath))
{
    Console.WriteLine("Processing...");
    RobloxFile robloxFile = RobloxFile.Open(FilePath);
    switch (robloxFile)
    {
        case BinaryRobloxFile:
            {
                Console.WriteLine("Converting from BinaryRobloxFile");
                RobloxFile XmlResult = new XmlRobloxFile();
                foreach (Instance robloxInstance in robloxFile.GetChildren())
                {
                    robloxInstance.Parent = XmlResult;
                }
                string SavePath = FilePath.Replace(".rbxm", ".rbxmx");
                XmlResult.Save(SavePath);
                break;
            }

        case XmlRobloxFile:
            {
                Console.WriteLine("Converting from Xml");
                RobloxFile BinaryResult = new BinaryRobloxFile();
                foreach (Instance robloxInstance in robloxFile.GetChildren())
                {
                    robloxInstance.Parent = BinaryResult;
                }
                string SavePath = FilePath.Replace(".rbxmx", ".rbxm");
                BinaryResult.Save(SavePath);
                break;
            }
    }
}

Overall, I’m just kind of insecure about the code but I am hoping this helps whoever needs it because it sure helped me.

3 Likes

Pray tell, is there any significant or notable difference between the RBXM and RBXMX file formats?

1 Like

Size. rbxm, as its binary-encoded, is significantly smaller than rbxmx (XML), which is encoded using text characters.

2 Likes

That is rather informative, but how does size even affect ROBLOX Studio? Would it perhaps change the speed ROBLOX Studio “freezes” (processes) the file when you insert it?

1 Like

Yes, I believe there’s a post regarding this by a Roblox Staff member but I cannot find it right now.

1 Like

I like this, but does this work with Roblox Place Files? I want to really see what’s inside of the “corrupted” DataModelPatch file Roblox has in the client.

It just contains the client & server scripts for the Roblox Game Client & Server. There’s nothing really special about it. Although encrypted with CDATA, they’re not actually trying to hide anything because an exploiter can easily export it through the engine itself.

BiG cReDiT tO mAxImUmAdHd.

Lol

By any chance is this still available? the github does not exist for me, Cheers