Page 1 of 1

BPE Compression (Needed)

Posted: Thu May 05, 2016 2:03 pm
by Racial
Hi everyone, i discovered this type of compression on some games. I go to readable section of process of windows, and found the uncompressed file. So ive got an example of compressed and uncompressed file.

Before the readable section i found a header of 38h bytes that can help to recognise format maybe i will upload here. In this header i see a dh..TBHS and maybe here its the key. Here a picture of this header.

Image

For that i know, compressed files start with
Sng Int of Uncompressed Size (swaped data)
Sng Int of Compressed Size (swaped data)
Type of compression (in all archives got FE 7F on start of it)

I attached the 2 files, compressed and uncompressed one (maybe it can take some bytes changed for be readable, but the size and 99.9% of bytes are ok)
Files C-U .zip

Re: TBHS compression?

Posted: Thu May 05, 2016 3:32 pm
by deepshit
The compression is byte pair encoding.
quickbms already supports it.
comp_bpe

And I tested it and it could decompress the example file.

Re: TBHS compression?

Posted: Thu May 05, 2016 3:49 pm
by Racial
Have you got the scripts for uncompress/compress?

If you cand send me ill be grateful

Thanks :)

Re: TBHS compression?

Posted: Thu May 05, 2016 7:52 pm
by deepshit

Re: TBHS compression?

Posted: Thu May 05, 2016 8:09 pm
by Racial
Good, thanks again. And sorry if im disturbing
But can you explain to me how you do it to uncompress the example?
I dont know how to use QuickBMS with those files that you give me in the link

What i need to do to uncompress the example and compress the other?

Re: TBHS compression?

Posted: Thu May 05, 2016 8:20 pm
by deepshit

Code: Select all

comtype bpe

get size long
get ZSIZE long

set NAME string "dump"
string NAME += ".dmp"
clog NAME 8 ZSIZE size
I think this should decompress it.
save this code on a txt file.
open quickbms.
select the txt file.
select the compressed data.
select output folder.
done

Re: TBHS compression?

Posted: Thu May 05, 2016 8:44 pm
by Racial
Perfect, it descompressed the file good. Thanks a lot. :)

What i need to do for compress it again?

I used reimport and put the edited file and the script that you give me, but it doesn't make a new file and tolds me and error in console