Secure Code Generation via Multi-VM Randomized Assembly
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing code protection methods are vulnerable to reverse engineering through static and dynamic analysis, as attackers can capture and analyze execution assembly traces to identify patterns and produce clear-text disassembly, despite obfuscation techniques like indirect virtual machines and garbage code.
Innovation Solution
A method that generates code by translating initial operation codes into abstract assembly language, interpreting them using multiple virtual machine engines, producing disjoined sequences, randomly selecting and merging them to create a secure, interleaved assembly code that uses different binary conventions, making it difficult for attackers to reverse-engineer.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If code obfuscation methods are applied to protect software, then security against reverse engineering is improved, but the code becomes more complex and harder to maintain
Solution Approach 1:
The code is divided into multiple segments representing different virtual machine execution paths. Each segment corresponds to a possible interpretation of an opcode, and only one segment is executed at runtime based on dynamic conditions. This segmentation provides security through obfuscation while maintaining manageable code structure through modular organization of the segments.
Solution Approach 2:
The code structure transitions from static to dynamic by introducing runtime-dependent execution paths. Multiple virtual machine engines interpret the same opcode differently based on runtime conditions, creating dynamic behavior that changes execution flow. This dynamic approach enhances security against static analysis while the underlying structure remains organized and maintainable.
2Reliability
If multiple virtual machine engines are used to interpret opcodes, then code security against dynamic analysis is improved, but the execution time increases
Solution Approach 1:
Multiple virtual machine engines and their interpretation rules are prepared in advance during code generation. The possible execution paths and segments are pre-computed and organized, so that at runtime, the system only needs to select and execute the appropriate pre-prepared segment rather than computing multiple interpretations on the fly. This preliminary preparation reduces runtime overhead while maintaining the security benefits of multiple interpretation paths.
Solution Approach 2:
The execution paths of multiple virtual machine engines are segmented into distinct code regions, with each segment representing one possible interpretation. This segmentation allows the runtime system to efficiently jump to and execute only the relevant segment based on dynamic conditions, avoiding the need to execute all possible interpretations and thus minimizing time loss.
3Reliability
If random selection of virtual machine sequences is implemented, then code obfuscation effectiveness is improved, but the difficulty of debugging and maintenance increases
Solution Approach 1:
Different segments of the code have different qualities and characteristics based on which virtual machine engine produced them. Each segment is locally optimized and clearly delineated, with markers indicating its origin and purpose. This local quality differentiation allows debugging tools to identify and analyze specific segments independently, maintaining ease of operation despite the overall randomization and obfuscation.
Solution Approach 2:
Metadata and markers are introduced as intermediaries between the randomised code segments and the debugging/maintenance processes. These intermediaries carry information about segment origins, execution conditions, and relationships, allowing debugging tools to navigate and understand the obfuscated code structure without being overwhelmed by the randomness, thus preserving ease of operation.
Data Source
Figure 1~4
AI summary
The present invention relates to a method to generate a code (SC) to be stored in a memory in order to be later executed by a microprocessor, comprising the steps of generating initial operation codes (opcodes) in abstract assembly language (AA), interpreting each abstract assembly opcode (O) using at least two different virtual machine engines (VM1, VM2) logics, producing disjoined sequences (S1, S2) of target assembly opcodes, each sequence (S1, S2) implementing the corresponding virtual machine logic needed to interpret one assembly opcode (O), randomly choosing one of the at least two sequences (S1, S2) of target assembly opcodes for each initial opcode (O), merging extremities of chosen sequences of target assembly opcodes in compliance with opcode boundaries within each interpreted target assembly opcode and with data flow, storing the resulting code (SC) for subsequent execution.