ZenHAX

Free Game Research Forum | Official QuickBMS support | twitter @zenhax | SSL HTTPS://zenhax.com
It is currently Mon Dec 10, 2018 4:45 am

All times are UTC




Post new topic  Reply to topic  [ 2 posts ] 
Author Message
 Post subject: LZSS? Compression
PostPosted: Thu Aug 16, 2018 3:14 am 

Joined: Thu Aug 16, 2018 2:59 am
Posts: 1
I have decompressed this TIM file of a PS1 game by using the game's ASM code, but I need to re-compress it now.

It seems to be a LZSS-like compression. 1st byte is 0x01, the next 4 bytes are the final size, the rest is the compressed data, with 2-byte flags to declare literal and compressed. Compressed bytes are 16-bit too: 5 bits for length (plus 3) and 11 bits for distance (plus 1).

See the attached files for compressed and uncompressed files.

This is what I've tried without success:
Code:
comtype lzss "11 5 2 2 0"
IDString "\x01"
get SIZE long
savepos OFFSET
get ZSIZE asize
math ZSIZE - OFFSET
clog test OFFSET ZSIZE SIZE


Any help would be infinitely appreciated!


Attachments:
File comment: Decompressed file
font_decoded.bin [26.06 KiB]
Downloaded 12 times
File comment: Compressed file
font_encoded.bin [12.94 KiB]
Downloaded 14 times
Top
   
 Post subject: Re: LZSS? Compression
PostPosted: Tue Aug 21, 2018 3:20 am 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 9414
Code:
log MEMORY_FILE 0 0
put 0x01 byte MEMORY_FILE
get SIZE asize
put SIZE long MEMORY_FILE
append
comtype lzss_compress "11 5 2 2 0"
clog MEMORY_FILE 0 SIZE SIZE
append
get SIZE asize MEMORY_FILE
log "new_file.dat" 0 SIZE MEMORY_FILE


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 2 posts ] 

All times are UTC


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Limited