Important information: this site is currently scheduled to go offline indefinitely by end of the year.

MX vs ATV Reflex BXML files

Read or post about compression. And decompression. Or ask questions how to decompress your files.
Number18
ultra-n00b
Posts: 6
Joined: Sun Nov 28, 2010 3:51 pm

MX vs ATV Reflex BXML files

Post by Number18 »

Hello all,

Could somebody please take a look at this BXML format from MX vs ATV Reflex for PC. They seem to be encrypted XML files, the original XML files are still there but the game doesn't read those even after removing the BXML file.

I have uploaded a RAR package with some BXML and XML files here.

It would be much appreciated by the whole MX vs ATV community.
figuare9
n00b
Posts: 16
Joined: Wed Dec 01, 2010 7:39 am
Has thanked: 4 times

Re: MX vs ATV Reflex BXML files

Post by figuare9 »

Don't feel bad. I've been working on this for days.

First I thought it was backbase.. I called the company for help.. They said they couldn't help. not anything they're familiar with.

Second I thought it was a BXML file from here. : http://www.cubewerx.com/bxml
I just got out of a conversation with a guy from there.. Here was the conversation...

ME:

I'm a modder. I've been part of modding communities for video games for years. I've always loved the communities and enjoyed creating new things for the them. I'm currently workin on a project for a game called "MX VS ATV Reflex" for the PC. However, I've run into a problem. I have a "BXML File" that I can't seem to edit. I can't find any text editors that will work for it and I've tried EVERYTHING I know with Visual Studio.

I've been going off tutorials because I'm extremely new to all of this. All I want to do, is be able to view and edit the BXML file. The game I'm working on has two files for each name. One file is an XML and another File is a BXML. For example "MXRegistry.xml" and "MXRegistry.BXML" The game doesn't care about the xml files, and I believe these are only there to edit, and pack back into a BXML file. I know that I need to edit the bxmls, but I can't for the life of me, figure out how to edit them.

I've spent days trying to figure this out with no help. If you could help, or shine some light on how to edit a BXML file, I would be extremely appreciative.

HIM:

There are a few different formats for encoding XML data in binary and
I am only familiar with one of them. Send me a hexadecimal dump of the
first 16 bytes of the file (or the whole thing if it's short) and I'll
see if I can help you.

ME:

thank you so much! I think it would be much easier for you if I sent you the bxml files. If you can manage to edit this... I attached the file.

HIM:

Sorry, this isn't the BXML format that I'm familiar with. I don't know
what format your file is in.


So.... To sum it up.. I think we're SOL... I really hope someone can figure this out. I've exhausted my efforts. It's apparently not backbase, nor is it from cube, so... im lost.. lol
WRS
ultra-veteran
ultra-veteran
Posts: 603
Joined: Fri Nov 06, 2009 12:13 am
Has thanked: 74 times
Been thanked: 137 times

Re: MX vs ATV Reflex BXML files

Post by WRS »

it uses a very common compression algorithm which is easy to identify.

the bxml format contains some details on the uncompressed data, which uses a string table for the tags which can easily be reproduced in xml format.

quickbms is not the best tool to rebuild the xml file, but if i have time, i'll see how far it can get. 2 minute bms script to at least parse the file:

Code: Select all

idstring "BXML"
get UNKNOWN long # 0x103EA - bxmlformat/engine/game version
get STRINGS long # number of strings in uncompressed data
get P_EOSTR long # point to end of strings in uncompressed data

# room for 2 other numbers + pointers

goto 32

get ZSIZE long

comtype zlib

get NAME basename
string NAME += "_bxml.xml"

clog NAME 0x24 ZSIZE 0xfffff
Useful tool links:
figuare9
n00b
Posts: 16
Joined: Wed Dec 01, 2010 7:39 am
Has thanked: 4 times

Re: MX vs ATV Reflex BXML files

Post by figuare9 »

well wrs I hope u can figure it out. you'd be the first. I know I'm lost. All I know is that its compressed. I don't know how to decompress it, and re-compress it back into bxml for the game to understand, so I hope you can. lol
WRS
ultra-veteran
ultra-veteran
Posts: 603
Joined: Fri Nov 06, 2009 12:13 am
Has thanked: 74 times
Been thanked: 137 times

Re: MX vs ATV Reflex BXML files

Post by WRS »

figuare9 wrote:well wrs I hope u can figure it out. you'd be the first. I know I'm lost. All I know is that its compressed. I don't know how to decompress it, and re-compress it back into bxml for the game to understand, so I hope you can. lol
use http://aluigi.altervista.org/papers/quickbms.zip and my script to decompress it but converting it to xml is next. just running the script you see how it matches the xml samples.
Useful tool links:
WRS
ultra-veteran
ultra-veteran
Posts: 603
Joined: Fri Nov 06, 2009 12:13 am
Has thanked: 74 times
Been thanked: 137 times

Re: MX vs ATV Reflex BXML files

Post by WRS »

i'll be honest. i didn't see myself spending 3 hours on this format :mrgreen: i didn't really expect quickbms to support recursion too well either - I WAS WRONG!

i've finished a work in progress which works on smaller bxml files but i've overlooked something on node order, and i haven't looked at _valuetype yet, so thats not there.

bxml files doesn't store comments. at all. so recreating them is impossible.

i also decided formatting was worth including, so indenting and one conditional tag syntax is included :scaredy:

see the previous posts for a link to quickbms if you try this version out.
You do not have the required permissions to view the files attached to this post.
Useful tool links:
figuare9
n00b
Posts: 16
Joined: Wed Dec 01, 2010 7:39 am
Has thanked: 4 times

Re: MX vs ATV Reflex BXML files

Post by figuare9 »

damn that was fasssst! However, I actually don't need BXML to XML.. We need it the other way around. Let me explain.

As you can see in this picture, the game has a BXML file for every XML file. HOWEVER, the game doesn't actually use the xml files. I can run the game completely fine without any of the xml files. I can also edit the XML files and when I start the game nothing I edited works.

What does this mean? It means that the game ONLY uses the BXML files. So... We don't exactly need BXML to XML because the game already provided us with the XML files to edit.... We just need to edit the existing XML files and convert them to the BXML that the game needs to read.

Image
Number18
ultra-n00b
Posts: 6
Joined: Sun Nov 28, 2010 3:51 pm

Re: MX vs ATV Reflex BXML files

Post by Number18 »

Wow great work! If only we can compile them back to BXML now!

@figure9: We do need the ability to convert BXML to XML because there some some files, the camera presets for example that do not have an original XML in place.
figuare9
n00b
Posts: 16
Joined: Wed Dec 01, 2010 7:39 am
Has thanked: 4 times

Re: MX vs ATV Reflex BXML files

Post by figuare9 »

a lot of people that mod have very basic knowledge of anything besides photoshop and 3d modeling. If someone could develop an application that can give us "BXML to XML" and vise-versa, we would be in perfect business.I'm one of those people. I don't know C, and I don't like software im unfamiliar with. I think that goes for a lot of people. What we really need is an app that can do the bxml crap for us.
Number18
ultra-n00b
Posts: 6
Joined: Sun Nov 28, 2010 3:51 pm

Re: MX vs ATV Reflex BXML files

Post by Number18 »

figuare9 wrote:a lot of people that mod have very basic knowledge of anything besides photoshop and 3d modeling. If someone could develop an application that can give us "BXML to XML" and vise-versa, we would be in perfect business.I'm one of those people. I don't know C, and I don't like software im unfamiliar with. I think that goes for a lot of people. What we really need is an app that can do the bxml crap for us.
Well we're halfway there now. Editing the XML is very easy with just notepad, though I use Dreamweaver myself.
WRS
ultra-veteran
ultra-veteran
Posts: 603
Joined: Fri Nov 06, 2009 12:13 am
Has thanked: 74 times
Been thanked: 137 times

Re: MX vs ATV Reflex BXML files

Post by WRS »

it should be easy to convert back if anyone had the time do write it in a slightly more powerful language.

i just came back to post a spec i just wrote up with the corrections to how the node levels are stored in the last section of the uncompressed data.

Code: Select all

BXML FORMAT
-----------

Signature (4 bytes, ASCII "BXML")
Version
StringCount
PoolPointer
PoolSize
AttributeCount
NodeCount
Unknown (0)
CmpSize

Followed by data (with a length of CmpSize) compressed with zlib:

UNCOMPRESSED DATA FORMAT
------------------------

String table (variable size):

Null-terminated strings


Pool (size of PoolSize):

Mixture of integer, boolean and floating point values


Attribute table (12 bytes):

ANameIndex
AValueIndex
AOther


Node table (32 bytes):

NNameIndex
NInnerTextIndex
NUsesPool
NValueType
NLevelId
NChildCount
NAttribIndex
NAttribCount

NODE TABLE INFO
---------------

All nodes on the same level are stored together

Level0
Level1
Level2
.. etc

There must only be 1 top level node at level 0 (named after the filename).

Property info:

NInnerTextIndex will have a value of -1 if there is no inner text.
NUsesPool is a boolean, if 1, the inner text is from the Pool.
NValueType with a value greater than 0 adds a "_valuetype" attribute:

(NOTE: NOT ALL VALUETYPES HAVE BEEN FOUND)

1: "string" (does not seem to use the pool)
3: "int"
5: "float"

11: "bool (either "T", "F" or "true" or "false")

There is also a vector3 type (MXRegistry.bxml)


NLevelID is the sum of the previous levels' NLevelID + NChildCount

NAttribCount is each attribute starting from NAttribIndex

The string table is just a list of all the unique strings in the XML document, which are referenced by the various name indexes.

This format was fun, thanks :wink:
Useful tool links:
Number18
ultra-n00b
Posts: 6
Joined: Sun Nov 28, 2010 3:51 pm

Re: MX vs ATV Reflex BXML files

Post by Number18 »

WRS wrote:This format was fun, thanks :wink:
And thank you, this is a great step in the right direction! Not long before our community can continue modding the MvA series. :)
figuare9
n00b
Posts: 16
Joined: Wed Dec 01, 2010 7:39 am
Has thanked: 4 times

Re: MX vs ATV Reflex BXML files

Post by figuare9 »

WRS, I don't suppose you can make a tool to allow us to convert XML to BXML?
WRS
ultra-veteran
ultra-veteran
Posts: 603
Joined: Fri Nov 06, 2009 12:13 am
Has thanked: 74 times
Been thanked: 137 times

Re: MX vs ATV Reflex BXML files

Post by WRS »

figuare9 wrote:WRS, I don't suppose you can make a tool to allow us to convert XML to BXML?
i have spent a little longer on this format as the recursion thing was itching at me... and i finished a bxml to xml converter - but even that's missing some value types which aren't in the samples.

to repack i need to figure out how to read the xml tree recursively into the bxml table.. with all those indexes too :wink:

for now, see if you run into any trouble converting larger bxml files to xml - my pascal was a little rusty! source is included.
You do not have the required permissions to view the files attached to this post.
Useful tool links:
figuare9
n00b
Posts: 16
Joined: Wed Dec 01, 2010 7:39 am
Has thanked: 4 times

Re: MX vs ATV Reflex BXML files

Post by figuare9 »

That's great! You'd definitely be the first to figure this one out. If you can get this done maybe I'll donate some cash your way for your efforts. I know there would be a lot of people that are gunna love you for this! haha
Post Reply