Lurker News
I made this game to teach my daughter how buffer overflows work. I want her to look at programs as things she can change, and make them do whatever she wants.

Building your exploit in memory and jumping to it feels so cool. I hope this game teaches kids and programmers (who seem to have forgotten what computers actually are) that its quite fun to mess with programs. We used to have that excitement few years ago, just break into softice and change a branch into a nop and ignore the serial number check, or go to a different game level because this one is too annoying.
While working on the game I kept thinking what we have lost from 6502 to Apple Silicon, and the transition from 'personal computers' to 'you are completely not responsible for most the code running on your device', it made me a bit sad and happy in the same time, RISCV seems like a breath of fresh air, and many hackers will build many new things, new protocols, new networks, new programs. As PI4 cost increases, the esp32 cost is decreasing, we have transparent displays for 20$, good computers for 5$, cheap lora, and etc. Everything is more accessible than ever.
I played with a friend who saw completely different exploits than me, and I learned a lot just from few games, and because of the complexity of the game its often you enter into a position that you get surprised by your own actions :) So if you manage to find at least one friend who is not completely stunned by the assembler, I think you will have some good time.
A huge inspiration comes from phrack 49's 'Smashing The Stack For Fun And Profit' which has demystified the stack for me: http://phrack.org/issues/49/14.html#article
TLDR: computers are fun, and you can make them do things.
PS: In order to play with my friends I also built esp32 helper[1] that keeps track of the game state, and when I built it and wrote the code and everything I realized I could've just media queried the web version of the game.. but anyway, its way cooler to have a board game contraption.
[1]: https://punkx.org/overflow/esp32.html

Comments (54) 16 threads

IshKebab3 replies#
Very impressive. Maybe most impressive is that you got your 12 year old daughter to play this!

When can I expect the CHERI version? :-D

pjmlp3 replies#
A typical age to get into computers back in the 8-bit days.
throwaway71271#
From time to time I watch Jim Butterfield's Commodore 64 tape: https://www.youtube.com/watch?v=J9WnHuGjZ38 and I think just things were much easier

computers now are more like magic, nobody knows where your files are, or which programs you own or where they are even running.

IshKebab1 reply#
It's not an unusual age to get into computers now. It's an unusual subject though! Back in the 8 bit days you didn't have the option of writing 3D games and websites and apps and so on.
pjmlp#
We had very crude 3D, Elite and Starglider style, and BBS instead.
musicale#
I agree, though I don't think that core x86 (especially in real mode) is as bad as he seems to think - it started out as a 16-bit extension to the 8080 after all, and can be used that way.

Low-level computing is even more amazing when you learn how to decode and execute simple instructions with a few logic gates.
Beyond that is in many ways a matter of interfacing and scale (at which point abstraction layers can be very useful.)

throwaway712712 replies#
> When can I expect the CHERI version? :-D

"CHERI has three central design goals aimed at dramatically improving the security of contemporary C-language TCBs, through processor support for fine-grained memory protection and scalable software compartmentalization, whose (at times) conflicting requirements have required careful negotiation in our design."
:) I don't think so

sweetjuly2 replies#
The game is just a lot more difficult, you have to exploit everything as a UAF
Voultapher1 reply#
If I understand CHERI correctly it would be UAF + only intended pointer operations on pointers.

Continue this thread — 1 reply

jrtc27#
CHERI can provide heap temporal safety to protect against use-after-free (really, use-after-reallocation; use-after-free is harmless until the point at which the memory is being used for something else, and deferring lets you batch revocation sweeps), it's just not on by default yet as it's a bit too experimental, but we're working to stabilise it more for our next CheriBSD release.
PoignardAzur#
Pretty sure that's the joke.
Max-q3 replies#
Yeah, I were programming 6502 assembly at 12. Not that easy to do for a 12 year old now with today's computers
djmips1 reply#
They can in the browser like skildrick but turning it into a game is a great motivator.
timthorn1 reply#
It's not too hard on a Raspberry Pi or Microbit
folmar#
If you restrict it to similar capabilities, for example target a contemporary computer with freedos, it's not that much different.
todd8#
Core War is a game played in a memory arena of a virtual machine supporting a simple simulated assembly language. I first saw it described in a 1984 issue of Scientific American[1]. I had already been programming for 15 years by then and recognized Core War as being inspired by Darwin, an even earlier game developed at Bell Labs.

Darwin was created in 1961 and ran on an IBM 7090. In Darwin, programs competed for resources and the winner was the program that reproduced and took over all of the allocated space. It didn't last long because an unbeatable program was developed by Robert Morris Sr. See [2].
Software Practice and Experience was one of my favorite CS journals in the mid-70s and it had a frequent column call Computer Recreations written under the pseudonym Aleph-Null. I enjoyed implementing a number of the games described in that column while in grad school. Unfortunately, Software Practice and Experience is an expensive journal, but university students can likely find it like I did in the university libraries. The issues in the 1970s were easy to read and fun, having articles on subjects like pascal compilers, Algol 68, and concurrent programming. That is where I learned about Module[3,4] and later Oberon[5] in articles by N. Wirth.
[1] https://en.wikipedia.org/wiki/Core_War
[2] https://en.wikipedia.org/wiki/Darwin_(programming_game)
[3] https://onlinelibrary.wiley.com/doi/abs/10.1002/spe.43800701...
[4] https://onlinelibrary.wiley.com/doi/abs/10.1002/spe.43800701...
[5] https://onlinelibrary.wiley.com/doi/abs/10.1002/spe.43801909...

djmips1 reply#
I had a friend who loved games but claimed he didn't have the mind for coding and yet he was tricked into doing it via the game Human Resource Machine and some of his solutions were better than my own with years of experience!
PradeetPatel#
Sometimes having a new and fresh perspective helps a lot more than you think.

My 12 year old hates math, but he's surprisingly good at Human Resource Machine and SpaceChem. It makes me wonder whether high school maths is fundamentally different from programming maths.

ilaksh1 reply#
Very interesting.

I have always felt that short mnemonics are a poor engineering choice for today's computer memory sizes.
Like, the first thing you have to do here is to learn and recall what the instructions do. If you replace the names with more spelled out versions, it makes it much easier to pick them up and then remember them and read code.
The fact that people often don't do that makes me suspicious.
I also think that the fact that these types of exploits are possible points to overall system design failures.
I'm not saying that it's not a fun game or a good way to learn. But I feel that there is too much general acceptance of structural problems in engineering. To the degree that most people don't even see those structural flaws.

throwaway712711 reply#
> The fact that people often don't do that makes me suspicious.

I thought of doing that, even the first versions of the game had much more readable pseudoassembly, but in the end I wanted my daughter to comfortably read the output of objdump and I dont think its a big deal to learn few mnemonics. I also think kids respond really well when they are not patronized (at least mine does).
> To the degree that most people don't even see those structural flaws.
Do you think people dont consider arbitrary ready and write as a structural flaw?
There are thousands of people working on it, and making good progress, but in the same time, I still think its fun to peek and poke.

ilaksh#
I think I agree with your reasons for doing it that and I wasn't really trying to criticize your game in particular.

I was trying to make a more general statement about the types of problems that we seem to find ourselves solving over and over again and the fact that that occurs as such a typical case rather than replacing those structures.
I don't know how to make solving structural problems into a game.
I guess I did want to be a little critical though just to insert the comment that it's also important to make sure we teach kids that representation matters and that system design structure should not be taken for granted.

Load more comments