Textures, recreate headers, conversions, algorithms and parsing of image files
Kono
Posts: 2 Joined: Sun Nov 28, 2021 11:50 am
Post
by Kono » Sun Nov 28, 2021 12:02 pm
I was just looking through some switch game, and I found a Renpy game. There is some graphic file in it, some seem to be compressed.
I can read the header, but I can't determine the compression algorithm. It's build as
Code: Select all
0x00 -> 0x04 = Unknown number, maybe magic number 0x04 -> 0x08 = Supposedly bit per color 0x08 -> 0x0C = height (1080p) 0x0C -> 0x0F = width (1920p)
After that there is a stream which seem to be compressed. I can't figure what is the compression algorithm as there is no magic number. I uploaded few sample images.
BG.zip
Thank you for your time !
Allen
Posts: 156 Joined: Tue Sep 01, 2015 9:44 am
Post
by Allen » Sun Nov 28, 2021 1:49 pm
They are double-layer LZ4 compression.
Code: Select all
# Renpy Switch Game # script for quickbms # by Allen comtype lz4 get magic long get bpp long get width long get height long get SIZE long get ZSIZE long get name basename string name + ".dcmp" savepos OFFSET log MEMORY_FILE 0 0 clog MEMORY_FILE OFFSET ZSIZE SIZE get SIZE long MEMORY_FILE get ZSIZE long MEMORY_FILE savepos OFFSET MEMORY_FILE clog name OFFSET ZSIZE SIZE MEMORY_FILE
Kono
Posts: 2 Joined: Sun Nov 28, 2021 11:50 am
Post
by Kono » Tue Nov 30, 2021 2:03 pm
Indeed, it works ! Thank you