OpenGMK / GM8Decompiler

A decompiler for GameMaker 8.x executables
GNU General Public License v2.0
149 stars 11 forks source link

Main Thread panicked at index out of bounds #21

Open nthometzki opened 1 year ago

nthometzki commented 1 year ago

Hey, I was trying to decompile a game (where I'm pretty sure it was made in GM8, but maybe it's GM7) and I'm getting this error:

WARNING: Failed to recover an icon: id 1, rva 0x25B374
thread 'main' panicked at 'index out of bounds: the len is 1059 but the index is 4294948444', C:\projects\gm8decompiler\gm8exe\src\upx.rs:139:25

At first, I thought this maybe happens because of obfuscation, but even with -d on it was still giving me the same error.

0x08088405 commented 1 year ago

It looks like the game in question uses UPX for packing the executable, which generally indicates some custom protection, as that's not part of the standard export. The index out of bounds suggests it's a negative number that's unaccounted for while trying to unpack it which isn't too surprising as the logic was originally based on disassembly, although it tends to work on GM8 games, so it's possible we're dealing with a GM7 game here.

Do you mind sharing a link to the game so we can take a look? Improving this part of the codebase is something we've been wanting to do for a while now and it'd be great to have some testcases.

nthometzki commented 1 year ago

The game is called Wanderlust: Rebirth and is technically only available on Steam. Anyway, I uploaded the files I have from Steam here: https://drive.google.com/file/d/1wa2rr4eSkY9irg0hfQCaZgjn1ngxU9cL/view?usp=share_link The executable is called "Wanderlust.exe". The other executables are launchers.

I also tried to decompile it with the GM7 Java decompiler. It gave me a 7MB .gm7 file, which sounds about right, but I can't open it in GM7. I don't even know why it's a .gm7 file, since GM7 only supported .gmk files. I always get the message, that the file is corrupted.