rofl0r / agsutils

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

agscriptxtract: Segmentation fault when extracting #32

Closed morganwillcock closed 1 year ago

morganwillcock commented 1 year ago

Are there any versions of game data that aren't supported? Trying it out, it seems to crash when trying to extract the built-in script header:

(gdb) run
Starting program: /home/mwillcock/build/agsutils/agscriptxtract ..
disassembling [game28.dta] ./globalscript.o -> ./globalscript.s
regenerating script header ./builtinscriptheader.ash

Program received signal SIGSEGV, Segmentation fault.
0x000055555555702d in dump_header (a=0x7fffffffc2c0, 
    fn=0x7fffffffbfc0 "./builtinscriptheader.ash") at agscriptxtract.c:168
168     for(i=0; i<ADF_get_viewcount(a); ++i) if(ADF_get_viewname(a, i)[0])
rofl0r commented 1 year ago

theoretically all versions that are supported by the engine should work... what you're seeing is a crash in relatively new code that tries to recreate the builtin script header from information gathered during analysis, which isn't strictly necessary but a nice to have for reverse engineering projects. this part of the code isnt that well tested across a wide variety of game releases unfortunately. recently i added some commits that should detect errors and disable it automatically. i assume you built from git on linux ? and what's the game this is happening with ?

morganwillcock commented 1 year ago

i assume you built from git on linux ?

Yes. Built from the current state of the master branch.

and what's the game this is happening with ?

http://www.screen7.co.uk/games/download/poom_full.zip