Checksum-Based Code Integrity Protection via Chained Basic Blocks
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing code obfuscation techniques are ineffective in preventing reverse engineering, as attackers can detect and remove checksum calculations, allowing them to tamper with software code and disrupt its integrity.
Innovation Solution
Combining control flow flattening with checksum computations, where each basic block ends with a computation determining the next block's start address, and embedding initial checksum values in the code to create chains of checks that require simultaneous modification to tamper with the code, thereby ensuring the integrity of the next block is checked immediately before execution.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Difficulty of detecting and measuring
If code obfuscation techniques are used to conceal software logic, then reverse engineering difficulty increases, but attackers can still detect and remove checksum calculations to tamper with code integrity
Solution Approach 1:
The patent divides the checksum verification process into multiple chained basic blocks, where each block's checksum is embedded in the next block. This segmentation creates multiple interdependent verification points that attackers must simultaneously compromise, significantly increasing the difficulty of undetected code tampering while maintaining code obfuscation.
2Reliability
If checksum calculations are embedded in each basic block to ensure integrity, then code tampering detection improves, but the code complexity and size increase
Solution Approach 1:
The patent merges the checksum calculation and verification logic directly into the control flow structure of basic blocks. By combining integrity verification with the existing control flow flattening approach, the patent achieves code protection without requiring separate verification mechanisms, thus limiting the increase in code complexity.
3Difficulty of detecting and measuring
If control flow flattening is used to obfuscate execution flow, then reverse engineering becomes harder, but the next block calculation requires run-time information that may leak structure
Solution Approach 1:
The patent pre-calculates and embeds checksum values into the basic blocks during compilation, eliminating the need for run-time checksum calculations. This preliminary action ensures that integrity verification can proceed without exposing control flow structure through run-time computations, maintaining both obfuscation effectiveness and code integrity.
Data Source
Figure 1
Figure 2
AI summary
A method of obscuring software code including a plurality of basic blocks, including: calculating, by a processor, a checksum value of the current basic block and a pointer to the end of the current basic block; determining a preceding basic block for the current basic block; inserting the checksum value for the current basic block into the preceding basic block; and inserting instructions into the preceding basic block to determine a pointer to the beginning of the current basic block based upon the checksum value of the current basic block.