Shaiya

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
CriticalError
Posts: 204
Joined: Thu Aug 14, 2014 8:52 pm

Shaiya

Post by CriticalError »

Hello guys, well here I back with this old game, but as I see the saf format change or something like that, because the bms script won't work anymore, any chance to support them? really grateful if can take a look into format, many thanks to all.

get EXTENSION extension
if EXTENSION != SAF
open FDDE SAF
endif
open FDDE SAH 1

idstring 1 "SAH\0"

goto 0x38 1
get FILES long 1
for i = 0 < FILES
get NAMESZ long 1
getdstring NAME NAMESZ 1
get OFFSET long 1
get SERO long 1
get SIZE long 1
get TIMESTAMP long 1
log NAME OFFSET SIZE
next i
get FOLDERS1 long 1

for i1 = 0 < FOLDERS1
get FOLDERSZ long 1
getdstring FOLDER1 FOLDERSZ 1
get FILES long 1
for j = 0 < FILES
get NAMESZ long 1
getdstring NAME NAMESZ 1
get OFFSET long 1
get SERO long 1
get SIZE long 1
get TIMESTAMP long 1

set FULLNAME string FOLDER1
string FULLNAME += \
string FULLNAME += NAME
log FULLNAME OFFSET SIZE
next j
get FOLDERS2 long 1

for i2 = 0 < FOLDERS2
get FOLDERSZ long 1
getdstring FOLDER2 FOLDERSZ 1
get FILES long 1
for j = 0 < FILES
get NAMESZ long 1
getdstring NAME NAMESZ 1
get OFFSET long 1
get SERO long 1
get SIZE long 1
get TIMESTAMP long 1

set FULLNAME string FOLDER1
string FULLNAME += \
string FULLNAME += FOLDER2
string FULLNAME += \
string FULLNAME += NAME
log FULLNAME OFFSET SIZE
next j
get FOLDERS3 long 1

for i3 = 0 < FOLDERS3
get FOLDERSZ long 1
getdstring FOLDER3 FOLDERSZ 1
get FILES long 1
for j = 0 < FILES
get NAMESZ long 1
getdstring NAME NAMESZ 1
get OFFSET long 1
get SERO long 1
get SIZE long 1
get TIMESTAMP long 1

set FULLNAME string FOLDER1
string FULLNAME += \
string FULLNAME += FOLDER2
string FULLNAME += \
string FULLNAME += FOLDER3
string FULLNAME += \
string FULLNAME += NAME
log FULLNAME OFFSET SIZE
next j
get FOLDERS4 long 1

for i4 = 0 < FOLDERS4
get FOLDERSZ long 1
getdstring FOLDER4 FOLDERSZ 1
get FILES long 1
for j = 0 < FILES
get NAMESZ long 1
getdstring NAME NAMESZ 1
get OFFSET long 1
get SERO long 1
get SIZE long 1
get TIMESTAMP long 1

set FULLNAME string FOLDER1
string FULLNAME += \
string FULLNAME += FOLDER2
string FULLNAME += \
string FULLNAME += FOLDER3
string FULLNAME += \
string FULLNAME += FOLDER4
string FULLNAME += \
string FULLNAME += NAME
log FULLNAME OFFSET SIZE
next j
get FOLDERS5 long 1

for i5 = 0 < FOLDERS5
get FOLDERSZ long 1
getdstring FOLDER5 FOLDERSZ 1
get FILES long 1
for j = 0 < FILES
get NAMESZ long 1
getdstring NAME NAMESZ 1
get OFFSET long 1
get SERO long 1
get SIZE long 1
get TIMESTAMP long 1

set FULLNAME string FOLDER1
string FULLNAME += \
string FULLNAME += FOLDER2
string FULLNAME += \
string FULLNAME += FOLDER3
string FULLNAME += \
string FULLNAME += FOLDER4
string FULLNAME += \
string FULLNAME += FOLDER5
string FULLNAME += \
string FULLNAME += NAME
log FULLNAME OFFSET SIZE
next j
get FOLDERS6 long 1

for i6 = 0 < FOLDERS6
get FOLDERSZ long 1
getdstring FOLDER6 FOLDERSZ 1
get FILES long 1
for j = 0 < FILES
get NAMESZ long 1
getdstring NAME NAMESZ 1
get OFFSET long 1
get SERO long 1
get SIZE long 1
get TIMESTAMP long 1

set FULLNAME string FOLDER1
string FULLNAME += \
string FULLNAME += FOLDER2
string FULLNAME += \
string FULLNAME += FOLDER3
string FULLNAME += \
string FULLNAME += FOLDER4
string FULLNAME += \
string FULLNAME += FOLDER5
string FULLNAME += \
string FULLNAME += FOLDER6
string FULLNAME += \
string FULLNAME += NAME
log FULLNAME OFFSET SIZE
next j
get FOLDERS7 long 1

for i7 = 0 < FOLDERS7
get FOLDERSZ long 1
getdstring FOLDER7 FOLDERSZ 1
get FILES long 1
for j = 0 < FILES
get NAMESZ long 1
getdstring NAME NAMESZ 1
get OFFSET long 1
get SERO long 1
get SIZE long 1
get TIMESTAMP long 1

set FULLNAME string FOLDER1
string FULLNAME += \
string FULLNAME += FOLDER2
string FULLNAME += \
string FULLNAME += FOLDER3
string FULLNAME += \
string FULLNAME += FOLDER4
string FULLNAME += \
string FULLNAME += FOLDER5
string FULLNAME += \
string FULLNAME += FOLDER6
string FULLNAME += \
string FULLNAME += FOLDER7
string FULLNAME += \
string FULLNAME += NAME
log FULLNAME OFFSET SIZE
next j
get FOLDERS8 long 1

for i8 = 0 < FOLDERS8
get FOLDERSZ long 1
getdstring FOLDER8 FOLDERSZ 1
get FILES long 1
for j = 0 < FILES
get NAMESZ long 1
getdstring NAME NAMESZ 1
get OFFSET long 1
get SERO long 1
get SIZE long 1
get TIMESTAMP long 1

set FULLNAME string FOLDER1
string FULLNAME += \
string FULLNAME += FOLDER2
string FULLNAME += \
string FULLNAME += FOLDER3
string FULLNAME += \
string FULLNAME += FOLDER4
string FULLNAME += \
string FULLNAME += FOLDER5
string FULLNAME += \
string FULLNAME += FOLDER6
string FULLNAME += \
string FULLNAME += FOLDER7
string FULLNAME += \
string FULLNAME += FOLDER8
string FULLNAME += \
string FULLNAME += NAME
log FULLNAME OFFSET SIZE
next j
get FOLDERS8 long 1
next i8

next i7

next i6

next i5

next i4

next i3

next i2

next i1

# not used, I guess they are files which have not been implemented in SAF
#get FILES long 1
#for i = 0 < FILES
# get NAMESZ long 1
# getdstring NAME NAMESZ 1
# get DUMMY long 1
# get DUMMY long 1
# get DUMMY long 1
# get DUMMY long 1
# log NAME OFFSET SIZE
#next i
#get FOLDERS1 long 1


https://cloud.mail.ru/public/3051ed16eb ... 0Sample.7z
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Shaiya

Post by aluigi »

You must provide also the SAH file.
CriticalError
Posts: 204
Joined: Thu Aug 14, 2014 8:52 pm

Re: Shaiya

Post by CriticalError »

aluigi wrote:You must provide also the SAH file.
ok here we go.

https://cloud.mail.ru/public/a28e4ea9e7 ... 0Sample.7z
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Shaiya

Post by aluigi »

I have rewritten my old script from scratch:
http://aluigi.org/papers/bms/others/shaiya.bms


Note for the curious: the reason why the old script was so ugly and long was the lack of the *function instruction in quickbms that allows to handle nested directories like those used in this archive, the script was really very old.
CriticalError
Posts: 204
Joined: Thu Aug 14, 2014 8:52 pm

Re: Shaiya

Post by CriticalError »

thank you very much for the update, I think the reason is for korean client, because I download this one and no english client, but anyway the files was unpacked now, thanks for all support aluigui, god bless you, have a nice day.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Shaiya

Post by aluigi »

Do you have the SAH file of the other clients?
If the script is not compatible with them I can fix it.
CriticalError
Posts: 204
Joined: Thu Aug 14, 2014 8:52 pm

Re: Shaiya

Post by CriticalError »

aluigi wrote:Do you have the SAH file of the other clients?
If the script is not compatible with them I can fix it.
yes I have English and Korean Client, and with new script work for 2 version, very good job Luigi, appreciate that.