Hi everyone! This post is a writeup of some curiosities from the course of developing an iOS app simulator from scratch.<p>Like with any simulator, it was immensely gratifying watching third-party code run in an entirely controlled virtual environment!<p>This project also got me very familiar with some unintuitive AArch64 addressing rules, and taught me the internals of how funny Objective-C constructors that accept variadic arguments lists are handled.<p>In one late-night push, I managed to get the real CoreFoundation library dynamically loaded and running, which meant that the real standard library was able to create bona-fide Objective-C objects!<p>This post also goes into some fun bugs I created for myself, such as the simulator skipping over undefined functions resulting in an infinite loop when simulated code tried to abort(). I hope it's fun to follow along with, and thanks for reading!
This is an interesting design for an emulator. Are you planning to do some sort of symbolic execution with it? It seems set up to facilitate it so I’m curious where you’re going with it.