Gh

Ghidra Plays Mario

Hacker News

Ghidra Plays Mario

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

Share card

Actual performance

207points
29comments
Made the leaderboard

Launch Intel predictions

Analyze your own launch →
Product HuntOn track for Day 1 leaderboard · Strong signals: new, context, code · Missing: mac, agents, macos
83%83% predicted probability of success on Product Hunt, based on ML models trained on real launch data.
best fitHighest predicted score across all platforms for this description.
Indie HackersFits the IH revenue-focused audience · Missing: supports, reddit linkedin, podcasting
75%75% predicted probability of success on Indie Hackers, based on ML models trained on real launch data.
Hacker NewsStrong engagement from HN community · Strong signals: exist, existing, ide · Missing: https docs, excited, just released
74%74% predicted probability of success on Hacker News, based on ML models trained on real launch data.
nativeThis product was originally launched on this platform.
AppSumoMay struggle as an AppSumo deal · Missing: plus, platform, intuitive
46%46% predicted probability of success on AppSumo, based on ML models trained on real launch data.
TrustMRRLess likely to generate early MRR · Strong signals: way · Missing: mobile apps, ios, personal
39%39% predicted probability of success on TrustMRR, based on ML models trained on real launch data.
Acquire.comPre-revenue stage for this audience · Missing: arr, mrr, revenue
13%13% predicted probability of success on Acquire.com, based on ML models trained on real launch data.
BetaListMay not resonate with beta-testers · Missing: web3, chat, crypto
0%0% predicted probability of success on BetaList, based on ML models trained on real launch data.

Correct prediction on native model

Similar products

Tw
Twitch Plays Doom79%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Twitch Plays Doom

Hacker News113
Tw
Twitch Plays 204858%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Twitch Plays 2048

Hacker News3
Yo
Yo Plays Flappy Bird52%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Yo Plays Flappy Bird

Hacker News9
Qu
Quinesnake – A quine that plays snake over its own source54%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Quinesnake – A quine that plays snake over its own source

Hacker News131
EQBase
EQBase30%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

EQ everything your Mac plays, without degrading it.

Indie Hackers1b2c
A
A Jewel Game That Plays Itself59%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

A Jewel Game That Plays Itself

Hacker News6
Co
Codex Plays NetHack55%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Codex Plays NetHack

Hacker News2
I
I Made Twitch Plays Magic: The Gathering55%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

I Made Twitch Plays Magic: The Gathering

Hacker News2
Sucketlink
Sucketlink32%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Get Spotify plays, Soundcloud Plays and Youtube Views

Indie Hackerscommitment-side-project
Tw
Twitter Plays Snake53%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Twitter Plays Snake

Hacker News5