Sly 2 : Band of Thieves (E3 demo) WAL extractor and repacker

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
frogz2007
Posts: 118
Joined: Sun Dec 14, 2014 3:56 pm

Sly 2 : Band of Thieves (E3 demo) WAL extractor and repacker

Post by frogz2007 »

I am wondering if anybody could have a crack at a Sly 2 extractor and repacker? Apparently the file with the data has no header to it, so this could be hard.

Download:

https://www.dropbox.com/s/ym2i0h3oip9bh6f/SLY2.7z?dl=0

If this info here helps any, then here:

http://forum.xentax.com/viewtopic.php?f=21&t=12300
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Sly 2 : Band of Thieves (E3 demo) WAL extractor and repa

Post by aluigi »

http://aluigi.org/papers/bms/others/sly_wal.bms

Automatic key scanner plus reading of the WAC index and extraction of the WAL archive.
The decryption function is in pre-compiled code for faster performance (the decryption code in bms was too slow).
frogz2007
Posts: 118
Joined: Sun Dec 14, 2014 3:56 pm

Re: Sly 2 : Band of Thieves (E3 demo) WAL extractor and repa

Post by frogz2007 »

Hmm. I tried it on the Sly 2 demo, but the thing is this demo does not have the WAC file present for some reason. Is there a way to make it so just the WAL can be extracted/repacked?
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Sly 2 : Band of Thieves (E3 demo) WAL extractor and repa

Post by aluigi »

Thanks, I have fixed everything, included the error of decrypted the data file (only the information are encrypted).
Script 0.2.
frogz2007
Posts: 118
Joined: Sun Dec 14, 2014 3:56 pm

Re: Sly 2 : Band of Thieves (E3 demo) WAL extractor and repa

Post by frogz2007 »

How you do this stuff is beyond me. I thank you! :)

EDIT: I tried injecting a custom file in, and it gave me an error that says, " Last script line before the error or that produced the error: 111 log MEMORY_FILE 0 SIZE

Another one I get is, "Incomplete input file 0: SLY2.WAC
Can't read 8 bytes from offset 00000000
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Sly 2 : Band of Thieves (E3 demo) WAL extractor and repa

Post by aluigi »

I guess you didn't use reimport.bat correctly as explained in section 3 of quickbms.txt.
In this case there are no limitations or problems so the reimporting should work perfectly.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Sly 2 : Band of Thieves (E3 demo) WAL extractor and repa

Post by aluigi »

Edit: I'm checking it better, wait.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Sly 2 : Band of Thieves (E3 demo) WAL extractor and repa

Post by aluigi »

The problem seems related to quickbms when it tries to load the WAC file the first time.
I will check it when I will release the next version of quickbms.
In the meantime you can just remove the following lines and it will work:

Code: Select all

if DECRYPT_ONLY == 0
    get NAME filename
    open FDDE "WAC" 0 EXISTS
    if EXISTS == 0
        open FDSE NAME
    endif
endif
frogz2007
Posts: 118
Joined: Sun Dec 14, 2014 3:56 pm

Re: Sly 2 : Band of Thieves (E3 demo) WAL extractor and repa

Post by frogz2007 »

It works perfect! Thanks.
frogz2007
Posts: 118
Joined: Sun Dec 14, 2014 3:56 pm

Re: Sly 2 : Band of Thieves (E3 demo) WAL extractor and repa

Post by frogz2007 »

Hey, um, is there any way to create a script for the Jampack demo of Sly 1? The script unfortunately didn't work, so here is both the Sly.WAC and Sly.WAL files:

https://www.dropbox.com/s/jz92fre10ohdq ... es.7z?dl=0
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Sly 2 : Band of Thieves (E3 demo) WAL extractor and repa

Post by aluigi »

Fixed.
There was a padding of 4 bytes between names and offset/size that wasn't visible in the file on xentax.
frogz2007
Posts: 118
Joined: Sun Dec 14, 2014 3:56 pm

Re: Sly 2 : Band of Thieves (E3 demo) WAL extractor and repa

Post by frogz2007 »

Sorry to bother you again, but it now says, after extracting a few files, "It's not possible to create that file due to it's filename or related incompatibilities (for example already exists a folder with that name), so now you must choose a new filename for saving it."
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Sly 2 : Band of Thieves (E3 demo) WAL extractor and repa

Post by aluigi »

Some files contain a folder in their name and others have the folder as name, very strange.
Anyway I have modified the script to replace the folder delimiter with an underscore avoiding the problem.
brendan19
Posts: 144
Joined: Fri Aug 08, 2014 11:25 am

Re: Sly 2 : Band of Thieves (E3 demo) WAL extractor and repa

Post by brendan19 »

I tried this script on all three games from the Sly Cooper HD Collection from the PSN store and the script doesn't like the .WAL archive.

I also tried using the individual games available from the PSN store as well and it doesn't like those archives either.

I'm somewhat fairly sure that the individual games available from the PSN are in fact just the HD remasters and not the original SD games.

Here are some samples :)

Sly Cooper WAL Samples
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Sly 2 : Band of Thieves (E3 demo) WAL extractor and repa

Post by aluigi »

Very interesting, the format of some of the WAL archives is very strange.
I have updated the script to version 0.2.2.

Please let me know if you have problems like duplicated or invalid names (so if quickbms asks you something).
frogz2007
Posts: 118
Joined: Sun Dec 14, 2014 3:56 pm

Re: Sly 2 : Band of Thieves (E3 demo) WAL extractor and repa

Post by frogz2007 »

Hey. I think this is out of the question for right now, but all of the full, original PS2 versions have the files encrypted somehow. Say, for instance, the first game is 2 GB, but if you open the ISO, those WAL and WAC files are nowhere to be found.
brendan19
Posts: 144
Joined: Fri Aug 08, 2014 11:25 am

Re: Sly 2 : Band of Thieves (E3 demo) WAL extractor and repa

Post by brendan19 »

Reports from testing

PSN individual games:

Sly Cooper And the Thievius Raccoonus:
I ran into duplicate filenames but I told QuickBMS to just automatically rename any it found. Then I hit an error which halts the extraction.

Sly 2: Band of Thieves
QuickBMS extracts the archive with no errors

Sly 3: Honour Among Thieves
QuickBMS extracts the archive with no errors



PSN Sly Cooper HD Collection:

Sly Cooper And the Thievius Raccoonus HD
QuickBMS extracts the archive with no errors

Sly 2: Band of Thieves HD
QuickBMS extracts the archive with no errors

Sly 3: Honour Among Thieves HD
The Sly3.wal from the HD collection is split into two parts as the PS3 can only handle a max of 4GB files. I combined the two files and in a hex editor and then saved it as Sly3.wal. I used quickbms_4gb_files and QuickBMS extracted the archive with no errors


So it seems that the standalone version of Sly Cooper and the Thievius Raccoonus is the only game which still has an issue with the script.


Also just as a minor mention, is it at all possible during extraction, the files that are given an "M" filename are given their appropriate extention attached? (.XVAG)
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Sly 2 : Band of Thieves (E3 demo) WAL extractor and repa

Post by aluigi »

The duplicate name in Sly1 is ok, 'r' solves the problems.
But regarding the format I have no fixes because it's correct.
It looks like the archive is just one byte smaller than expected (?), can you try to add a 0x00 at its end and retry the extraction?
frogz2007
Posts: 118
Joined: Sun Dec 14, 2014 3:56 pm

Re: Sly 2 : Band of Thieves (E3 demo) WAL extractor and repa

Post by frogz2007 »

Hey, aluigi, I think this may be beyond your knowledge, but is there a way to get the WAL files out of the full games for PS2? They are not visible when the ISO is opened.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Sly 2 : Band of Thieves (E3 demo) WAL extractor and repa

Post by aluigi »

I don't have experience with PS2 ISO so there is not immediate much help I can offer about that.