Reversible Runtime Instrumentation for Managed Code Execution
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing methods for modifying processor-level instructions in software programs require editing and recompiling source code, which is inefficient and can lead to issues like signature invalidation and complexity, especially when modifying running processes or binary files without altering disk contents.
Innovation Solution
The development of an instrumentation framework that allows for querying and transforming processor-level instructions in a software program's execution image without modifying the pre-execution image, using a high-level programming language to identify and alter functions or instructions dynamically during runtime, enabling reversible transformations without restarting the program.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Ease of manufacture
If source code is edited and recompiled to modify processor-level instructions, then program functionality can be changed, but the process becomes complex and time-consuming
Solution Approach 1:
The patent creates a copy of the original program instructions in memory, allowing modifications to be applied to this copy rather than the original source code. This enables instruction modification without the need to edit and recompile source code, significantly reducing the time and complexity involved in changing program functionality.
Solution Approach 2:
The patent introduces an intermediary layer between the original program and its execution, consisting of copied instructions in memory that can be modified. This intermediary copy acts as a buffer, allowing changes to be made without directly altering the original source code or requiring recompilation, thus simplifying the modification process.
2Adaptability or versatility
If binary files are modified on disk to change program behavior, then permanent changes are achieved, but signature validation fails and security is compromised
Solution Approach 1:
The patent separates the program into two distinct segments: the original binary file stored on disk with its intact signature, and a copied version loaded into memory that can be modified. This segmentation allows the original file to maintain its signature validation while the in-memory copy can be adapted to change program behavior without compromising security.
Solution Approach 2:
The patent creates an in-memory copy of the original program instructions, allowing modifications to be applied to this copy without altering the original binary file on disk. This ensures that signature validation remains intact while still enabling program behavior changes through the modified in-memory version.
3Duration of action of moving object
If instructions are modified while the program is running, then dynamic adaptation is achieved, but system stability may be compromised
Solution Approach 1:
The patent performs the instruction copying action in advance, before any modifications are made. By creating a complete copy of the original instructions in memory before altering them, the system ensures that the modification process does not disrupt ongoing execution, maintaining stability while enabling dynamic adaptation.
4Ease of manufacture
If source code editing is used to modify instructions, then permanent changes are made, but the process lacks reversibility
Solution Approach 1:
The patent creates a copy of the original instructions in memory, preserving the original as a reference. This copying mechanism inherently provides reversibility, as the original instructions can be restored by simply discarding the modified copy and reloading the original, without requiring any complex undo mechanisms or version control systems.
Data Source
AI summary
A target program is instrumented during execution by using statements in high-level programming languages, without restarting the target and without modifying the compiled binary of the target on disk. The target and the analysis program modifying it may each include managed code. The target program is presented by an instrumentation API as a queryable database, rather than a mere sequence of processor-level instructions. An instrumentation context for the target program's execution image is obtained, with identifications of functions, individual instructions, and other instrumentable items that satisfy criteria specified in a query. Functions and low-level instructions may be identified as satisfying the query regardless of whether they have executed yet. High-level statements transform query-satisfying items in the target's execution image, by appending code, injecting a fault, replacing an individual instruction, or replacing an individual operand. Instrumentation transformations may be reverted without restarting execution and without reverting to the pre-execution image.


