Saboteur .megapack Compressed Archive

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
Dan McCarthy
Posts: 9
Joined: Sat Sep 13, 2014 11:12 pm

Saboteur .megapack Compressed Archive

Post by Dan McCarthy »

Hey!
I have an archive from the 2009 game The Saboteur.

The megapack is the game's main data archive, but the file I have attached is drastically smaller and the same format:
https://dl.dropboxusercontent.com/u/362 ... 0.kiloPack

I was fortunate enough that a guy named Will Kirkby was able to write an extractor for this format already, but unfortunately the files are still compressed.
A few people have been able to claim that the archive is Zlib compressed, but all my attempts to decompress the files have failed.
I was hoping someone might be able to take a look and figure out how to decompress these files or potentially write an QuickBMS script that can both extract and decompress the archive. So in case this might be of assistance, here is the source and the compiled exe for the Extractor:
https://dl.dropboxusercontent.com/u/362 ... tractor.cs
https://dl.dropboxusercontent.com/u/362 ... ractor.exe

Thanks for reading,
Dan
Ekey
Posts: 1383
Joined: Sat Aug 09, 2014 2:34 pm

Re: Saboteur .megapack Compressed Archive

Post by Ekey »

Code: Select all

# Saboteur (kiloPack format)
#
# Written by Ekey (h4x0r)
#
# script for QuickBMS http://quickbms.aluigi.org

idstring "00PM"
get FILES long

for i = 0 < FILES
    get HASH longlong
    get SIZE long
    get OFFSET long
    get NULL long
    string NAME p= "%016X.bin" HASH
    log NAME OFFSET SIZE
next i
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Saboteur .megapack Compressed Archive

Post by aluigi »

I have just made a script available here:
http://aluigi.org/papers/bms/others/sab ... lopack.bms

Anyway I think that also the classical offzip was a good solution because those are considered resources and not real files and they are all compressed.
Dan McCarthy
Posts: 9
Joined: Sat Sep 13, 2014 11:12 pm

Re: Saboteur .megapack Compressed Archive

Post by Dan McCarthy »

Hey!
Both of you thank you so much for your assistance, I really appreciate it!

Aluigi, I can't thank you enough for taking your time for this, it works great! You've done me a major help!
I was wondering if you could consider aiding with a few things that directly involve this script.

This worked flawlessly with the Start0.kiloPack that I gave you, and it does work with a few others, but it has some issues with some other files of the same format:
All the kilopacks I've tried seemed fine, but the megapacks had the most trouble, I did get one to extract just fine though.



The games main megapacks, the main files I was interested in extracting don't seem to extract at all:
https://dl.dropboxusercontent.com/u/362 ... gapack.png (The file is rather large, so if you choose not to download it I don't blame you)
https://dl.dropboxusercontent.com/u/362 ... 2.megapack

The Mega1 and Mega2 both extracted 0 files, but the Mega0 had an issue where the files it extracted needed to be renamed, but eventually, one file claimed to be too large to be extracted due to spacial restrictions, but I should have more than sufficient space for anything it extracts.. I don't know if this is something that has to do with the script, it very well may be the archive at fault or something to do with me..
https://dl.dropboxusercontent.com/u/362 ... Mega01.png
https://dl.dropboxusercontent.com/u/362 ... Mega02.png (Honestly this file is even bigger than the last so if you can download it, fantastic, otherwise don't sweat it)
https://dl.dropboxusercontent.com/u/362 ... 0.megapack

The .megapack file used for the DLC doesn't extract properly and seems to have some sort of format inside that the rest don't, is there any chance you, or anyone else, might be able to look at that?
Here's what it says and the file I attempted to extract:
https://dl.dropboxusercontent.com/u/362 ... gapack.png
https://dl.dropboxusercontent.com/u/362 ... 0.megapack

Again, what has already been done has been a huge help for me, so if you or anyone else can get these others to work, that would be absolutely fantastic, but I very much appreciate the work done so far! Again, thank you both so much for your time!


Edit:
I had an idea, the megapacks are fairly large, but I thought it might be enough if I just send you one of the bins inside the megapack (the bins with the ALBS format)
https://dl.dropboxusercontent.com/u/362 ... 9FFD3D.bin
This is from Mega2.Megapack, one of the megapacks that simply wouldn't extract ANY files.
It seems to be a bit different from that of those in the kilopacks, but you might still need the full Mega2.megapack above to test the script..

Seems to be some AHSM block in the megapack that needs to be extracted? It seems to only show up in the megapacks and not the kilopacks.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Saboteur .megapack Compressed Archive

Post by aluigi »

I have not forgotten this topic, I will return on it later or tomorrow :)
Dan McCarthy
Posts: 9
Joined: Sat Sep 13, 2014 11:12 pm

Re: Saboteur .megapack Compressed Archive

Post by Dan McCarthy »

That's great news! I'm glad you're still interested in helping! :)
I have been looking at these files with the help of some others who know more than I do on the subject and they have been very helpful.
This 'AHSM' that has appeared in the megapacks seems also to be in the original Start0.kilopack, the easily smaller file.

His theory was that the files that have been currently extracted are bits of files that aren't the full files. He said the file might be internally organized and that the AHSM is likely part of the file. He was hoping to check this out and test the theory but he's going to be busy for the next few days.

This theory makes sense to me in that the files currently extracted appear to have some meaningful data that seems to start and stop very suddenly in the files. And further, while I had originally assumed that these we're parts of files that were supposed to be together, I decided maybe not because the folders seemed logical to support small index files that weren't big enough to be the actual data but to serve as showing the game what models each NPC uses. It would explain the huge amount of overlap files, but it wouldn't explain the data inside them which seem to be a bit more important than just serving as some form of marker.

It would also help explain why the game crashed when I replaced one of these files with another, ones that would seem rather inconqsequential, that the game would crash, since if the files aren't full, then the game wouldn't be replacing the real file with a functioning file. Of course, there's plenty of reasons why the game might crash after replacing, but it may support the theory that these files are a part of a bigger file.


Of course, at this point, it's merely a theory but I thought I should give this information to you ASAP if you were going to look into this further!
This may also explain why the megapacks and others outright did not extract anything.

Again, thank you for your time I really can't thank you enough for your support. :)
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Saboteur .megapack Compressed Archive

Post by aluigi »

I guess I understand what you mean, probably you refer to a compressed filesystem. Something similar to Worldshift.
I don't think that.

I checked the files you provided but I can't find a simple way to parse them and updating the script.

Too much effort for me, the best solution is offzip.
Dan McCarthy
Posts: 9
Joined: Sat Sep 13, 2014 11:12 pm

Re: Saboteur .megapack Compressed Archive

Post by Dan McCarthy »

Well that's fair enough. I know you mentioned before that offzip would have been a good alternative. I've attempted to use offzip a few times and seemed to not get much results. How might I use offzip for this purpose?

And can offzip get me through the 00PM, ALBS, and AHSM and any other files I might need to extract?
Obviously if Offzip can do this for me I'll have to put in as much time as I can to figuring out how to use it, but I'm not entirely sure where to start in this context.
Do you have any advice for me on this?
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Saboteur .megapack Compressed Archive

Post by aluigi »

Just basic offzip, it will dump many files:

Code: Select all

offzip -a file.megapack c:\output_folder 0
Dan McCarthy
Posts: 9
Joined: Sat Sep 13, 2014 11:12 pm

Re: Saboteur .megapack Compressed Archive

Post by Dan McCarthy »

Hey, thanks for the easy instructions. Wasn't an issue at all using offzip this time, but I'm curious what to do with these files. With the Ekey's script it extracts bin files with the ALBS header, with your script it goes through the ALBS files to multiple folders with files that have names but no file types.

These files have no names, but have no header seemingly either. It extracted well over 1000 files, they have 3 different file types: .dat, .tps, and .neo.
They don't exactly seem to match the files extracted by either scripts though might share some similar data content to the ones extracted by your script?

I was just hoping you might know better what exactly has been extracted by this and where I can go from there. I don't really know what these files are compared to the ones from the scripts.

Thanks
WhyFai
Posts: 1
Joined: Sat Aug 21, 2021 5:30 am

Re: Saboteur .megapack Compressed Archive

Post by WhyFai »

Hello! Could you please make a new link for these files