READ THE RULES: Click here

Follow us on Facebook: https://www.facebook.com/xentax/ :)

Scarlet Legacy compression

Read or post about compression. And decompression. Or ask questions how to decompress your files.
Post Reply
finale00
M-M-M-Monster veteran
M-M-M-Monster veteran
Posts: 2382
Joined: Sat Apr 09, 2011 1:22 am
Has thanked: 170 times
Been thanked: 295 times

Scarlet Legacy compression

Post by finale00 » Fri Aug 12, 2011 10:58 pm

The contents of this post was deleted because of possible forum rules violation.
Last edited by finale00 on Sat Aug 13, 2011 3:22 am, edited 2 times in total.

User avatar
chrrox
Moderator
Posts: 2552
Joined: Sun May 18, 2008 3:01 pm
Has thanked: 57 times
Been thanked: 1284 times

Re: Scarlet Legacy compression

Post by chrrox » Fri Aug 12, 2011 11:33 pm

looks like the header is xored with the alphabit or something like ABCDEFGHIJKLMNOPQRSTUVWXYZ
but thats not needed for these files just run offzip on them and you get the decompressed files.

finale00
M-M-M-Monster veteran
M-M-M-Monster veteran
Posts: 2382
Joined: Sat Apr 09, 2011 1:22 am
Has thanked: 170 times
Been thanked: 295 times

Re: Scarlet Legacy compression

Post by finale00 » Sat Aug 13, 2011 1:57 am

So I wrote a bms script for it
It replaces the original compressed file with the new one (with -o option), but right now it leaves the uncompressed size as the first 4 bytes for some reason. How can I modify this script so that will delete the leftover?

The uncompressed size was at the end, so maybe that's why it is included in the output? offzip also did the same.

Code: Select all

#scarlet legacy decompressor

goto 0x40
get name FILENAME
get filesize asize
math filesize -= 4
get csize long
savepos offset
goto filesize
get size long
clog name offset csize size
You do not have the required permissions to view the files attached to this post.

User avatar
chrrox
Moderator
Posts: 2552
Joined: Sun May 18, 2008 3:01 pm
Has thanked: 57 times
Been thanked: 1284 times

Re: Scarlet Legacy compression

Post by chrrox » Sat Aug 13, 2011 2:33 am

save it to a memory file first.
then just get the memory file size - 4 and log the file starting from the offset 4.



get name FILENAME
string name +.dec
goto -4
get size long
goto 0x40
get zsize long
clog MEMORY_FILE 0x44 zsize size
get size asize MEMORY_FILE
math size - 4
log name 4 size MEMORY_FILE

Antaler
ultra-n00b
Posts: 5
Joined: Fri Dec 02, 2011 1:46 am

Re: Scarlet Legacy compression

Post by Antaler » Fri Dec 02, 2011 4:39 pm

Work the script? :?:

Antaler
ultra-n00b
Posts: 5
Joined: Fri Dec 02, 2011 1:46 am

Re: Scarlet Legacy compression

Post by Antaler » Mon Dec 12, 2011 2:34 am

Nothing yet?

wimmeke001
n00b
Posts: 11
Joined: Sat May 12, 2012 7:23 pm

Re: Scarlet Legacy compression

Post by wimmeke001 » Fri Aug 24, 2012 8:08 am

qbmbs script unpack pak files

# Scarlet Legacy PAK files
# script for QuickBMS


idstring "PAK\0"
get ver byte
getdstring DUMMY 16
get headSize long

get cdOffset long
get cdSize long
get cdZSize long

get dataStart long
get dataSize long

get fileSize long

clog MEMORY_FILE cdOffset cdZSize cdSize

set base string ""

callfunction recursiveDir

cleanexit



startfunction recursiveDir

get subFils long MEMORY_FILE
get subDirs long MEMORY_FILE
get dirName string MEMORY_FILE

# quick fix for the initial dir

if dirName != "/"
string base += /
string base += dirName
endif

for subd = 0 < subDirs
callfunction recursiveDir
next subd

for subf = 0 < subFils
callfunction extractFile
next subf

endfunction


startfunction extractFile

get fileOffs long MEMORY_FILE
get fileSize long MEMORY_FILE
get fileName string MEMORY_FILE

math fileOffs += dataStart

set filePath string base
string filePath += /
string filePath += fileName

log filePath fileOffs fileSize

endfunction

how to get models out of the pkt files

finale00
M-M-M-Monster veteran
M-M-M-Monster veteran
Posts: 2382
Joined: Sat Apr 09, 2011 1:22 am
Has thanked: 170 times
Been thanked: 295 times

Re: Scarlet Legacy compression

Post by finale00 » Fri Aug 24, 2012 9:50 am

The pkt files are just compressed textures.
How do you figure pkt contains models?

wimmeke001
n00b
Posts: 11
Joined: Sat May 12, 2012 7:23 pm

Re: Scarlet Legacy compression

Post by wimmeke001 » Sat Aug 25, 2012 9:49 am

witch file have models xd

Post Reply