Page 1 of 7

Castlevania: Lords of Shadow

Posted: Tue Sep 28, 2010 10:36 am
by chrrox
This is a bms script to extract the assets of Castlevania: Lords of Shadow
I tested this on the ps3 files.

Code: Select all


idstring BFPK
get version long
get files long
savepos TMP
for i = 0 < files
goto TMP
get NSIZE long
getdstring name NSIZE
get size long
get offset long
savepos TMP
goto offset
get zsize long
savepos OFFSET
if zsize == size
log name offset zsize
else
clog name offset zsize size
endif
goto TMP
next i


Re: Castlevania: Lords of Shadow

Posted: Thu Sep 30, 2010 7:49 am
by dogkarl
Great job! I wonder if it'll works on XBOX360 files.

Re: Castlevania: Lords of Shadow

Posted: Mon Oct 04, 2010 10:27 pm
by tommy
It doesn't work for X360 version, or maybe it only works for demo files?

I get error: incomplete input file number 0, can't read xxxxxxxx bytes.

However when used with -l parameters, it lists file list correctly, so it seem it doesn't extract data...

Re: Castlevania: Lords of Shadow

Posted: Mon Oct 04, 2010 10:49 pm
by WRS
there's a typo in the script.

change
log name ofset size
to

Code: Select all

log name offset size
?

Re: Castlevania: Lords of Shadow

Posted: Mon Oct 04, 2010 10:57 pm
by tommy
Well it actually works, but I get error when trying to extract Music.packed, first file has space in its file name. Could that be an issue? Data00 for example worked fine.

And change ofset to offset didn't work :)

EDIT: So English.packed didn't work either, and there was no space in filename....Hmm what could it be? quickbms -l parameter does however work for all files, including English.packed and Music.packed. But extracting works with Data00.packed, and I imagine with Data01.packed as well...

Here's verbose log:

Code: Select all

QuickBMS generic files extractor 0.4.7
by Luigi Auriemma
e-mail: aluigi@autistici.org
web:    aluigi.org

- open input file English.packed
- open script los.bms
READLINE 1   idstring BFPK
READLINE 2   get version long
             >set version (0) to version
READLINE 3   get files long
             >set files (1) to files
READLINE 4   savepos TMP
             >set TMP (2) to TMP
READLINE 5   for i = 0 < files
             >set i (3) to i
             >set 0 (4) to 0x00000000
             >set i (3) to i
             >set files (1) to files
READLINE 6   goto TMP
             >set TMP (2) to TMP
READLINE 7   get NSIZE long
             >set NSIZE (5) to NSIZE
READLINE 8   getdstring name NSIZE
             >set name (6) to name
             >set NSIZE (5) to NSIZE
READLINE 9   get size long
             >set size (7) to size
READLINE 10  get offset long
             >set offset (8) to offset
READLINE 11  savepos TMP
             >set TMP (2) to TMP
READLINE 12  goto offset
             >set offset (8) to offset
READLINE 13  get zsize long
             >set zsize (9) to zsize
READLINE 14  savepos OFFSET
             >set offset (8) to offset
READLINE 15  if zsize == size
             >set zsize (9) to zsize
             >set size (7) to size
READLINE 16  log name offset size
             >set name (6) to name
             >set offset (8) to offset
             >set size (7) to size
READLINE 17  else
READLINE 18  clog name offset zsize size
             >set name (6) to name
             >set offset (8) to offset
             >set zsize (9) to zsize
             >set size (7) to size
READLINE 19  endif
READLINE 20  goto TMP
             >set TMP (2) to TMP
READLINE 21  next i
             >set i (3) to i
- set output folder ./Test/

  offset   filesize   filename
------------------------------
             .start_bms start: -1 0 0

00000000 1   idstring BFPK

00000004 2   get version long
             >set version (0) to 0x00000000

00000008 3   get files long
             >set files (1) to 0x00000246

0000000c 4   savepos TMP
             >set TMP (2) to 0x0000000c
- variable i seems uninitialized, I use its name
             >get i (3) i
             >get 0 (4) 0x00000000
             >set i (3) to 0x00000000
             .start_bms start: 6 0 0

0000000c 5   for i = 0 < files
             >get i (3) 0x00000000
             >get files (1) 0x00000246
             condition < is met

0000000c 6   goto TMP
             >get TMP (2) 0x0000000c
             >get TMP (2) 0x0000000c

0000000c 7   get NSIZE long
             >set NSIZE (5) to 0x00000029

00000010 8   getdstring name NSIZE
             >get NSIZE (5) 0x00000029
             >set name (6) to sounds/voices/english/babba_off_msg_1.ogg

00000039 9   get size long
             >set size (7) to 0x000076f7

0000003d 10  get offset long
             >set offset (8) to 0x00008e17

00000041 11  savepos TMP
             >set TMP (2) to 0x00000041

00000041 12  goto offset
             >get offset (8) 0x00008e17
             >get offset (8) 0x00008e17

00008e17 13  get zsize long
             >set zsize (9) to 0x5367674f

00008e1b 14  savepos OFFSET
             >set offset (8) to 0x00008e1b

00008e1b 15  if zsize == size
             >get zsize (9) 0x5367674f
             >get size (7) 0x000076f7
             condition == is not met
             .start_bms start: 17 1 0
             .start_bms end: 17 1 0 (ret 18)
             .start_bms start: 19 0 0

00008e1b 18  clog name offset zsize size
             >get name (6) sounds/voices/english/babba_off_msg_1.ogg
             >get offset (8) 0x00008e1b
             >get zsize (9) 0x5367674f
             >get size (7) 0x000076f7
  00008e1b 30455      sounds/voices/english/babba_off_msg_1.ogg

Error: incomplete input file number 0, can't read 1362753026 bytes.
       anyway don't worry, it's possible that the BMS script has been written
       to exit in this way if it's reached the end of the archive so check it
       or contact its author or verify that all the files have been extracted


Note that if both the scripts and your files are correct then it's possible
that the script needs a newer version of QuickBMS, in which case download it:

  http://aluigi.org/quickbms

Re: Castlevania: Lords of Shadow

Posted: Tue Oct 05, 2010 3:16 am
by chrrox
it was a type just correct the one word offset it was a copy paste error.
i edited my first post try it now.

Re: Castlevania: Lords of Shadow

Posted: Tue Oct 05, 2010 3:24 am
by tommy
It still didn't work.

However this script did (took from Clive Barker's Jericho)

Code: Select all

ImpType Standard ;
Goto 8 0 ;
Get FNum Long 0 ;
For n = 1 to FNum ;
Get FNLen Long 0 ;
GetDString FN FNLen 0 ;
SavePos FOO 0 ;
Get FO Long 0 ;
SavePos FSO 0 ;
Get FS Long 0 ;
Log FN FS FO FSO FOO ;
Next n ;

Re: Castlevania: Lords of Shadow

Posted: Tue Oct 05, 2010 3:40 am
by chrrox
I don't have the full game only the one pac file they gave me glad to hear the other script worked tho.

Re: Castlevania: Lords of Shadow

Posted: Tue Oct 05, 2010 9:51 pm
by Gromber
┬┐and to create a new *.packed file? i want to join dvd1 and dvd 2 packages.

thanks for the scripts.

Re: Castlevania: Lords of Shadow

Posted: Sat Jan 01, 2011 1:47 pm
by viperxp
hello script helped me managed to unpack everything but I need to wrap it back again I tried to translate the lyrics, and now try whether it works

Re: Castlevania: Lords of Shadow

Posted: Wed Jun 22, 2011 6:50 am
by 3pacalypse
Please tell us how to pack it back again!

Re: Castlevania: Lords of Shadow

Posted: Thu Jun 23, 2011 7:40 pm
by michalss
That scrip it could be use also for repack, but there is 1 problem with filesize of some files. Bu they are exact the same size like it was just after extract:
Please help ?

Code: Select all

Error: file "language/english.txt"
       the reimport option acts as a reimporter and so you cannot reinsert a
       file if it's bigger than the original otherwise it will overwrite the
       rest of the archive:
         new size: 104229
         old size: 102588

EDIT : This is strange i have my file modded and it has 30KB less than the oringal and still telling me new file is bigger. Anyone seen this before ?

Re: Castlevania: Lords of Shadow

Posted: Fri Jun 24, 2011 7:23 am
by michalss
please anyone ???

Re: Castlevania: Lords of Shadow

Posted: Fri Jul 06, 2012 9:11 pm
by carnage
Guys I am having the same problem that michalss friend, when you import the file contents Data00.packed some files show the error message stating that the size is different from the original, but in my case these files are not edited, or are unique how can they be bigger?
Would fix this?

Code: Select all

Error: file "bmp\vsh\grafico2d\font.0585d3fd.x360.psb"
       the reimport option acts as a reimporter and so you cannot reinsert a
       file if it's bigger than the original otherwise it will overwrite the
       rest of the archive:
         new size: 141 (189)
         old size: 126 (189)

- do you want to skip this file? (y/N)
PS
File size English.txt was around 60 ~ 63KB larger than the original and was able to import successfully.

Re: Castlevania: Lords of Shadow

Posted: Thu Jan 31, 2013 11:11 am
by aluigi
I have written a script that should match the format at 100% (music.packed included):
http://aluigi.altervista.org/papers/bms ... evania.bms