Obfuscating Binary Constants via Indirection Tables
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing methods for protecting compiled software from reverse engineering are inadequate, as malicious individuals can easily reverse engineer binary code to bypass DRM or licensing restrictions, potentially causing harm by altering critical software components.
Innovation Solution
The method involves generating a table of constants and creating an indirection table in the compiled binary, where each constant is referenced through offsets, allowing for obfuscation by splitting constants into segments and using a function to reconstruct them, thereby making it difficult to extract or modify the constants directly.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If constants are stored directly in the binary code, then the software is easy to reverse engineer and modify, but the protection against reverse engineering is weak
Solution Approach 1:
The patent divides constants into multiple segments and stores them in separate locations within the binary code. Instead of storing a single constant value directly, the system breaks it down into parts and uses an indirection table to reconstruct the full constant. This segmentation makes reverse engineering more difficult while maintaining the functionality of the constants.
Solution Approach 2:
The patent introduces an indirection table as an intermediary structure between the constant values and their usage in the code. The indirection table acts as a mediator that maps indices to actual constant values, adding an extra layer of abstraction. This intermediary structure prevents direct access to constant values while preserving their functionality.
2Difficulty of detecting and measuring
If an indirection table with offsets is used to obfuscate constants, then reverse engineering becomes more difficult, but the complexity of the binary structure increases
Solution Approach 1:
The patent segments the constant storage into multiple offset entries in the indirection table. Each constant is represented by a series of offset values that point to different locations in the binary code. This segmentation increases the difficulty of extracting constants while distributing the structural complexity across multiple small elements rather than a single complex structure.
Solution Approach 2:
The patent adds a dimensional layer by introducing an indirection table that maps indices to offset values, which in turn point to constant locations. This creates a multi-dimensional reference structure (index → offset → constant location) that increases the complexity of constant extraction while maintaining a relatively simple overall binary structure.
3Loss of time
If constants are split into segments and reconstructed through a function, then the cost of reverse engineering increases, but the performance of the program may be affected
Solution Approach 1:
The patent performs the segmentation and indirection table generation during the compilation process, before the program executes. The indirection table is pre-computed and embedded in the binary, so that during runtime, the system only needs to perform simple table lookups rather than complex constant reconstruction. This preliminary action protects against reverse engineering while minimizing runtime performance impact.
Solution Approach 2:
The indirection table serves as a pre-computed intermediary that bridges the gap between the segmented constant storage and the program's constant usage. During execution, the intermediary table provides fast lookup of constant values through simple index-based access, avoiding the need for complex runtime reconstruction while maintaining security against reverse engineering.
Data Source
AI summary
Disclosed herein are systems, computer-implemented methods, and tangible computer-readable media for obfuscating constants in a binary. The method includes generating a table of constants, allocating an array in source code, compiling the source code to a binary, transforming the table of constants to match Pcode entries in an indirection table so that each constant in the table of constants can be fetched by an entry in the indirection table. A Pcode is a data representation of a set of instructions populating the indirection table with offsets toward the table of constants storing the indirection table in the allocated array in the compiled binary. The method further includes populating the indirection table with offsets equivalent to the table of constants, and storing the indirection table in the allocated array in the compiled binary. Constants can be of any data type. Constants can be one byte each or more than one byte each. In one aspect, the method further includes splitting constants into two or more segments, treating each segment as a separate constant when transforming the table of constants, and generating a function to retrieve and reconstruct the split constants.


