How theiphoneos1project/microinjector works
Purpose and entry points
MicroInjector is a runtime code-injection platform for armv6 devices running iPhone OS 1.x. It installs a launchd bootstrap path that loads injection code into system processes, while exposing native hooking APIs through MicroInjector.h and Cydia Substrate-compatible shims through SubstrateShims.c.
Key build/package entry points are Makefile, LaunchDaemon.plist, and PxlPkg.plist.
Boot-time launchd bootstrap
The launch daemon configuration in LaunchDaemon.plist starts the bootstrap executable during system boot. launchd_trampoline/launchd_trampoline.c acts as a small intermediate process/loader stage, allowing the project to establish injection before normal launchd-managed workloads proceed.
The bootstrap path is deliberately guarded by a user-abort mechanism implemented in inject_launchd/inject_launchd.c.
Safe-mode / injection abort boundary
inject_launchd/inject_launchd.c detects held hardware buttons during boot and avoids injection when Home, Volume Up, or Volume Down is pressed. Hardware input handling is separated into:
• inject_launchd/buttons.c
• inject_launchd/iokit_private.h
This is the main recovery boundary: a failed or incompatible injected payload can be bypassed without removing the package.
launchd process injection
The injector executable manipulates the launchd task using low-level task and Mach-oriented primitives:
• inject_launchd/inject_launchd.c
• inject_launchd/task_primitives.c
• inject_launchd/task_primitives.h
This stage is architecture- and OS-version-sensitive. It crosses the strongest privilege boundary in the repository: an external bootstrap process obtains sufficient control over launchd to place the runtime loader into its address space.
In-process loader and payload discovery
Once injection reaches a target process, Loader/MicroLoader.m provides the Objective-C-aware in-process loading stage. It is responsible for bringing the MicroInjector runtime/payload behavior into the process context rather than relying on the external injector thereafter.
Loader/MISafeModeAlert.m and Loader/MISafeModeAlert.h provide an in-process failure/safe-mode user interface, complementing the boot-button escape hatch.
Native hooking runtime
The public runtime API is defined in:
• MicroInjector.h
• MicroInjector.c
• MicroInjectorInternal.h
This layer implements the core function, memory, Objective-C method, class-pair, image, and symbol manipulation capabilities used by injected code. HookFunction.c is a focused implementation unit for native function interception.
Substrate compatibility surface
SubstrateShims.c adapts the project’s native runtime to expected Cydia Substrate-style APIs. This is the compatibility boundary for existing tweaks or payloads written against Substrate conventions, allowing them to use MicroInjector without directly depending on its internal API.
Runtime and platform dependencies
The project targets legacy iPhone OS 1.x on armv6 and depends on private platform behavior, including IOKit input access and task/process manipulation. Building requires clang, an unofficial iPhone OS 1 SDK, and a patched linker supporting the Objective-C fragile runtime, as encoded by Makefile. Distribution is packaged as a PXL installer artifact via PxlPkg.plist.
Main entry points: MicroInjector.c MicroInjector runtime · inject_launchd.c launchd injector · Makefile Build rules · MicroLoader.m MicroLoader
Components 19
Boot bootstrap
Establishes launchd injection during system boot.
- Launch daemon config · Starts the bootstrap executable at boot.
LaunchDaemon.plist - launchd trampoline · Intermediate process stage before normal launchd workloads.
launchd_trampoline/launchd_trampoline.c
Privilege boundary
Controls guarded access to the launchd task.
- launchd injector · Checks abort state and injects the loader into launchd.
inject_launchd/inject_launchd.c - Boot button detection · Detects Home and volume-button recovery gesture.
inject_launchd/buttons.c - Private IOKit access · Private input declarations used by boot-button detection.
inject_launchd/iokit_private.h - Task/Mach primitives · Low-level primitives for manipulating the launchd task.
inject_launchd/task_primitives.c - Task primitive API
inject_launchd/task_primitives.h - launchd task · Strong privilege boundary and injection target.
In-process runtime
Loads payload behavior and exposes hooking APIs.
- MicroLoader · Objective-C-aware loading stage inside injected processes.
Loader/MicroLoader.m - Safe-mode alert · Reports injected-runtime failures to the user.
Loader/MISafeModeAlert.m - Safe-mode alert API
Loader/MISafeModeAlert.h - MicroInjector public API · Public API for injected code.
MicroInjector.h - MicroInjector runtime · Provides function, memory, Objective-C, image, and symbol manipulation.
MicroInjector.c - Runtime internals
MicroInjectorInternal.h - Function hook engine · Focused implementation of native function interception.
HookFunction.c - Substrate shims · Maps Cydia Substrate-style payload APIs onto MicroInjector.
SubstrateShims.c - Injected payloads · Use native or Substrate-compatible APIs in process context.
Build and package
Builds legacy armv6 artifacts and installer metadata.
- Build rules · Encodes clang, legacy SDK, armv6, and patched-linker requirements.
Makefile - PXL package manifest · Packages the platform as a PXL installer artifact.
PxlPkg.plist
Connections 22
- Launch daemon config → launchd trampoline: starts at boot
- launchd trampoline → launchd injector: establishes bootstrap
- Private IOKit access → Boot button detection: declares input access
- Boot button detection → launchd injector: abort signal · Held Home or volume buttons bypass injection.
- Task primitive API → Task/Mach primitives: defines interface
- Task/Mach primitives → launchd injector: provides task control
- launchd injector → launchd task: injects after guard passes
- launchd task → MicroLoader: loads in process
- MicroLoader → MicroInjector runtime: activates runtime
- Safe-mode alert API → Safe-mode alert: defines interface
- MicroLoader → Safe-mode alert: shows failure state
- Runtime internals → MicroInjector runtime: internal contracts
- Function hook engine → MicroInjector runtime: implements interception
- MicroInjector public API → MicroInjector runtime: public interface
- MicroInjector runtime → Injected payloads: native hooks and manipulation
- Substrate shims → MicroInjector runtime: adapts to runtime
- Substrate shims → Injected payloads: Substrate-compatible API
- Build rules → launchd trampoline: builds
- Build rules → launchd injector: builds
- Build rules → MicroLoader: builds
- Build rules → MicroInjector runtime: builds
- PXL package manifest → Launch daemon config: packages bootstrap config