Show HN: Ghidra Plays Mario

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • ghidra

    Ghidra is a software reverse engineering (SRE) framework

  • Nice, I'll give it a closer look. My only concern so far is memory hooking (still needed for hardware registers), which on Java side was called by FilteredMemoryState [1]. In memstate.cc it looks like just the simpler MemoryState is implemented [2], and there's no equivalent to MemoryAccessFilter. But it might not be that complicated to add...

    [1]: https://github.com/NationalSecurityAgency/ghidra/blob/4561e8...

    [2]: https://github.com/NationalSecurityAgency/ghidra/blob/4561e8...

  • ghidra-plays-mario

    Playing NES ROMs with Ghidra's PCode Emulator

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • ghidra-tlcs900h

    Ghidra processor module for Toshiba TLCS-900/H

  • I've been exploring new ways of testing Ghidra processor modules. In this repo, I was able to emulate NES ROMs in Ghidra to test its 6502 specification, which resulted in finding and fixing some bugs.

    Context: Ghidra is used for reverse engineering binary executables, complementing the usual disassembly view with function decompilation. Each supported architecture has a SLEIGH specification, which provides semantics for parsing and emulating instructions, not unlike the dispatch handlers you would find in interpreters written for console emulators.

    Emulator devs have long had extensive test ROMs for popular consoles, but Ghidra only provides CPU emulation, so it can't run them without additional setup. What I did here is bridge the gap: by modifying a console emulator to instead delegate CPU execution to Ghidra, we can now use these same ROMs to validate Ghidra processor modules.

    Previously [1], I went with a trace log diffing approach, where any hardware specific behaviour that affected CPU execution was also encoded in trace logs. However, it required writing hardware specific logic, and is still not complete. With the delegation approach, most of this effort is avoided, since it's easier to hook and delegate memory accesses.

    I plan on continuing research in this space and generalizing my approaches, since it shows potencial for complementing existing test coverage provided by pcodetest. If a simple architecture like 6502 had a few bugs, who knows how many are in more complex architectures! I wasn't able to find similar attempts (outside of diffing and coverage analysis from trace logs), please let me know if I missed something, and any suggestions for improvements.

    [1]: https://github.com/nevesnunes/ghidra-tlcs900h#emulation

  • switcher

    Gnome Shell extension to switch windows quickly by typing (by nevesnunes)

  • Looks like this one! https://github.com/nevesnunes/switcher

  • 6502_65C02_functional_tests

    Tests for all valid opcodes of the 6502 and 65C02 processor

  • Klaus Dormann's 6502 tests don't rely on a particular emulator environment. They could be used with Ghidra.

    https://github.com/Klaus2m5/6502_65C02_functional_tests

  • retro

    Retro Games in Gym

  • https://github.com/openai/retro:

    > Gym Retro lets you turn classic video games into Gym environments for reinforcement learning and comes with integrations for ~1000 games. It uses various emulators that support the Libretro API, making it fairly easy to add new emulators.

    .nes is listed in the supported ROM types:

  • Muzero-unplugged

    Pytorch Implementation of MuZero Unplugged for gym environment. This algorithm is capable of supporting a wide range of action and observation spaces, including both discrete and continuous variations.

  • https://github.com/DHDev0/Muzero-unplugged

    Gym is now gymnasium and it has support for additional Environments like Mujoco:

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • Gymnasium

    An API standard for single-agent reinforcement learning environments, with popular reference environments and related utilities (formerly Gym)

  • https://github.com/Farama-Foundation/Gymnasium#environments

    Farama-Foundatiom/MO-Gymnasiun:

  • MO-Gymnasium

    Multi-objective Gymnasium environments for reinforcement learning

  • "Multi-objective Gymnasium environments for reinforcement learning": https://github.com/Farama-Foundation/MO-Gymnasium

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts