Page 1 of 1

Unreadable Game Data XMLs

Posted: Sat Sep 30, 2017 8:29 am
by ReedSteed
I have a list of XML files that i want to edit from WADs I've extracted from the game called Wizard101 (GameBryo Engine if that helps).

I believe these XML's contain the game code for their respective areas (example: extracting MB_Arena.wad gives me the textures, the model and these XML's).

My only issue is upon opening these XML's in Notepad, WordPad etc.. I am greeted with strange characters that I cannot understand (let alone make edits to).

My goal is to edit the areas code so that teleporting to the area as a spectator would teleport my character on the battle circle and not in the spectator area (maybe with triggers.xml so that it adds me into battle always, or spawndata.xml to spawn my character onto the battle circle.. (as colliding with the circle joins you into battle automatically).

Can anyone translate the code in these XML's or help me read it? (Note: I believe the mechanics were written mainly in C/C++)

EXAMPLE XML'S + OTHER DATA FROM MB_ARENA.WAD HERE:

http://www.mediafire.com/file/99ore2ia8 ... +Arena.rar

Re: Unreadable Game Data XMLs

Posted: Sat Sep 30, 2017 10:23 am
by WRS
These are "binary" xml files - xml files packed into data.

Interestingly portals.xml is actual xml :mrgreen:

Re: Unreadable Game Data XMLs

Posted: Sat Sep 30, 2017 11:50 am
by ReedSteed
WRS wrote:These are "binary" xml files - xml files packed into data.
Is there any way I can open/edit these binaries properly?

Re: Unreadable Game Data XMLs

Posted: Sat Sep 30, 2017 1:45 pm
by WRS
What tools did you use to unpack the 'WAD's? I'm thinking there may be other tools like XML converting for this engine? Some of these other files like NIF are graphics files which would need converting to read..

Otherwise we can look at examining it

Re: Unreadable Game Data XMLs

Posted: Sat Sep 30, 2017 2:33 pm
by WRS
Here, I've written a script which can parse all files. Not sure how to reconstruct them to xml yet! Check back later

Code: Select all

// binary template for 010 editor. save as FILENAME.bt
// wrs

/////////////////////////////////
typedef uint uint_p2 <read=ReadUIntP2>;

uint unpackLen(uint len)
{
  // len is is bits (x8 larger than it need be)
  // odd values are restored

  local int b = (len>>3);// + (len&0x7);
  //Printf("%u ==> %u (%u)**\n", len, b, (len&0x7));

if( (len&0x7) == 1 ){ b++; }

  return b - 4;//sizeof(uint);
}

// 010ed magic
string ReadUIntP2( uint_p2 b ) {
  string s;   
  SPrintf( s, "%u", unpackLen(b) );
  return s;
}
/////////////////////////////////
struct
{
  char Magic[4];
  Assert(Magic=="BINd");

  uint Version;
  Assert(Version==7);

} BINdHeader;
/////////////////////////////////
struct str(int size)
{
  byte len;

  if(size!=-1)
  Assert((len/2)==size);
  //Printf("Expected: %u\n",size);
  //Printf("Read:     %u\n",len/2);

  char cstr[len/2];

  Printf("%s\n", cstr);
};
/////////////////////////////////
struct ChunkBit
{
  uint_p2 len;
union{
  byte bits[unpackLen(len)];
  struct {
    uint tag <format=hex>;
    if( (tag &0xFF) == 0x10 ) {
      str astr(-1);
    }
  } s;
} u;
};
/////////////////////////////////

union un
{
  byte a[8];

  struct
  {
    byte a, b, c, d;
    uint_p2 len;
  } b;
};

/////////////////////////////////
struct
{
  byte flags[4];
  uint_p2 len_first; // from this offset -> eof


  // first chunk
  uint_p2 len; // from this offset -> eof 
  byte unknown[4];
  byte cnt_2;

  local uint cnt = cnt_2/2;
  if( cnt > 0 ) {
    struct {
       un hdr;
       local uint max = unpackLen(hdr.b.len);
       local uint size = 0;
      struct {
         while(size<max) {
         ChunkBit cs;
         size += sizeof(cs);
         }
      } data;
      
    } chunk[cnt] <optimize=false>;
  }

} data;

/////////////////////////////////

Assert(FEof());

/////////////////////////////////

Re: Unreadable Game Data XMLs

Posted: Sun Oct 01, 2017 12:03 am
by ReedSteed
WRS wrote:What tools did you use to unpack the 'WAD's?
QuickBMS, using scripts I've found on this forum. I repack WAD's using a python shell written specifically for this game.

WRS wrote:Some of these other files like NIF are graphics files which would need converting to read..
I have opened the NIF's with NifSkope and it opens older versions just fine, but making any edits to the NIF either in hex or in NifSkope causes a game client crash upon entering the Marlybone Arena. (that post here: viewtopic.php?f=16&t=17074)
WRS wrote:Here, I've written a script which can parse all files.



Executing the script on the XML's provide me with data I still can't exactly understand! Can we define what each of these do so I can edit accordingly?

Re: Unreadable Game Data XMLs

Posted: Sun Mar 25, 2018 8:09 am
by Belloq
WRS wrote:Here, I've written a script which can parse all files. Not sure how to reconstruct them to xml yet! Check back later
Hi. Is there any chance you'd be so kind as to finish this? It would be really helpful for me and OP.
Thanks :)