Skip to content
View in the app

A better way to browse. Learn more.

ResHax

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Help us keep the site running.

Dogbyte Games "XPAK" Magic

Featured Replies

  • Author
  • Localization

squidiskool, posted Sat Mar 13, 2021 5:44 pm (62832)


Is there a way to extract these? I'm looking to extract the files from Dogbyte Games' games. On iOS, it comes in "XPK" file format. On android, it's an obb file. They have the magic of "XPAK". Hmm... I can't find anything about this file. I was able to extract using offzip but I don't know what to do with the extracted files afterwards.
Sample: (Offroad Legends, iOS) https://www.mediafire.com/file/4xi26ah3 ... a.xpk/file
  • Author
  • Localization

Ekey, posted Sat Mar 13, 2021 7:22 pm (62833)


Data is encrypted
  • Author
  • Localization

squidiskool, posted Sat Mar 13, 2021 7:31 pm (62834)


Oh. How do I decrypt it?
  • Author
  • Localization

Ekey, posted Sat Mar 13, 2021 8:12 pm (62835)


data xored by 0xAC54DF34 and compressed by Brotli

Image
  • Author
  • Localization

squidiskool, posted Sat Mar 13, 2021 8:55 pm (62836)


nice, what coding is that?
wtf me I posted that on "zenhax", home of quickbms.
are you still working on it?
  • Author
  • Localization

Ekey, posted Sat Mar 13, 2021 9:04 pm (62837)


Currently no. I'm busy with my main job .. I can look it in next weekends. Maybe someone else can take a look in more detail about this format
  • Author
  • Localization

Ekey, posted Sun Mar 14, 2021 7:24 pm (62850)


DEV INFO
So. There are 2 types of archives:

xor key > 0xAC54DF34 (2891243316u)

[HEADER V0 V1]
Code:
struct XPAKHeader
{
   uint32_t   dwMagic;
   uint32_t   dwVersion; // 0 / 1 (LZMA)
   uint32_t   dwArchiveSize;
   byte   lpMD5[16]; // only present in versions above 0
   byte   lpLZMAProps[5]; // 4 bytes xored
   uint32_t dwTableZSize; // compressed size of table (xored)
};


[TABLE V0 V1] (first dword is files count)
Code:
struct XPAKTable
{
   uint32_t   dwFileNameLength;
   byte   lpFileName[dwFileNameLength];
   uint32_t   dwFileZSize;
   byte   bFlag; // if value > 3 = data is compressed
};


[HEADER V2]
Code:
struct XPAKHeader
{
   uint32_t   dwMagic;
   uint32_t   dwVersion; // 2 (Brotli)
   uint32_t   dwArchiveSize;
   byte   lpMD5[16];
   uint32_t dwZero;
   uint32_t dwTableZSize; // compressed size of table (xored)
};


[TABLE V2] (first dword is files count)
Code:
struct XPAKTable
{
   uint32_t   dwFileNameLength;
   byte   lpFileName[dwFileNameLength];
   uint32_t   dwFileZSize;
   byte   bFlag; // flag & 0x40 != 0
};


[DECRYPTION]
Code:
void obfuscate(void *lpBuffer, int dwSize)
{
  signed int i; // r3@1
  int count; // r2@1 MAPDST

  i = 0;
  count = dwSize / 4;
  if ( count >= 4 )
    count = 4;
  while ( i < count )
  {
    i;
    *(DWORD *)lpBuffer ^= 0xAC54DF34;
    lpBuffer = (char *)lpBuffer 4;
  }
}


Edited: Done
  • Author
  • Localization

Ekey, posted Sun Mar 14, 2021 10:32 pm (62852)


Done. I must admit, I could not implement a script for QuickBMS so I made batch tool for unpack on C# :mrgreen:

Code:
[Usage]
    DB.XPAK.Unpacker


Code:
[Examples]
    DB.XPAK.Unpacker D:\main.33.com.dogbytegames.zombiesafari.obb D:\Unpacked


Supported V0, V1 and V2 archives. Unpack Only!

If someone needs a packer, then I attach the source code (yeah, I'm a lazy ass ?\_(?)_/? )
  • Author
  • Localization

squidiskool, posted Mon Mar 15, 2021 7:49 pm (62864)


Ekey wrote:
Done. I must admit, I could not implement a script for QuickBMS so I made batch tool for unpack on C# :mrgreen:

Code:
[Usage]
    DB.XPAK.Unpacker


Code:
[Examples]
    DB.XPAK.Unpacker D:\main.33.com.dogbytegames.zombiesafari.obb D:\Unpacked


Supported V1 and V2 archives. Unpack Only!

If someone needs a packer, then I attach the source code (yeah, I'm a lazy ass ?\_(?)_/? )

Thanks! Wow, a lot of info! Works great on Offroad Legends iOS. Found out the PNGs that are actually not PNGs, they're actually PVR textures. Here's an example of Rainbow.
Image
Edit: Would be amazing if I can convert the models. They come in two formats, H3D and GEO. The H3D file looks to be an XML of some sort. The GEO file is not ASCII, and it has the MAGIC of "H3DG".
Another edit: They appear to be Horde3D model files.
  • Author
  • Localization

Ekey, posted Mon Mar 15, 2021 7:58 pm (62865)


squidiskool wrote:
Thanks! Wow, a lot of info! Works great on Offroad Legends iOS.

Yup. Tool works on all the games from this company of those that I could find.
  • Author
  • Localization

squidiskool, posted Wed Mar 17, 2021 12:37 am (62880)


Ekey wrote:
squidiskool wrote:
Thanks! Wow, a lot of info! Works great on Offroad Legends iOS.

Yup. Tool works on all the games from this company of those that I could find.

ALERT! I'm trying to extract the XPK from version 1.0 of Offroad Legends but I get this:
[ERROR]: Unsupported version > 0 < of XPAK archive file!
Can you look into it ?
H e r e : https://www.mediafire.com/file/77rmb8xv ... 9.xpk/file
  • Author
  • Localization

squidiskool, posted Wed Mar 17, 2021 6:48 pm (62902)


Ekey wrote:
Added V0 type :)

Thanks, I was trying to get the old Wheely before it turned into a UAZ, for some reason.
  • Author
  • Localization

aluigi, posted Sun Mar 21, 2021 2:34 pm (62959)


Well done Ekey.

I tried to make a quickbms script based on the source code of the tool (good occasion to spot bugs in my quickbms beta):
http://aluigi.org/bms/dogbyte_xpk.bms
  • Author
  • Localization

squidiskool, posted Mon Mar 22, 2021 4:08 pm (62968)


aluigi wrote:
Well done Ekey.

I tried to make a quickbms script based on the source code of the tool (good occasion to spot bugs in my quickbms beta):
http://aluigi.org/bms/dogbyte_xpk.bms

That does the job well too.
  • Author
  • Localization

Karpati, posted Sat Apr 03, 2021 1:18 pm (63197)


squidiskool wrote:
Would be amazing if I can convert the models. They come in two formats, H3D and GEO. The H3D file looks to be an XML of some sort. The GEO file is not ASCII, and it has the MAGIC of "H3DG".
Another edit: They appear to be Horde3D model files.


I have finished my Horde3D Engine (v5;v6; Offroad Legends; Offroad Legends 2) *.GEO/*.SCENE.XML/*.MATERIAL.XML or *.GEO/*.H3D loader module and I have released the following programs as web updates:

- 3D Object Converter v7.047 (Windows)
- i3DConverter v3.905 (macOS)
- i3DConverter v1.905 (Linux)

How to get the 3D Object Converter v7.047:
Download the 3D Object Converter from http://3doc.i3dconverter.com and install it or download and use the portable version.
After it just use the Help/Check for updates... function to get the v7.047.

How to get the i3DConverter v3.905 macOS:
Download the i3DConverter from http://www.i3dconverter.com and install it.
After it just use the Help/Check for updates... function to get the v3.905.

How to get the i3DConverter v1.905 Linux:
Download the i3DConverter from http://www.i3dconverter.com and install it.
After it just use the Help/Check for updates... function to get the v1.905.
  • Author
  • Localization

LukeAndBobPro, posted Sun Jun 06, 2021 3:54 pm (64563)


Ekey wrote:
Added V0 type :)

Hey, I just downloaded the bin version of your software and I'm having a bit of a problem trying to extract the "data.xpk" file from the game, ya see every time I try to extract file, it doesn't seem to do anything, I mean I'm typing in the same command it tells me to type, am I missing a file or is it because I'm pressing the wrong buttons?
how do I use it?
  • Author
  • Localization

squidiskool, posted Wed Jun 23, 2021 11:33 pm (64869)


Ekey wrote:
Added V0 type :)

Need update, some png files that are extracted are corrupted and don't load :ugeek:
  • Author
  • Localization

squidiskool, posted Sat Aug 07, 2021 10:10 pm (65584)


??
  • Author
  • Localization

squidiskool, posted Sat Aug 07, 2021 10:16 pm (65585)


Hmm... When I compare between a working one and a corrupted one, it appears it has been encrypted. The corrupted one has a series of alphabet (sorry don't really know how to explain it)

Here's a link to one of the "corrupted" files:
https://drive.google.com/file/d/1ryzeua ... sp=sharing
  • Author
  • Localization

Ekey, posted Sat Aug 07, 2021 10:44 pm (65586)


What you mean? I do not see that this file has been damaged. Btw this is not PNG, it's a Targa (TGA) file.
  • Author
  • Localization

squidiskool, posted Sun Aug 08, 2021 6:02 pm (65622)


Ekey wrote:
What you mean? I do not see that this file has been damaged. Btw this is not PNG, it's a Targa (TGA) file.

Ah, thanks. Changed to TGA and it works. So it's basically a fake PNG.
  • Author
  • Localization

squidiskool, posted Sun Jan 23, 2022 2:24 am (69292)


CRAP!
New version of Off the road OBB is not loadable!!!

Gives me error:
Unhandled Exception: System.IO.IOException: I/O error occurred.
at DB.XPAK.Unpacker.Helpers.ReadBytes(Stream stream, Int32 count)
at DB.XPAK.Unpacker.Formats.Version2.iUnpack(BinaryReader TXPAKReader, String m_File, String m_DstFolder)
at DB.XPAK.Unpacker.Program.Main(String[] args)
Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.