rofl0r / agsutils

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

soviet´unterzogersdorf extract / repack #11

Open gondur opened 4 years ago

gondur commented 4 years ago

Hi,

tried to depack the following abandond ags game & repack it for usage with the opensource AGS 3.5 editor.

Freeware files are from here: http://web.archive.org/web/20160328095603if_/http://monochrom.sil.at/suzoeg-s1-v1_0MrX-win-install.exe http://web.archive.org/web/20110706094544if_/http://monochrom.sil.at/monochrom-SUZ2--version1dot2.exe

environment win10 + ubuntu + your fixed binaries from december 27th after extracting the installer-exe, applied following for the second game, SUZ2 (first one behaves the same):

./agsex suz2prog.exe files obj ./agspack files suz2.agf

importing then into the AGS 3.5 editor fails with an import exception, instantly. Not sure if a bug or misusage?

(also playing with an older editor, AGS 2.72, which imported at least the dta from the files directory, was ultimately not successful, script are lost that way)

thanks for feedback on this issue

rofl0r commented 4 years ago

importing then into the AGS 3.5 editor fails with an import exception, instantly. Not sure if a bug or misusage?

not all files used by the editor are added to a game "pack" file. that means you cannot simply unpack a game and load it in the editor. what you can do is making changes to the resource files (e.g. change music, pictures, assembly code) and repack with agsutils. if you can unpack and repack a game with agsutils, and the resulting file can be played without issues with the engine, then everything works as intended.

gondur commented 4 years ago

Hello rofl0r, thanks for clarifying.

Is it possible to depack such binaries it in a way that opening & recompilation with the editor is possible?

It seems your tool can decompile also the scripts, the main script, all ressources etc - what is missing or needed to recreate a valid AGF project file or project folder?

rofl0r commented 4 years ago

It seems your tool can decompile also the scripts

no, it only disassembles the scripts. the result is assembly language, which is much more low-level than the AGS C dialect. it is sufficient to make simple bugfixes or changes to the code for a low-level programmer, but not for use with the editor. making a real decompiler is a huge task and i don't think it will happen. old versions of ags editor saved the original sourcecode for room files, which are automatically extraced and can be used with my ascc project (to recompile to binary), but even there the source code for the game scripts are missing.

what is missing or needed to recreate a valid AGF project file or project folder?

i didn't investigate it, but there's a lot of stuff in the game files that agsutils currently ignores. even if it would be possible, one would need a patched version of the ags editor that can invoke agsutils' assembler for use with the disassembled .s files in place of the of the original .asc files.

maybe @ivan-mogilko has some more insights into this.

gondur commented 4 years ago

Hello rofl0r, oh! thank you this makes sense... a full on decompiler is really next step complexity...

About this concrete game - is it maybe old enough that the source code is still included? Because i was able to open the cdt file directly with the 2.72 editor - there were then errors but still...

cheers and thank you for your work

rofl0r commented 4 years ago

About this concrete game - is it maybe old enough that the source code is still included?

if you find .c or .asc files in the script directory after agscriptxtract then the room files came with included source code, but you will still need the code for the gamescript(s)/globalscript, which is only available in assembly (.s) files. you might be able to write those scripts by hand by carefully studying what the .s files do, though.