rofl0r / agsutils

contains utils for AGS: game extractor, repacker, disassembler and assembler
44 stars 14 forks source link

Support for extracting old AGS versions? #34

Closed clbr closed 1 year ago

clbr commented 1 year ago

Which versions are currently supported? I'm trying to extract an older AGS game (5 days a stranger), but agstract says

error: ags clib header signature not found

However the hex dump of the exe shows it has some CLIB markers.

clbr commented 1 year ago

When I hardcode the location of the CLIB marker, agstract successfully extracts things. The tail address is 0x7a800, but the marker is at 0x115000. Maybe some quirk of the old AGS.

rofl0r commented 1 year ago

it should be able to extract all ags versions supported by the open source engine (iirc 2.5+), if it doesn't then that's a bug. can you provide a direct download link to the game ?

rofl0r commented 1 year ago

i just downloaded http://www.clawofcat.com/yahtzee/5days13.zip from ben creshaw's homepage, and it extracted just fine without any issue. are you using a different release, and did you use the win32 build of agsutils ?

clbr commented 1 year ago

The site I downloaded it from is no longer in my history, and I can't find it now (but it wasn't a direct link like that). However the readme says it's 1.3. The un-upx'd 5days.exe has this md5sum:

5f72895320e68bf6e26d9cb332f8d8ac

I've uploaded a zipped copy to https://anonfiles.com/i1N9G913ze/5days_zip for your testing. It's entirely possible this game is AGS 2.3 or some other old version.

I'm on Linux, I compiled agsutils.

clbr commented 1 year ago

Oh. It could be they applied upx to the stub before catting, not after, in which case it shouldn't have been un-upxed before passing to agstract.

rofl0r commented 1 year ago

the file you provided has the proper end signature "CLIB\x01\x02\x03\x04SIGE", and the 4 bytes prior to that should contain the offset of the header, which again should contain "CLIB", but the offset is wrong. this could indeed be the result of improper use of upx (either compressing or uncompressing the entire file, not just the stub). as far as i know the use of the end signature has been there since very very early version, in order not to have to scan the entire file for the header signature (which was probably quite slow in DOS days). even though we could theoretically scan for the signature in this case, given that the file is corrupt there's a high probability that the other data would be corrupt or compressed too, so i doubt whether it makes sense implementing it.

clbr commented 1 year ago

Could you add the version info to the README? I think that's enough to close this issue.

rofl0r commented 1 year ago

0b626a9