Brave The Search for Spirit Dancer Demo

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
NPB1996
Posts: 7
Joined: Sat Apr 04, 2020 8:49 am

Brave The Search for Spirit Dancer Demo

Post by NPB1996 »

Hello there! I am new to the forums here but wanted some advice.
One day, I opened a .PAK file found on a demo disk for the game called Brave The Search for Spirit Dancer.
Obviously, it all came out with funny characters but I was surprised to find that I could see some text etc...

The problem I am having is extracting the .PAK file.

It comes with a .PAK and .TOC and the first 4 bytes of the .PAK are '...'.

The only part I can go off is that there is a 'GENERIC.PSH' but that could be relating to the game and not the PAK file.

I simply want to do this for fun and have no intention of re-uploading source code, this is simply for fun :)

Many thanks!
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Brave The Search for Spirit Dancer Demo

Post by aluigi »

Try to uplaod one of these PAK files.
If it's big it's enough to upload the two files generated by this script launched on the PAK file:
http://aluigi.org/bms/filecutter.bms
NPB1996
Posts: 7
Joined: Sat Apr 04, 2020 8:49 am

Re: Brave The Search for Spirit Dancer Demo

Post by NPB1996 »

Hello there! Thanks for getting back to this post! I tried that file cutter and it did not appear to work properly.

I now have two PAK files which have created from the BMS script. When looking at both of them, I could see from the file called 'DEFAULT.PAK_266139648_268236800'. When opening this file with Notepad ++ I see an output log which started like this:

---------------------------BEGINNING------------------------------

ng error loading package `%s' (%s) could not load package `%s' from path `%s' _REQUIREDNAME `_LOADED' is not a table _LOADED ?;?.lua LUA_PATH too many marks in a path component coroutine expected too many results to resume too many arguments to resume Lua function expected suspended dead running coroutine k __mode newproxy _VERSION _G boolean or proxy expected not enough memory memory allocation error: block too big bad argument #%d to `%s' (%s) calling `%s' on bad self (%s) method n %s expected, got %s %s:%d: Snl stack overflow (%s) value expected rb r @%s =stdin cannot read %s: %s %s
_ALERT Lua panic: throw (%d) with no error handler
stack overflow call C stack overflow error in error handling cannot resume non-suspended coroutine cannot resume dead coroutine cannot yield a C function attempt to yield across metamethod/C-call boundary ¬7E ¬<E  <E ˜<E <E ˆ<E |<E  <E t<E l<E `<E X<E P9E P<E H<E @<E 8<E 0<E (<E <E <E <E <E ü;E __call __concat __le __lt __unm __pow __div __mul __sub __add __eq __gc __newindex __index thread function table string number userdata boolean %.5g loop in gettable index loop in settable string size overflow `for' step must be a number `for' limit must be a number `for' initial value must be a number `__pow' (`^' operator) is not a function  % "] [string " ... invalid key for `next' table overflow table index is NaN table index is nil value for `lua_getinfo' is not a function =(tail call) tail global Lua main C =[C] field local attempt to %s a %s value attempt to %s %s `%s' (a %s value) concatenate perform arithmetic on attempt to compare %s with %s attempt to compare two %s values %s:%d: %s <AE 4AE 0AE (AE AE AE è7E AE |<E AE AE t?E ¬7E AE AE AE ø@E ð@E ð7E è@E à@E Ø@E Ô@E ´>E Ð@E Ì@E È@E Ä@E ¼@E ´@E ¬@E <eof> *string *number ~= <= >= == .. *name while until then return repeat or not in if for end elseif else do break and too many %s (limit=%d) %s:%d: %s near `%s' %c invalid control char char(%d) lines in a chunk malformed number ambiguous syntax (decimal point x string concatenation) unfinished long comment unfinished long string escape sequence too large unfinished string 
<eof> expected too many syntax levels `%s' expected (to close `%s' at line %d) `%s' expected `while' condition too complex items in a constructor <name> expected self local variables constant table overflow <name> or `...' expected arg parameters function arguments expected ambiguous syntax (function call x new statement) unexpected symbol upvalues `=' or `in' expected (for step) (for limit) (for state) (for generator) syntax error no loop to break binary string bad code in %s unexpected end of file in %s bad integer in %s bad nupvalues in %s: read %d; expected %d bad constant type (%d) in %s unknown number format in %s A OP Instruction size_t int %s too old: read version %d.%d; expected at least %d.%d %s too new: read version %d.%d; expected at most %d.%d bad signature in %s virtual machine mismatch in %s: size of %s is %d but read %d $a $ a4A  488888$$4˜˜˜¤ € !       control structure too long function or expression too complex code size overflow i386\chkesp.c The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention. printf.c format != NULL Client Ignore CRT Normal Free Error: memory allocation: bad memory block type.
Invalid allocation size: %u bytes.
Client hook allocation failure.
Client hook allocation failure at file %hs line %d.
dbgheap.c _CrtCheckMemory() _pFirstBlock == pOldBlock _pLastBlock == pOldBlock fRealloc || (!fRealloc && pNewBlock == pOldBlock) _BLOCK_TYPE(pOldBlock->nBlockUse)==_BLOCK_TYPE(nBlockUse) pOldBlock->nLine == IGNORE_LINE && pOldBlock->lRequest == IGNORE_REQ _CrtIsValidHeapPointer(pUserData) Allocation too large or negative: %u bytes.
Client hook re-allocation failure.
Client hook re-allocation failure at file %hs line %d.
_pFirstBlock == pHead _pLastBlock == pHead pHead->nBlockUse == nBlockUse pHead->nLine == IGNORE_LINE && pHead->lRequest == IGNORE_REQ DAMAGE: after %hs block (#%d) at 0x%08X.
DAMAGE: before %hs block (#%d) at 0x%08X.
_BLOCK_TYPE_IS_VALID(pHead->nBlockUse) Client hook free failure.
memory check error at 0x%08X = 0x%02X, should be 0x%02X.
%hs located at 0x%08X is %u bytes long.
%hs allocated at file %hs(%d).
DAMAGE: on top of Free block at 0x%08X.
DAMAGED _heapchk fails with unknown return value!
_heapchk fails with _HEAPBADPTR.
_heapchk fails with _HEAPBADEND.
_heapchk fails with _HEAPBADNODE.
_heapchk fails with _HEAPBADBEGIN.
Bad memory block found at 0x%08X.
_CrtMemCheckPoint: NULL state pointer.
_CrtMemDifference: NULL state pointer.
Object dump complete.
crt block at 0x%08X, subtype %x, %u bytes long.
normal block at 0x%08X, %u bytes long.
client block at 0x%08X, subtype %x, %u bytes long.
{%ld} %hs(%d) : #File Error#(%d) : Dumping objects ->
Data: <%s> %s
%.2X Detected memory leaks!
Total allocations: %ld bytes.
Largest number used: %ld bytes.
%ld bytes in %ld %hs Blocks.
fclose.c str != NULL *mode != _T('\0') mode != NULL *file != _T('\0') fopen.c file != NULL ÿÿÿÿ(B CB stream != NULL fputs.c string != NULL _file.c sprintf.c ungetc.c _filbuf.c fprintf.c Assertion Failed Error Warning %s(%d) : %s
Assertion failed! Assertion failed: _CrtDbgReport: String too long or IO Error Second Chance Assertion Failed: File %s, Line %d
wsprintfA user32.dll Microsoft Visual C++ Debug Library Debug %s!

Program: %s%s%s%s%s%s%s%s%s%s%s

(Press Retry to debug the application)
Module:
File:
Line:

Expression:

For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts. <program name unknown> dbgrpt.c szUserMessage != NULL ð?IsProcessorFeaturePresent KERNEL32 e+000 ÿÿÿÿ¶)B ¼)B ÿÿÿÿ¬*B ²*B _sftbuf.c flag == 0 || flag == 1      EEE50 P (8PX 700WP  `h```` ppxxxx      ( n u l l ) (null) output.c ch != _T('\0') __GLOBAL_HEAP_SELECTED __MSVCRT_HEAP_SELECT _freebuf.c ("inconsistent IOB fields", stream->_ptr - stream->_base >= 0) _flsbuf.c _open.c filename != NULL stream.c stdenvp.c stdargv.c a_env.c ioinit.c runtime error
TLOSS error
SING error
DOMAIN error
R6028
- unable to initialize heap
R6027
- not enough space for lowio initialization
R6026
- not enough space for stdio initialization
R6025
- pure virtual function call
R6024
- not enough space for _onexit/atexit table
R6019
- unable to open console device
R6018
- unexpected heap error
R6017
- unexpected multithread lock error
R6016
- not enough space for thread data

abnormal program termination
R6009
- not enough space for environment
R6008
- not enough space for arguments
R6002
- floating point not loaded
Microsoft Visual C++ Runtime Library Runtime Error!

------------------------END-------------------------------------


The original DEFAULT.PAK file is 255mb and would not be wise for me to upload (very slow connection here!)

If you have a copy of the Official PS2 Magazine Demo 60 disc (PAL) Brave is on there.

If it's of no use, then I will keep exploring. I think the ultimate question is how to find the PAKS magic code thing?

Many thanks!
NPB1996
Posts: 7
Joined: Sat Apr 04, 2020 8:49 am

Re: Brave The Search for Spirit Dancer Demo

Post by NPB1996 »

However, if you want me to try uploading the .PAK, I can.

Would you need the .TOC file too?

Best regards,
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Brave The Search for Spirit Dancer Demo

Post by aluigi »

Please upload DEFAULT.PAK_0_268236800 and the TOC file.
NPB1996
Posts: 7
Joined: Sat Apr 04, 2020 8:49 am

Re: Brave The Search for Spirit Dancer Demo

Post by NPB1996 »

No problem! Please find the attached file!

Contents:

* DEFAULT.PAK_0_268236800.PAK
* DEFAULT.PAK_266139648_268236800
* DEFAULT.TOC
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Brave The Search for Spirit Dancer Demo

Post by aluigi »

NPB1996
Posts: 7
Joined: Sat Apr 04, 2020 8:49 am

Re: Brave The Search for Spirit Dancer Demo

Post by NPB1996 »

OMG! That is so awesome!

You make it seem so easy! Thank you so much!

Now, would I simply be able to re-pak the file with the reimport script?

Thanks again! :D
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Brave The Search for Spirit Dancer Demo

Post by aluigi »

Yes, reimport2.bat should work correctly, reimport.bat for sure.
NPB1996
Posts: 7
Joined: Sat Apr 04, 2020 8:49 am

Re: Brave The Search for Spirit Dancer Demo

Post by NPB1996 »

Okay! So I just tried to re-pak the extracted pak but I get the following error.

(Steps I am doing - In case I am doing something wrong)

1. I opened reimport.bat
2. I then selected 'brave_ftoc.bms'
3. I select the folder where I extracted the PAK file.
4. I then put a * for the whole folder and subfolders.
5. Choose a location to save the file
6. I then get this message from CMD window:

---------------START------------------------------
- filter string: "*"
*
- filter 1: *
- start the scanning of the input folder: E:\PAK\BRAVE\EXTRACT
- open input file E:\PAK\BRAVE\EXTRACT\.\AUDIO\GENERIC\GENERIC.PSH
- open script C:\Users\Nick\Desktop\brave_ftoc.bms
- set output folder E:\PAK\RE-PAK

offset filesize filename
--------------------------------------
- enter in folder E:\PAK\BRAVE\EXTRACT
coverage file 0 0% 0 22828 . offset 00000000
- open input file E:\PAK\BRAVE\EXTRACT\AUDIO\GENERIC\GENERIC.toc

- error in src\file.c line 533: fdnum_open()
Error: No such file or directory

Last script line before the error or that produced the error:
3 open FDDE "toc"

Press ENTER or close the window to quit

-------------------END----------------------------

I have tried to select separate files in case of a certain file causing the problem.

Is that error related to the script or am I doing something wrong?

Thanks again!
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Brave The Search for Spirit Dancer Demo

Post by aluigi »

There is only one rule for using reimporting:
select the same files and folders you selected during extraction... same.
NPB1996
Posts: 7
Joined: Sat Apr 04, 2020 8:49 am

Re: Brave The Search for Spirit Dancer Demo

Post by NPB1996 »

Okay I got it now! I was not selecting the .PAK file!

Thanks for all your help! *Beer* :D