TheLegendOfMataNui / game-issues

The Legend of Mata Nui Gameplay Issues
12 stars 1 forks source link

Collecting more than 100 tokens causes a buffer overflow. #259

Closed lemoneleighty closed 5 years ago

lemoneleighty commented 5 years ago

Build: Rebuilt v1.0.0

Had finished all sidequests in Onu-Koro and had learnt the dance. After the 2nd chamber past the earthquake-symbol door (found in the giant shrine where Turaga Whenua resides), after destroying the four rahi spawn points and the rahi themselves, exited on the door to the left where crash initially occurred.

Attempting to go to the save slot selection screen results in repeated crashing.

Crash error window message: Unhandled exception: c0000005 At address: 65746233 Screen Shot 08-11-19 at 12 53 PM

Addendum by Vahkiti:

This seems to be the result of a buffer overflow in the game caused by a previously unknown hard limit of 100 tokens possible to be held in memory at a time. The address of this crash will vary depending on the amount of tokens over the limit that have been collected, as different things in RAM become overwritten the more token data you try to cram in there. The easiest way to reproduce this is to add 100 token entries to the save file, collect one in game, and then leave the area, OR add 101+ to your save file manually and load it. While the crash will vary depending on the token count, the address will remain the same as long as the tokens do as well.

Vahkiti commented 5 years ago

This issue is likely caused by collecting over 100 tokens in a level. We did not know that the game was hard-coded to a limit of this, and will be addressing it accordingly soon. In the meantime, you can just remove some of the token entries from your save file to get it to load back up again.

lemoneleighty commented 5 years ago

thanks for the help!

robot5431 commented 5 years ago

player0.txt

Save with 101 token crash.

epicabsol commented 5 years ago

Fixed by https://github.com/TheLegendOfMataNui/LOMNHook/commit/6af503145024a124daf2f7fe52d720653c5fe8ec, added to the game by https://github.com/TheLegendOfMataNui/LOMN-Beta/commit/fc988946539e5139d38ac0e8205fd3d13981341e