Tamper-Proofing with Self-Modifying Code
Listen
Radio episode about this paper
Transcript
Introduction to the show: ident: Security Radio. Generated commentary on the latest security and cryptography papers.
Nadia: We're looking at the paper: "Tamper-Proofing with Self-Modifying Code".
Elias: Here's the gist of the paper. Self-modifying code (SMC) on a deterministic universal Turing machine can be simulated by non-SMC code on the same model; SMC does not increase computational power beyond Turing completeness, but rather changes representation and potentially efficiency
1, 2, 3: Once timing, ordering, and selfintrospective 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 The paper makes four concrete contributions It frames timed, introspective SMC as a practical tamper-proofing primitive whose non-SMC reproduction is detectably costly on modern systems It develops a structured engineering model covering reliable clocks, timing semantics, static versus dynamic generation, and concrete x86-64 design primitives It reports empirical timing and performance-counter results that explain when SMC is impractical and when it becomes efficient enough to deploy The Core Problem of Practical Simulation Classical computability theory suggests that self-modifying code (SMC) on a deterministic universal Turing machine can be simulated by non-SMC code on the same model However, this abstraction omits external inputs such as timing, concurrency, and microarchitectural state that dominate practical execution on modern processors Once such inputs are admitted as observables, the equivalence of SMC to non-SMC becomes fragile in a tamper-proofing context Modern commodity processors do not satisfy the assumption that execution timing can be deterministically modeled to avoid catastrophic pipeline clears Model and Formalization The proposed tamper-proofing model treats SMC as being both introspective, checksumming its own code, and polymorphic, rewriting itself while executing The formal assumption is that a timer T(t) chosen per query t for reliability and a checksum function C(c) over code or data c; the predicate P(T, C) returns true if and only if the protected code remains unmodified This model inverts the conventional “trustworthy computing” perspective by asking how trusted software can retain integrity on an untrusted host Engineering Primitives for Integrity The paper develops structured engineering models covering reliable clocks, timing semantics, static versus dynamic generation, and concrete x86-64 design primitives For reliable clocks, instructions like RDTSC and RDTSCP can be made statistically reliable by repeated execution and surrounding them with serialization instructions The paper distinguishes between static SMC, which is handwritten assembly code linked at compile time, and dynamic SMC, which is generated at runtime using tools like AsmJit.
Nadia: Performance and Efficiency Analysis The efficiency analysis shows that naive SMC is too slow, but carefully designed SMC is not The dynamically generated SMC variant is substantially more competitive, being approximately 90.5× faster than the semantics-faithful, timing-constrained non-SMC variant.
Elias: The spread in dynamic measurements suggests that only a small fraction of runs suffer from substantial task-switch style disturbance.
Nadia: Deployment Guidance and Threat Model The model requires a timer T(t) tailored for reliability at the tth query and a checksum function C(c) over code or data c.
Title and authors: Nadia: To summarize what they laid out, the paper argues that classical theory says you can simulate self modifying code with non self modifying code on a universal Turing machine, but this ignores the physical reality of how computers run.
Elias: They point out that external inputs like timing and concurrency are what dominate practical execution on modern processors, so the equivalence between SMC and non self modifying is fragile when you add those inputs as observables.
Priya: The paper then introduces a model combining introspective and polymorphic self modifying code with reliable clocks, which includes introspection for checksumming the code itself, polymorphism for rewriting it while running, and runtime timing predicates to check behavior.
Nadia: They formally assume that a timer T of time chosen for each query t is used for reliability alongside a checksum C over the data or code c; if both P of T and C are true, then the protected code remains unmodified.
Elias: The main goal here is to see how trusted software can maintain its integrity on an untrusted host by binding its behavior to specific execution times and code checks.
Priya: They break down the engineering side, covering reliable clocks, static versus dynamic generation methods, and concrete xeighty-six-sixty-four design primitives for self patching <ref:2604.12407#pg1,x86-64 design primitives for>.
Nadia: They also show that naive self modifying code is too slow, but when you design it carefully using dynamic generation techniques, it can be substantially faster than the semantics faithful non self modifying variant.
Elias: The empirical results they report show that the dynamically generated variant is approximately ninety point five times faster than the timing constrained non self modifying variant.
Priya: This efficiency gain suggests that only a small portion of runs suffer from major task switch style disturbance, which gives us a concrete picture of why some executions are slow while others aren't.
Nadia: So the summary is that they have created a framework where you can detect if self modifying code has been tampered with by checking its behavior against specific timing and integrity conditions.
Elias: It shifts the focus from whether it *can* be simulated to how *costly* it is to simulate faithfully on actual hardware.
Priya: The implication for us is that security research needs to start considering the physical constraints of modern CPUs when designing defenses against self modifying code.
The paper's summary: Nadia: The improvements they suggest are focused on making this model practical by addressing the flaws in the naive approaches, specifically through better clock reliability and generation methods.
Elias: They focus on reliable clocks by showing how instructions like RDTSC and RDTSCP can be made statistically reliable through repeated execution and surrounding them with serialization instructions.
Priya: They also contrast static self modifying code, which is handwritten assembly code linked at compile time, with dynamic self modifying code that is generated at runtime using tools like AsmJit.
Nadia: They show that the dynamically generated variant offers a significant performance boost, around ninety point five times faster than the timing constrained non self modifying variant.
Elias: The dynamic generation method also allows for features like binding labels at arbitrary offsets and computing code sizes for fragments before final emission, emitting RIP relative xeighty-six-sixty-four addressing directly <ref:2604.12407#pg1>.
Priya: These are concrete design primitives that allow for highly flexible and context sensitive self modifying code tailored to specific runtime environments, which is a big step forward.
Nadia: Beyond the performance boost, they suggest tuning tamper proofing thresholds based on allowed CPU usage range in the operating system and the length of the protected computation.
Elias: They also stress that you can tune those thresholds based on how many consecutive failed timing scores trigger a fatal termination or recovery, which lets you adapt to system noise.
Priya: This tuning mechanism means security policies aren't just static guesses; they are configured based on measured system noise rather than just assumptions about the environment.
Elias: That bounding of the state space is important because it helps manage complexity in large codebases when you are performing these integrity checks.
Priya: Overall, they've provided a blueprint for how to compose these different elements into a deployment scheme that actually works on modern systems.
The paper's improvements: Nadia: So wrapping up the paper "Tamper-Proofing with Self-Modifying Code," the main implication is that we can now treat timed introspective self modifying code as a practical tamper proofing primitive whose non self modifying reproduction is detectably costly on modern systems.
Elias: The key finding is that this approach shifts the discussion from theoretical possibility to measurable performance cost when you introduce timing observables into security checks.
Priya: It shows that for integrity checks binding behavior to time, there’s really no practically faithful non self modifying equivalent that preserves both semantics and timing in front of an adversary on contemporary systems.
Nadia: The paper provides a structured engineering model covering reliable clocks, timing semantics, static versus dynamic generation, and concrete xeighty-six-sixty-four design primitives <ref:2604.12407#pg1>.
Elias: They also report timer measurements and performance comparisons that explain when self modifying code is impractical and when it becomes efficient enough to deploy.
Priya: For me, the most important thing is that they identified scheduler noise as a key source of variance, which tells us how much variance we can expect under specific operating system conditions.
Nadia: So in the end, this paper gives us a practical path to runtime integrity for trusted code executing in untrusted environments by combining polymorphic self modifying code with carefully engineered timing semantics.
Elias: It’s a lot of work on the paper, but it lays out how to build defenses that are tuned to real hardware constraints rather than just assuming perfect execution.
Priya: We're looking forward to seeing how this approach helps when we start cross modifying code in multi thread settings and what kind of overhead we see there.
Conclusion: Nadia: So we've been talking about how self modifying code can be used for tampering, and this paper is looking at how to make that tamper proofing practical on real hardware by treating it as a timing and introspection problem.
Elias: Exactly. It moves away from the old idea that you can just simulate it on a theoretical machine and focuses on the actual costs of doing so when you add timing into the picture.
Priya: I'm interested in how they defined their model, because it has to account for all those physical things like pipeline clears and scheduler noise that we ignore in pure computation theory.
Nadia: Right. They’re using a model where they assume a timer, let's call it T of time chosen for each query t, and a checksum function C over the code or data c; if both P of T and C are true, then the protected code remains unmodified.
Elias: That setup is interesting because it inverts the trust model. instead of asking if software is trustworthy on an untrusted host, they ask how trusted software can keep its integrity when running on something untrusted.
Priya: I mean, that sounds complicated to set up in the real world, but it makes sense since commodity processors don't follow all those ideal assumptions about execution timing.
Nadia: They show concrete engineering primitives for this: reliable clocks like instructions RDTSC and RDTSCP can be made statistically reliable by repeated executions and surrounding them with serialization instructions.
Elias: And they distinguish between static self modifying code, which is handwritten assembly code linked at compile time, and dynamic self modifying code that gets generated at runtime using tools like AsmJit.
Priya: The results they report are what really stick out—they show that the dynamically generated variant is about ninety point five times faster than the timing constrained non self modifying variant.
Nadia: Ninety point five times faster, Elias, that’s a big jump for something this complex to do in real time.
Elias: It means careful design makes a difference and only a small fraction of runs suffer from those major task switch style disturbances they mentioned.
Priya: So what this means for us is that we need to stop just thinking about whether it can be done, and start thinking about the actual performance penalty on commodity systems.
Nadia: The main lesson is that while naive self modifying code is too slow, if you design it carefully using those dynamic generation techniques, it can actually be efficient enough to deploy.
Elias: But they also point out the limitations honestly; the approach still has to be tuned based on platform specific thresholds and OS scheduling noise.
Priya: And they do mention that specialized hardware with direct memory access would require a bigger defense strategy, which is a fair caveat about where this model stops working.
Nadia: So to wrap up, "Tamper-Proofing with Self-Modifying Code" gives us a practical primitive by framing timed introspective self modifying code as something whose non self modifying reproduction is detectably costly on modern systems.
Elias: It’s a lot of work, but it offers a path forward for runtime integrity when we can't just rely on perfect execution timing.
Priya: I think the way they tuned those thresholds based on allowed CPU usage and computation length is the most useful part for anyone trying to implement this in practice.
Nadia: For now, that’s what we have from this paper. Next up, we'll be looking at how large language models are being tested against adversarial jailbreaking attacks across seven different models.
Eötvös Loránd Tudanymanyesegyetem / University (ELTE)
cs.CR
Submitted: 2026-04-14
Updated: 2026-11-11
Comments: 14 pages, 5 figures, 6 tables. Lean 4 formalization (Palomar entry PALOMAR-2026-10-18-000004 v1): https://github.com/GregoryMorse/SelfModTamper , tag palomar-v1
License: http://creativecommons.org/licenses/by/4.0/
Importance score: 80/100
The gist: Self-modifying code (SMC) on a deterministic universal Turing machine can be simulated by non-SMC code on the same model; SMC does not increase computational power beyond Turing completeness…
Key concepts
- Self-Modifying Code (SMC)
- Code that can change its own instructions while running. The paper treats SMC as both introspective (checking its own integrity) and polymorphic (rewriting itself). It is used here as a method to maintain code integrity against an untrusted host.
- Tamper-Proofing Model
- A framework that checks if protected code remains unmodified by verifying two things: the code's checksum and the execution timing. This model treats SMC as a practical defense primitive, focusing on how trusted software can stay intact when running in an untrusted system.
- Reliable Clocks and Timing Semantics
- Using hardware instructions like RDTSC to measure time. The paper shows that these measurements are not perfectly reliable due to system noise. They develop methods to make these clocks statistically reliable by using serialization and analyzing performance counters to understand timing variance.
- Static vs. Dynamic SMC
- Static SMC is code written once before execution, while dynamic SMC is generated at runtime using tools like AsmJit. The paper suggests that dynamically generated SMC is more competitive in terms of speed because it can be tailored to the specific runtime environment.
Terminology
Summary
Self-modifying code (SMC) on a deterministic universal Turing machine can be simulated by non-SMC code on the same model; SMC does not increase computational power beyond Turing completeness, but rather changes representation and potentially efficiency [1, 2, 3] Once timing, ordering, and selfintrospective 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 The paper makes four concrete contributions It frames timed, introspective SMC as a practical tamper-proofing primitive whose non-SMC reproduction is detectably costly on modern systems It develops a structured engineering model covering reliable clocks, timing semantics, static versus dynamic generation, and concrete x86-64 design primitives It reports empirical timing and performance-counter results that explain when SMC is impractical and when it becomes efficient enough to deploy
The Core Problem of Practical Simulation
Classical computability theory suggests that self-modifying code (SMC) on a deterministic universal Turing machine can be simulated by non-SMC code on the same model However, this abstraction omits external inputs such as timing, concurrency, and microarchitectural state that dominate practical execution on modern processors Once such inputs are admitted as observables, the equivalence of SMC to non-SMC becomes fragile in a tamper-proofing context Modern commodity processors do not satisfy the assumption that execution timing can be deterministically modeled to avoid catastrophic pipeline clears
Model and Formalization
The proposed tamper-proofing model treats SMC as being both introspective, checksumming its own code, and polymorphic, rewriting itself while executing The formal assumption is that a timer T(t) chosen per query t for reliability and a checksum function C(c) over code or data c; the predicate P(T, C) returns true if and only if the protected code remains unmodified This model inverts the conventional “trustworthy computing” perspective by asking how trusted software can retain integrity on an untrusted host
Engineering Primitives for Integrity
The paper develops structured engineering models covering reliable clocks, timing semantics, static versus dynamic generation, and concrete x86-64 design primitives For reliable clocks, instructions like RDTSC and RDTSCP can be made statistically reliable by repeated execution and surrounding them with serialization instructions The paper distinguishes between static SMC, which is handwritten assembly code linked at compile time, and dynamic SMC, which is generated at runtime using tools like AsmJit.
Performance and Efficiency Analysis
The efficiency analysis shows that naive SMC is too slow, but carefully designed SMC is not The dynamically generated SMC variant is substantially more competitive, being approximately 90.5× faster than the semantics-faithful, timing-constrained non-SMC variant. p. 7 As shown in Table 5,
it is approximately 90. 5× faster than the semantics-faithful, timing-constrained non-SMC variant
and about 2. Using the RDTSCP figures as a back-of-the-envelope estimate, the
SMC variant yields
10,000 · (467,286 − 414,188)
2,158,056
≈ 246,
246
10,000
≈ 2. 5%,
which suggests that only a small fraction of runs suffer a substantial task-switch style disturbance.Where the paper says it
Where the paper says it
Deployment Guidance and Threat Model
The model requires a timer T(t) tailored for reliability at the tth query and a checksum function C(c) over code or data c. The main engineering lesson is that naive SMC is too slow, but carefully designed SMC is not. p. 3 In both cases,
deployment policies should be reviewed carefully if write-execute (WX/RWX) pages are restricted. Dynamic SMC also makes address tracking more difficult for emulation tools. High Precision Event Timer
(HPET), real-time clock (RTC) facilities, and operating-system monotonic counters provide alternative timing sources with different resolution and noise profiles. The specific x86 instructions
discussed here are not unique in spirit: AVR32, SPARC V9, PowerPC, ARMv7, and ARMv8
all provide related counter-style instructions, underscoring the near universality of hardware time
measurement. There does not exist a semantics-faithful non-SMC implementation that is as fast as, or faster
than, the SMC version under the same timing constraints. Specialized hardware with direct memory access, such as certain FPGA-based platforms,
would require a correspondingly larger-area defense strategy.Where the paper says it
Where the paper says it
Where the paper says it
Future Directions
Promising directions for future work include cross-modifying code in multithreaded settings, checksum kernels whose best non-SMC emulation incurs super-linear overhead, automated blueprint generation for dynamic SMC, and validation on additional ISAs. Overall, polymorphic SMC paired with carefully engineered timing semantics offers a practical path to runtime integrity for trusted code executing in untrusted environments. p. 0 The paper concludes
with an efficiency analysis, a threat model, and deployment guidance for trusted code executing
in untrusted environments. Keywords: x86, x86-64, assembly language, self-modifying code, software protection, tamperproofing, integrity checking, runtime verification
1 Introduction
It is classical in computability theory that self-modifying code (SMC) on a deterministic universal
Turing machine (UTM) can be simulated by non-SMC code on the same model; SMC does not
increase computational power beyond Turing completeness, but rather changes representation and
potentially efficiency [1, 2, 3].Where the paper says it
References
[1] Marvin L. Minsky. Computation: Finite and Infinite Machines. p. 4 When cache effects matter, unrolling can also distribute self-modifying regions across
distinct pages, reducing the chance that the executing page is also the one being written. Although modern processors ultimately remain von Neumann machines, their deep pre-execution
machinery makes SMC expensive when it touches instructions that are already in flight.Where the paper says it
[2] John E. Hopcroft and Jeffrey D. Ullman. Introduction to Automata Theory, Languages, and Computation. p. 0 The paper concludes
with an efficiency analysis, a threat model, and deployment guidance for trusted code executing
in untrusted environments. Keywords: x86, x86-64, assembly language, self-modifying code, software protection, tamperproofing, integrity checking, runtime verification
1 Introduction
It is classical in computability theory that self-modifying code (SMC) on a deterministic universal
Turing machine (UTM) can be simulated by non-SMC code on the same model; SMC does not
increase computational power beyond Turing completeness, but rather changes representation and
potentially efficiency [1, 2, 3].Where the paper says it
[3] Sanjeev Arora and Boaz Barak. Computational Complexity: A Modern Approach. p. 0 The paper concludes
with an efficiency analysis, a threat model, and deployment guidance for trusted code executing
in untrusted environments. Keywords: x86, x86-64, assembly language, self-modifying code, software protection, tamperproofing, integrity checking, runtime verification
1 Introduction
It is classical in computability theory that self-modifying code (SMC) on a deterministic universal
Turing machine (UTM) can be simulated by non-SMC code on the same model; SMC does not
increase computational power beyond Turing completeness, but rather changes representation and
potentially efficiency [1, 2, 3]. hu1
and Tamás Kozsik
kto@elte. hu1
1Eötvös Loránd Tudományegyetem / University (ELTE), Budapest, Hungary
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.Where the paper says it
Where the paper says it
[4] Hua Shan Tan and Yang Yang. A software protection method based on computer fingerprint and asymmetric encryption. p. 0 The paper concludes
with an efficiency analysis, a threat model, and deployment guidance for trusted code executing
in untrusted environments. Keywords: x86, x86-64, assembly language, self-modifying code, software protection, tamperproofing, integrity checking, runtime verification
1 Introduction
It is classical in computability theory that self-modifying code (SMC) on a deterministic universal
Turing machine (UTM) can be simulated by non-SMC code on the same model; SMC does not
increase computational power beyond Turing completeness, but rather changes representation and
potentially efficiency [1, 2, 3].Where the paper says it
[5] Yue Hu, Xiaofeng Liao, Kwok wo Wong, and Qing Zhou. A true random number generator based on mouse movement and chaotic cryptography. p. 1 Many machine and system identifiers—CPU
ID strings, NIC MAC addresses, disk/RAM configurations, or operating-system fingerprints—are
useful for binding a license to a host [4], but they solve fingerprinting more directly than tamperproofing and are operationally brittle. System-activity signals such as mouse movement or event
logs either feed entropy pools [5] or exhibit regularity that attackers can mimic.Where the paper says it
[6] C.S. Collberg and C. Thomborson. Watermarking, tamper-proofing, and obfuscation - tools for software protection. p. 1 Relation to prior work. Tamper-proofing via watermarking is well studied [6]. 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.Where the paper says it
Where the paper says it
[7] J.T. Giffin, M. Christodorescu, and L. Kruger. Strengthening software self-checksumming via self-modifying code. p. 1 Tamper-proofing via watermarking is well studied [6]. Self-checksumming with SMC has also been explored [7], but typically with static checksum routines rather
than checksum kernels that rewrite themselves while executing. Checksum Unit 1
Page 1
Page 2
Measure time
Measure time
Modify Next Page
Compute
Modify Prior Page
Compute
Checksum Unit 2
Page 1
Page 2
Measure time
Measure time
Modify Next Page
Compute
Modify Prior Page
Compute
Checksum Verier State 1
Checksum Verier State 2
Figure 1: Design overview of checksum units and state verification. • It states explicit efficiency and security assumptions so that the scope and limitations of the
approach are clear.Where the paper says it
Where the paper says it
[8] Mathias Morbitzer. Scanclave: Verifying application runtime integrity in untrusted environments. p. 0 The paper concludes
with an efficiency analysis, a threat model, and deployment guidance for trusted code executing
in untrusted environments. Keywords: x86, x86-64, assembly language, self-modifying code, software protection, tamperproofing, integrity checking, runtime verification
1 Introduction
It is classical in computability theory that self-modifying code (SMC) on a deterministic universal
Turing machine (UTM) can be simulated by non-SMC code on the same model; SMC does not
increase computational power beyond Turing completeness, but rather changes representation and
potentially efficiency [1, 2, 3].Where the paper says it
[9] Vincent M. Weaver, Dan Terpstra, and Shirley Moore. Non-determinism and overcount on modern hardware performance counter implementations. p. 2 High Precision Event Timer
(HPET), real-time clock (RTC) facilities, and operating-system monotonic counters provide alternative timing sources with different resolution and noise profiles. The specific x86 instructions
discussed here are not unique in spirit: AVR32, SPARC V9, PowerPC, ARMv7, and ARMv8
all provide related counter-style instructions, underscoring the near universality of hardware time
measurement. The paper concludes
with an efficiency analysis, a threat model, and deployment guidance for trusted code executing
in untrusted environments. Keywords: x86, x86-64, assembly language, self-modifying code, software protection, tamperproofing, integrity checking, runtime verification
1 Introduction
It is classical in computability theory that self-modifying code (SMC) on a deterministic universal
Turing machine (UTM) can be simulated by non-SMC code on the same model; SMC does not
increase computational power beyond Turing completeness, but rather changes representation and
potentially efficiency [1, 2, 3].Where the paper says it
Where the paper says it
[10] AsmJit Project. p. 3 Compiler support is also inconsistent: Microsoft Visual C++
supports inline assembly on x86 but not x86-64, whereas the GNU Compiler Collection allows inline
assembly more broadly. Dynamic SMC is generated at runtime, for example with an assembler library such as AsmJit
[10]. 6 Dynamic SMC tamper-proofing design primitives
Dynamic generation generalizes the same ideas while removing many of the practical limits of
handwritten assembly. Figure 4 shows a representative AsmJit fragment. Compiler support is also inconsistent: Microsoft Visual C++
supports inline assembly on x86 but not x86-64, whereas the GNU Compiler Collection allows inline
assembly more broadly. Dynamic SMC is generated at runtime, for example with an assembler library such as AsmJit
[10].Where the paper says it
Where the paper says it
Where the paper says it
[11] Intel Corporation. p. 4 Item Intel x86-64 AMD64
Perf. Counter Global Control 0x38F 0xC0000301
Perf. 10 Security assumptions and threat model
The scope of the model is defined by four main assumptions. A von Neumann architecture is available; pure Harvard architectures fall outside the intended
deployment model. Item Intel x86-64 AMD64
Perf. Counter Global Control 0x38F 0xC0000301
Perf.Where the paper says it
Where the paper says it
Where the paper says it
[12] Inc. Advanced Micro Devices. AMD64 Architecture Programmer’s Manual Volume 2: System Programming. p. 1 System-activity signals such as mouse movement or event
logs either feed entropy pools [5] or exhibit regularity that attackers can mimic. Cloud- or serverprovided data can be incorporated as an external input, but replay and protocol attacks complicate
correctness unless additional machinery is deployed; moreover, such channels do not protect code
at the machine-architecture level against manual debugging, thread injection, or remote processmemory writes.Where the paper says it
[13] OpenLibSys.org. What’s WinRing0 — openlibsys. p. 4 Performance counter configuration is privileged. On Windows, practical experimentation may therefore require a signed kernel
driver such as WinRing0 [13].Where the paper says it
[14] AsmJit Project. p. 3 Compiler support is also inconsistent: Microsoft Visual C++
supports inline assembly on x86 but not x86-64, whereas the GNU Compiler Collection allows inline
assembly more broadly. Dynamic SMC is generated at runtime, for example with an assembler library such as AsmJit
[10]. Compiler support is also inconsistent: Microsoft Visual C++
supports inline assembly on x86 but not x86-64, whereas the GNU Compiler Collection allows inline
assembly more broadly. Dynamic SMC is generated at runtime, for example with an assembler library such as AsmJit
[10].Where the paper says it
Where the paper says it
Timer SMC Non-SMC
Avg. Min. Max. Avg. Min. Max. RDTSC 8305286 7466370 17053914 1052981 959776 11039730 RDTSCP 8305389 7466412 17054428 1053077 959834 11040460 Interrupt Time 32045 28806 65803. p. 8 RDTSC 8305286 7466370 17053914 1052981 959776 11039730
RDTSCP 8305389 7466412 17054428 1053077 959834 11040460
Interrupt Time 32044 28806 65800 4064 3704 42610
Perf. Counter 32045 28807 65802 4064 3703 42617
Precise UTC 32045 28806 65803 4065 3704 42622
Tick Count 3 0 16 0 0 16
Multimedia 3 1 7 0 0 4
Table 4: 10,000 runs on a hexa-core Intel Core i7-9750H with 16 GB RAM under Windows 10; the
checksum covered the entire 220 KB code segment.Where the paper says it
Avg. Min. Max. Avg. Min. Max. RDTSC 467241 414132 2157922 42300670 39599882 74294904 RDTSCP 467286 414188 2158056 42300840 39600010 74295022 Interrupt Time 183. p. 8 Timer SMC Non-SMC
Avg. RDTSC 467241 414132 2157922 42300670 39599882 74294904
RDTSCP 467286 414188 2158056 42300840 39600010 74295022
Interrupt Time 1803 1598 8328 163202 152779 286641
Perf.Where the paper says it
Avg. Min. Max. Avg. Min. Max. RDTSC 8305286 7466370 17053914 1052981 959776 11039730 RDTSCP 8305389 7466412 17054428 1053077 959834 11040460 Interrupt Time 32. p. 8 Timer SMC Non-SMC
Avg. RDTSC 8305286 7466370 17053914 1052981 959776 11039730
RDTSCP 8305389 7466412 17054428 1053077 959834 11040460
Interrupt Time 32044 28806 65800 4064 3704 42610
Perf.Where the paper says it
Avg. Min. Max. Avg. Min. Max. RDTSC 8305389 7466512 170545428 10531077 959834 110406. p. 8 Timer SMC Non-SMC
Avg. RDTSC 8305286 7466370 17053914 1052981 959776 11039730
RDTSCP 8305389 7466412 17054428 1053077 959834 11040460
Interrupt Time 32044 28806 65800 4064 3704 42610
Perf.Where the paper says it
Avg. Min. Max. Avg. Min. Max. RDTSC 8305286 7466370 17053914 1052981 959776 11039730 RDTSCP 8305389 7466412 17054428 1053077 959834 110406. p. 8 Timer SMC Non-SMC
Avg. RDTSC 8305286 7466370 17053914 1052981 959776 11039730
RDTSCP 8305389 7466412 17054428 1053077 959834 11040460
Interrupt Time 32044 28806 65800 4064 3704 42610
Perf.Where the paper says it
Avg. Min. Max. Avg. Min. Max. Interrupt Time 32, Tick Count 16, Multimedia 7, Perf Counter 32045
Avg. Min. Max. Avg. Min. Max. RDTSC 8305389 7466512 170545428 10531077 959834 110406 RDTSCP 8305389 7466512 170545428 10531077 959834 110406 Interrupt Time 32, Tick Count 16, Multimedia 7, Perf Counter 32045
Avg. Min. Max. Avg. Min. Max.
Green — the paper says it, and the page is printed. Red — no passage carries it, so treat that sentence as unverified. The same check runs on your own text: check a summary against its source, $5.
Improvements for AI systems
-
Identify practical tamper-proofing primitives by framing
timed, introspective SMC as a practical tamper-proofing primitive whose non-SMC reproduction is detectably costly on modern systems.
This allows AI systems to prioritize security mechanisms that offer high assurance without incurring excessive performance penalties on commodity hardware. -
Develop structured engineering models covering
reliable clocks, timing semantics, static versus dynamic generation, and concrete x86-64 design primitives.
This enables the creation of AI tools capable of designing secure execution environments by understanding the interplay between time sources and code modification strategies. -
Implement checksum schemes that do not modify the currently executing instruction stream by using techniques like
loop unrolling
or distributing self-modifying regions acrossdistinct pages, reducing the chance that the executing page is also the one being written.
This improves AI systems' ability to generate SMC that maintains execution speed by avoiding pipeline clears. -
Generate dynamic SMC using tools like AsmJit which allows for features such as
binding labels at arbitrary offsets, compute code sizes for fragments before final emission, and emit RIP-relative x86-64 addressing directly.
This enables the creation of highly flexible and context-sensitive self-modifying code tailored to specific runtime environments. -
Tune tamper-proofing thresholds based on empirical data by using
allowed CPU-usage range in the operating-system environment, the length of the protected computation, and the number of consecutive failed timing scores that trigger fatal termination or recovery.
This allows AI to automatically configure security policies based on measured system noise rather than static assumptions. -
Design state machines with precomputed validation states to implement
P(T, C) for a controlled subset of states,
while using areset function restores the SMC to a canonical state and bounds the state-space growth.
This provides AI systems with mechanisms to manage the complexity of integrity checks in large codebases by bounding the relevant state space. -
Analyze performance counters and timing data from measurements like Table 4 and Table 5 to estimate noise sources, such as
scheduler noise,
allowing AI to predict how much variance a given SMC design will exhibit under specific operating system conditions.
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. The threat model is formalized in Lean 4, relative to an explicit platform contract: the security theorem, the necessity of each assumption and which assumptions each adversary level satisfies or breaks are machine-checked, and the development is registered with the Palomar registry.
Related papers
- From Strategy Search to Policy Learning: MCTS-Guided Adversarial Co-Evolution for LLM Safety Alignment
- Privacy Leakage from Recurrent State in LLM Inference
- Incrementally Verifiable Oracle Aided Computation
- Privilege and confidentiality in generative AI workflows
- BadMoE: Backdooring Mixture-of-Experts LLMs via Routing-Aware Triggers and Task-Underutilized Experts
- CoVault: Secure, Scalable Analytics of Personal Data