Metroid Password Tools is a script for viewing and manipulating passwords in Metroid. Meant for use with Mesen and utilizes its Lua scripting feature.
With this tool, you can see every variable that goes into a Metroid password and manipulate them on-the-fly.
Run the script by opening Metroid inside of Mesen > Debug > Script Window > File > Open
Shows a real-time generated password for your current game. Creates passwords identically to how Metroid itself generates them, including the pseudo-encryption that utilizes the shift byte.
Freezes the password and prevents newly-generated passwords from overwriting it.
Only visible in-game.
Enters the current password on the Password screen.
Only visible outside of main game.
Shows a manipulatable overview of all memory used in the password generation process, including unused or unknown bits.
For the first 7 bytes, the memory represents whether or not Samus has obtained a specific item; behind-the-scenes the history of collected items in memory will be updated with your selections.
For the remainder of the bytes, the individual cells represent values in memory directly.
This view does not reflect the bits post-shift process, so the generated password will be right-bit-shifted the amount of times specified in the RNG bit.
For adding non-password related information to the Memory Pane, simply add an additional addressTableRow with the desired values.
The password generation code will not look at any address table rows past the ones required for password generation.
An example is included, a commented-out line that adds NARPASSWORD to the Memory Pane.
I would like to thank ZaneDubya for their work on MetroidMMC3. Without this excellent disassembly, I would never have been able to complete this project.
I would also like to thank John David Ratliff for his Metroid Password Format Guide.
This is my first project utilizing Mesen, Lua, 6500 assembly, or the inner workings of Metroid. It is entirely likely I got something wrong or did something inefficiently.
Feel free to open an issue or submit a pull request.