sk-zk / Extractor

cross-platform .scs extractor
GNU General Public License v2.0
20 stars 2 forks source link

Files with headers damaged #1

Closed NautilusMaster closed 11 months ago

NautilusMaster commented 11 months ago

Would it be possible to add a function to the program to read external headers? I have some scs files that have a damaged header and I would like to place an external file with the list of known directories.

sk-zk commented 11 months ago

Could you send me some sample files?

NautilusMaster commented 11 months ago

https://www.mediafire.com/folder/md3ejq4u5sqjq/SCS+Files I attached 3 scs files, the file called "Peterbilt.scs" is the one with the strangest format and the program cannot read it. The others can be extracted but only in raw

sk-zk commented 11 months ago

To extract known directories or files, even when most directory listings are missing, use the -p flag, e.g. -p=/def. To make this easier, I've also upgraded this parameter to accept a list of paths, e.g. -p=/pisc/volvo_2022/acc/acabamento/acabamento_1.pmd,/pisc/volvo_2022/acc/adesivo/adesivo_1.pmd,(and so on). There was also a bug with Windows-style line endings which might have been causing issues.


As for Peterbilt.sii, I'm sure it just has a corrupt header, but in case it's intentional somehow, I've added some stuff to accommodate it.

The header claims that the entry headers are at offset 4096, but in reality, they're at the end of the file. I've added the flag --headers-at-end to deal with this.

Further, the header also claims that the salt is 0. However, a quick brute force with a known path reveals that it is in fact 7. To deal with this, I've added a --salt parameter to force a custom salt.

With all this in place, we can now try to get some stuff out of that archive even without raw mode, e.g.: extractor Peterbilt.scs -p=manifest.sii,mod_description.txt,/def/vehicle --headers-at-end --salt=7

NautilusMaster commented 11 months ago

It worked very well, I only had a small problem using "-p" with a very long list of directories because CMD/PowerShell has a character limit. Do you think there would be a way for the program to read a .txt file with the list of directories? If it's complicated or unfeasible, that's okay, it's a problem I created for myself hahahaha.

Thank you in advance for your commitment to your program, and if you can find any way to donate to maintain the project, I would be happy to help you.

sk-zk commented 11 months ago

Do you think there would be a way for the program to read a .txt file with the list of directories?

Sure, no problem. You can now pass your list with --paths.