Important information: this site is currently scheduled to go offline indefinitely by end of the year.
Scarlet Legacy compression
-
- M-M-M-Monster veteran
- Posts: 2382
- Joined: Sat Apr 09, 2011 1:22 am
- Has thanked: 170 times
- Been thanked: 307 times
Scarlet Legacy compression
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.
-
- Moderator
- Posts: 2602
- Joined: Sun May 18, 2008 3:01 pm
- Has thanked: 57 times
- Been thanked: 1422 times
Re: Scarlet Legacy compression
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.
but thats not needed for these files just run offzip on them and you get the decompressed files.
-
- M-M-M-Monster veteran
- Posts: 2382
- Joined: Sat Apr 09, 2011 1:22 am
- Has thanked: 170 times
- Been thanked: 307 times
Re: Scarlet Legacy compression
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.
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.
-
- Moderator
- Posts: 2602
- Joined: Sun May 18, 2008 3:01 pm
- Has thanked: 57 times
- Been thanked: 1422 times
Re: Scarlet Legacy compression
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
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
-
- n00b
- Posts: 11
- Joined: Sat May 12, 2012 7:23 pm
Re: Scarlet Legacy compression
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
# 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
-
- M-M-M-Monster veteran
- Posts: 2382
- Joined: Sat Apr 09, 2011 1:22 am
- Has thanked: 170 times
- Been thanked: 307 times
Re: Scarlet Legacy compression
The pkt files are just compressed textures.
How do you figure pkt contains models?
How do you figure pkt contains models?
-
- n00b
- Posts: 11
- Joined: Sat May 12, 2012 7:23 pm