Search
English

Memory Corruption Bug Discovered in Classic Game 'Infidel' and Analysis of Its Cause(blog.zarfhome.com)

startupxo Discuss

Writing language: KoreanRead in the original language

Plain summary

- The text-based game Infidel uses an array to store the player's traveled locations and dropped item information to track their position within the desert. - In the game's object saving function, when setting the array address as the default parameter, the code initializes it using a variable number (30) instead of directly referencing the global variable DESERT-TABLE (address 11129), causing data to be written to an incorrect memory area. - This results in overwriting of other memory data like program abbreviations instead of the array's intended space, leading to corrupted output messages or, in some cases, game crashes. - This issue existed identically in the Macintosh Infidel releases of 1983 and 1984, and was not detected by Infocom's debugging tools at the time. The fix involves explicitly assigning the global variable at the start of the function or specifying the array address during the call instead of relying on default parameters.

Read source ↗

Found on

Hacker News ↗ / 131 votes / 20 comments

Have you run into something like this? Tell us in a line or two what you did. You do not need to know the product.

Sign in to comment

Keyboard shortcuts

Choose a post with J and K or the arrow keys, then press Enter.

K ↑ / J ↓
Previous post / next post
Enter C
Open summary and comments for the selected post
O
Open the original link of the selected post
/
Search
?
Show this help
Tab
Move to the submit or comment button, then press Enter

Type normally in text fields. Tab and Enter are always available.