Way To Decode RBXM ModuleScripts From AssetDelivery API To Text?

Using the AssetDelivery web API, I quickly realized the format that it gives you is the RBXM binary format. Is it possible to decode this binary in pure Luau OR have the API return XML instead (an RBXMX file)?

Have you tried saving it as a .zip and unzipping the file? That’s a trick that is used with .xlsx / .pptx files.

Only real way to read Roblox’s binary spec is to use a library like this

Its written in C# so have fun pulling you hair out with it, you can probably find the binary spec for RBXM if you look hard enough since it was documented a while ago.

1 Like

Is this the binary spec you’re referring to?

Edit: Unfortunately this link is now broken. Not sure where the article lives now.

Looks like it is possible.
Took me a while to convert the project from .NET Framework into .NET 6.0 but I finally did it.

using RobloxFiles;

RobloxFile file = RobloxFile.Open(@"That file you downloaded.rbxm");

foreach (var instance in file.GetDescendantsOfType<ModuleScript>())
{
    System.IO.File.WriteAllText(instance.ToString() + ".lua", instance.Source);
}

It emits the full source code.

I’m just really happy right now, that someone made such library.

1 Like

Although this is an answer to the question, it isn’t a real solution. I can’t write C# in Roblox, so the only way to use this would be to make an ASP.NET app that uses this in the backend (not even sure about that, I’m new to the dotnet framework).

I could theoretically translate the binary decoder written by the authors of BTRoblox but that would be a huge project to take under.

There’s this one? Scripts can’t be read unfortunately. Not 100% Roblox Lua(I think just change the requires). And it looks like it is unmaintained.
GitHub - Dekkonot/rbx-binary-format: A pure-Lua implementation of the Roblox binary format.

1 Like