rofl0r / agsutils

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

agscriptxtract: extraction is case sensitive #33

Closed morganwillcock closed 1 year ago

morganwillcock commented 1 year ago

Script extraction is skipped when the file extraction produces file names with upper case characters:

agsutils/agstract game/Game.exe game_ex
cd game_ex
mkdir OBJ

(cd OBJ && ../../agsutils/agscriptxtract ..) | wc -l
# => 71

## Ensure all crm files have lower case names
find . -iname "*.crm" -exec /bin/sh -c 'mv -v {} $(echo {} | tr [A-Z] [a-z])' \; | wc -l
# => 80

(cd OBJ && ../../agsutils/agscriptxtract ..) | wc -l
# => 229
rofl0r commented 1 year ago

are you saying the issue is only *.crm files are processed, but not *.CRM ?

morganwillcock commented 1 year ago

The issue isn't just with the file extension, it is looking for "room" as a prefix.

## Rename all .CRM file extensions to .crm
for f in *.CRM; do mv $f ${f%.CRM}.crm; done
(cd OBJ && ../../agsutils/agscriptxtract ..) | wc -l
# => 71

## Ensure all crm files have lower case base names
for f in *.crm; do mv $f $(echo $f | tr '[A-Z]' '[a-z]'); done
(cd OBJ && ../../agsutils/agscriptxtract ..) | wc -l
# => 229

e.g. it processes "room1.crm" but does not process "ROOM1.CRM" or "ROOM1.crm".

Edit: I also have an "INTRO.CRM" file which is not extracted. So presumably there is an additional problem when the room files were originally renamed and the "room" (or "ROOM") prefix was removed entirely.

rofl0r commented 1 year ago

alright. would you mind uploading a testcase "game" that has something with .CRM ext, something with ROOMxx.crm, and INTRO.CRM or alternatively test whether this patch http://ix.io/4ff3 fixes the issue ?

rofl0r commented 1 year ago

i noticed that perils of poom uses room files in uppercase and am reasonably certain my patch properly fixes this issue, if not, please reopen.