Live data from Hacker News

Show HN: Tetris, but the blocks are ARM instructions that execute in the browser

ofrak.com

1–10 of 56 posts

Show HN: Tetris, but the blocks are ARM instructions that execute in the browser

#1
OFRAK Tetris is a project I started at work about two weeks ago. It's a web-based game that works on desktop and mobile. I made it for my company to bring to events like DEF CON, and to promote our binary analysis and patching framework called OFRAK.

In the game, 32-bit, little-endian ARM assembly instructions fall, and you can modify the operands before executing them on a CPU emulator. There are two segments mapped – one for instructions, and one for data (though both have read, write, and execute permissions). Your score is a four byte signed integer stored at the virtual address pointed to by the R12 register, and the goal is to use the instructions that fall to make the score value in memory as high as possible. When it's game over, you can download your game as an ELF to relive the glory in GDB on your favorite ARM device.

The CPU emulator is a version of Unicorn (https://www.unicorn-engine.org/) that has been cross-compiled to WebAssembly (https://alexaltea.github.io/unicorn.js/), so everything on the page runs in the browser without the need for any complicated infrastructure on the back end.

Since I've only been working on this for a short period of time leading up to its debut at DEF CON, there are still many more features I'd eventually like to implement. These include adding support for other ISAs besides ARM, adding an instruction reference manual, and lots of little cleanups, bug fixes, and adjustments.

My highest score is 509,644,979, but my average is about 131,378.

I look forward to feedback, bug reports, feature requests, and strategy discussions!

Show HN: Tetris, but the blocks are ARM instructions that execute in the browser
ofrak.com

Re: Show HN: Tetris, but the blocks are ARM instructions that execute in the browser

#3
This is really cool! So far I have a high score of 65612 :)

Some feedback:

- When opening the help menu, it wasn't obvious how to close it (I think the only way is by pressing '?')

- I like the Goblin music!

- It's a pretty nice interface to play with the instructions and I appreciate the color coding. It would be neat if there was a "sandbox mode" where you could preview the effects of running an instruction, and maybe modify your program once the game is over. I could see this being pretty useful for someone learning ARM assembly.

Re: Show HN: Tetris, but the blocks are ARM instructions that execute in the browser

#7

I'm computer literate (and know some basic assembly) but wow I did not get it

Hey, any specific questions? I'd be happy to explain anything that needs clarification.

More broadly, any thoughts on how to make the game clearer? I know that a manual describing the instructions would help. But other ideas are welcome as well!

Post reply on HN