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.

???? - *.pak

Featured Replies

  • Author
  • Localization

Ekey, posted Mon Nov 03, 2014 11:45 am (1449)


Code:
    get ZSIZE long
    math ZSIZE &= 0x7FFFFFF

    if SIZE != ZSIZE
        clog "" OFFSET ZSIZE SIZE
    else
        log "" OFFSET SIZE
    endif


ps: First DWORD in entry it's hash from file name.

:)
  • Author
  • Localization

Ekey, posted Mon Nov 03, 2014 2:16 pm (1453)


I try make gui unpacker but decompression does not work for all files. Script does not work too. I guess large files are compressed by chunks? :?

Sample

Code:
  offset   filesize   filename
--------------------------------------
  0000beb1 4286       00000000.dat
  0000c68f 4286       00000001.dat
  01e687bf 9223160    00000002.dat

Error: the compressed UCL input is wrong or incomplete (-203)
Info:  offset where the compression failed: 01e687bf

Error: there is an error with the decompression
       the returned output size is negative (-1)
  • Author
  • Localization

aluigi, posted Mon Nov 03, 2014 3:12 pm (1455)


Ok, script updated.

The chunks are used if TYPE & 0x10.
Note that WXSJ Online used TYPE & 0x10 for the non-chunked compression so I guess it may not work with that game.

Anyway I have added a FORCE_WXSJ in case someone has problems with that (old?) game.
  • Author
  • Localization

Ekey, posted Mon Nov 03, 2014 3:53 pm (1457)


Viserion wrote:
Thanks Ekey and aluigi!

Have some problem with extensions and name:
http://i.imgur.com/4oBXHa2.png

Archives don't contain file names, only hashes.

Well ok. I resolve this problem. Game check it like this:

Code:
   dwCompType = dwZSize & 0xF0000000;

   if (dwCompType == 0x20000000)
   {
      //Single Data
      dwType = 1;
   }
   else if (dwCompType == 0x10000000)
   {
      //Compressed with chunks
      dwType = 2;
   }
   else
   {
      //Error
      dwType = -1;
   }


Now

Code:
struct UCLChunksHeader
{
   ucl_uint   dwChunksCount;
   ucl_uint   dwChunksTableOffset;
};

struct UCLChunksEntry
{
   ucl_uint   dwChunksOffset;
   ucl_uint   dwChunksSize;
   ucl_uint   dwChunksZSize; // &0x7FFFFFF
};


And it works perfect. I will share unpacker with detecting file names later. :)
  • Author
  • Localization

aluigi, posted Tue Nov 04, 2014 12:01 am (1461)


What is the crc algorithm used for the names?

My scanner wasn't able to get 0x7a051963 from "\script\achievement\achievement_client.lua".

I'm implementing a new feature in quickbms :)
  • Author
  • Localization

Ekey, posted Tue Nov 04, 2014 12:30 am (1462)


aluigi wrote:
My scanner wasn't able to get 0x7a051963 from "\script\achievement\achievement_client.lua".

It's valid hash from name. Here :)

Code:
int __cdecl mljh_get_FileNameHash(int pString)
{
  char pTemp;
  unsigned int dwHash;

  dwHash = 0;
  for (int i = 0; *(BYTE *)(i pString); i )
  {
    //tolower i guess? :]
    pTemp = *(BYTE *)(i pString);
    if ( pTemp 90 )
    {
      if ( pTemp == 47 )
        pTemp = 92;
    }
    else
    {
      pTemp = 32;
    }
    dwHash = -17 * (dwHash pTemp * (i 1)) % 0x8000000B;
  }
  return dwHash ^ 0x12345678;
 }
  • Author
  • Localization

aluigi, posted Tue Nov 04, 2014 12:49 am (1463)


Ok so it's a custom algorithm.
  • Author
  • Localization

aluigi, posted Tue Nov 04, 2014 1:02 pm (1471)


Do you have some "statistics" about the most used checksum algorithms used for names?

I have just finished to implement a NameCRC command in quickbms beta, it works perfectly and uses just the crc engine of quickbms, so it's highly customizable.
It pre-calculate the checksum on the original string, tolower, tolower \, skipping any \/: at the beginning, inverting all the \ in / and viceversa.

I want to understand how much useful it will be, in theory it's great :)
  • Author
  • Localization

Ekey, posted Tue Nov 04, 2014 4:26 pm (1483)


75% - CRC32 (also modified > tables)
50% - FNV1a
50% - StormHash (mostly used in Chinese's MMO's)
45% - Custom algorithms
35% - CRC64
10% - Jenkins
5% - sdbm (with 65599 constant)
5% - FNV64
1% - MD5 (yeah MD5) :D
  • Author
  • Localization

aluigi, posted Tue Nov 04, 2014 5:15 pm (1484)


Thanks.
Do you have examples of "Stormhash"?
I have found no references online.

Regarding the others, I'm improving the crc engine to support everything.
  • Author
  • Localization

Ekey, posted Tue Nov 04, 2014 5:54 pm (1487)


Stormhash it's from StormLib -> https://github.com/ladislav-zezula/StormLib

DWORD HashString(const char * szFileName, DWORD dwHashType)
DWORD HashStringSlash(const char * szFileName, DWORD dwHashType)
DWORD HashStringLower(const char * szFileName, DWORD dwHashType)

https://github.com/ladislav-zezula/Stor ... Common.cpp
  • Author
  • Localization

aluigi, posted Tue Nov 04, 2014 7:48 pm (1491)


Interesting.
HashString, decryptmpq, Huffman and Sparse are interesting stuff to implement in the next quickbms.

I remember that 0xeeeeeeee seen in some of your dumped functions on xentax, so I guess it's just decryptmpqblock used in various games.
  • Author
  • Localization

aluigi, posted Sat May 02, 2015 5:12 pm (4985)


The wxsj_online.bms script works.
  • Author
  • Localization

Viserion, posted Sat May 02, 2015 6:17 pm (4988)


.
Yes, but are random names. :/
  • Author
  • Localization

aluigi, posted Sat May 02, 2015 9:09 pm (4990)


Interesting.
All the files are perfect except the graphic data inside the dds that is not obfuscated in my opinion, but doesn't produce a valid image (all the headers are ok).

I have attached some dds in case someone wants to check them.
  • Author
  • Localization

Viserion, posted Sat May 02, 2015 9:48 pm (4992)


.
Aah, I'm only want unpack this game because images.
  • Author
  • Localization

aluigi, posted Sun May 03, 2015 7:04 am (4999)


I can only suggest you to post in the Graphics section with some samples, maybe someone who watches that section instead of this thread will notice it.
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.