Hello there aluigi, you made this BMS script for Just Dance 4 (the latest one in your website doesn't work for me so the script below works perfect) that lets us decompress bin archives of LyN Engine.
So fff02f6c_compressed is from Just Dance 4 game files. I use the BMS script and get fff02f6c_decompressed as a result. I wanna know if there is a way to compress fff02f6c_decompressed back to fff02f6c_compressed. I want it to be exactly same as original
I am asking this because I am trying to mod the game and the engine needs to read it compressed.
https://mega.nz/folder/KBx2VAoY#ZZ5rvKuiM5kcCozuCya42Q
Compressing LyN engine .bin file
-
- Site Admin
- Posts: 12984
- Joined: Wed Jul 30, 2014 9:32 pm
Re: Compressing LyN engine .bin file
Try the following for building the compressed file:
Code: Select all
comtype lzo1x_compress
math CHUNK_SIZE = 0x40000
math CHUNK_SIZE - 4
get FILE_SIZE asize
xmath CHUNKS "FILE_SIZE / CHUNK_SIZE"
if FILE_SIZE % CHUNK_SIZE
math CHUNKS + 1
endif
log MEMORY_FILE 0 0
put 1 long MEMORY_FILE
put CHUNKS long MEMORY_FILE
savepos CHUNKS_OFF MEMORY_FILE
for i = 0 < CHUNKS
put 0 long MEMORY_FILE
next i
append
for i = 0 < CHUNKS
savepos MEM_OFF MEMORY_FILE
math SIZE = CHUNK_SIZE
if SIZE > FILE_SIZE
math SIZE = FILE_SIZE
endif
savepos OFFSET
clog MEMORY_FILE OFFSET SIZE SIZE
goto SIZE 0 SEEK_CUR
math FILE_SIZE - SIZE
get TMP asize MEMORY_FILE
math TMP - MEM_OFF
math MEM_OFF - 4
putvarchr MEMORY_FILE CHUNKS_OFF TMP long
math CHUNKS_OFF + 4
next i
append
get TMP asize MEMORY_FILE
get NAME filename
string NAME + ".compressed"
log NAME 0 TMP MEMORY_FILE
-
- Posts: 25
- Joined: Sat Aug 18, 2018 3:22 pm
Re: Compressing LyN engine .bin file
Thank you, you're the best!
-
- Posts: 25
- Joined: Sat Aug 18, 2018 3:22 pm
Re: Compressing LyN engine .bin file
Hey aluigi, threw an error and crashed, the sizes of the original compressed bin and the one which was compressed with the BMS script you sent are not same. Their content are not identical, you are able to see strings in a hex editor in original compressed bin while you can't with the custom compressed one. They are not identical so the game does not know what to do
-
- Site Admin
- Posts: 12984
- Joined: Wed Jul 30, 2014 9:32 pm
Re: Compressing LyN engine .bin file
If you run the decompression script on the generated file it should work (I tested it).
The compressed file can't be the same of the original one because quickbms and the game use different lzo1x settings (not affecting the decompression), but I have no idea why the game crashes with the new one.
The compressed file can't be the same of the original one because quickbms and the game use different lzo1x settings (not affecting the decompression), but I have no idea why the game crashes with the new one.