Tamper-Proofing with Self-Modifying Code
TLDR
This paper proposes a tamper-proofing model using self-modifying code (SMC) that leverages timing and introspection to detect unauthorized alterations.
Key contributions
- Introduces a tamper-proofing model using introspective and polymorphic self-modifying code (SMC).
- Binds integrity checks to execution behavior using reliable clocks and runtime timing predicates.
- Offers x86-64 design primitives for checksum-driven self-patching, optimizing for pipeline efficiency.
- Demonstrates engineered SMC (e.g., loop unrolling) reduces overhead while preserving tamper-detection.
Why it matters
Traditional security models often overlook microarchitectural details crucial for practical tamper detection. This paper shows how self-modifying code, when carefully engineered, can provide robust integrity checks by leveraging timing and introspection. It offers a practical approach for securing trusted code in untrusted environments.
Original Abstract
Classical computability theory tells us that self-modifying code (SMC) on a deterministic universal Turing machine can be simulated by non-SMC code on the same model. That abstraction, however, omits the external timing inputs, concurrency, and microarchitectural state that dominate practical execution on modern processors. We argue that once timing, ordering, and self-introspective effects are treated as observables, a practically faithful non-SMC reproduction of timed SMC becomes detectably expensive on commodity systems. We present a tamper-proofing model that combines introspective and polymorphic SMC, reliable clocks, and runtime timing predicates to bind integrity checks to execution behavior. We distinguish static and dynamic SMC generation, characterize the timing semantics needed to avoid catastrophic pipeline clears, and give x86-64 design primitives for checksum-driven self-patching. We also report timer measurements, performance comparisons, and performance-monitoring counter evidence showing that careful engineering -- especially loop unrolling and cross-page modification -- substantially reduces the overhead of SMC while preserving its tamper-detection value. The paper concludes with an efficiency analysis, a threat model, and deployment guidance for trusted code executing in untrusted environments.
📬 Weekly AI Paper Digest
Get the top 10 AI/ML arXiv papers from the week — summarized, scored, and delivered to your inbox every Monday.