Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Years ago I wrote an emulator for the Intel 8086 processor in C++. It's deceivingly difficult because the instruction encoding is complex and the emulation of each instruction has to have a very high fidelity. In a sense, software at the CPU instruction level is a chaotic system, as each instruction can influence the system state to a critical degree, so if there is a slight deviation from the spec/hardware, a snowball effect of deviations happens that leaves the system in a completely botched state where your emulator won't boot at all. Because the deviation can happen anywhere within an execution path of millions of instructions, it's very hard to debug, too.

Eventually I got it working and I could boot DOS and play games.

The aim of my project was to create a programmable emulator that could be used for the semi-automated analysis of malware, and sell it. Eventually this didn't really go anywhere as this was a too ambitious goal to do all by myself. See here [1] for a demonstration where I load tweets from Twitter and send them to the DOS text editor by triggering a keyboard interrupt via a Python API. Fun...

Later, the Unicorn CPU emulator framework implemented my idea much more effectively by creating Python bindings to an already mature emulator (QEMU).

[1] https://www.youtube.com/watch?v=XwPZH8LAVIY

[2] https://www.unicorn-engine.org/



Trying to do the same project but for MIPS architecture as a bachelor thesis project!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: