Space-Efficient Binary Rewriting for Indirect Branches
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing static binary rewriters face challenges in rewriting binary files with indirect control transfers while maintaining low size and performance overhead, making them unsuitable for devices with limited storage capacity, such as those in the Internet of Things (IoT).
Innovation Solution
A method that involves analyzing and disassembling computer software programs to identify indirect branch targets, applying transformations to create a new binary program without requiring a copy of the original code, and optimizing the binary's address space to minimize size and performance overhead.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Adaptability or versatility
If existing static binary rewriters rewrite binary files with indirect control transfers, then the rewriting functionality is achieved, but the disk space required becomes at least twice as large as the original binary
Solution Approach 1:
The patent extracts only the essential information needed for rewriting (indirect branch targets and their resolutions) while discarding unnecessary original binary data. The rewriter creates a new binary that contains only the transformed code and minimal metadata, eliminating the need to store duplicate copies of the original binary file.
Solution Approach 2:
Instead of copying the entire original binary, the patent creates a new binary that copies only the necessary transformed instructions and data. The new binary is constructed from scratch using the intermediate representation and transformation results, rather than copying and modifying the original binary structure.
2Reliability
If static binary rewriters keep an original copy of the program's code as a hedge against failure, then reliability is improved, but the size of the new binary doubles
Solution Approach 1:
The rewriter performs preliminary analysis of the binary to identify all indirect branch targets and their resolutions before generating the new binary. This advance preparation allows the rewriter to construct the new binary with complete transformation information already resolved, eliminating the need for backup copies.
Solution Approach 2:
The patent introduces an intermediate representation as a mediator between the original binary and the new binary. This intermediate form contains all necessary transformation information in a structured way, allowing the rewriter to generate the final binary without needing to retain the original binary as a backup.
3Ease of operation
If static binary rewriters operate without additional program information, then ease of operation is improved, but the ability to correctly disambiguate code from data is compromised
Solution Approach 1:
The rewriter uses self-service techniques by analyzing the binary's own structure and behavior to automatically identify indirect branch targets and resolve ambiguities. The system performs static analysis on the binary's control flow and data patterns to determine code vs. data boundaries without requiring external program information.
Solution Approach 2:
The patent replaces mechanical copying and modification approaches with a more sophisticated analysis-based system. Instead of mechanically copying the original binary and making changes, the system uses static analysis to understand the binary's structure and generates a new binary from scratch based on transformation rules.
Data Source
AI summary
According to some illustrative embodiments of the invention, a method is performed that includes using a representation of a computer software program, using identified addresses which correspond to a part of the representation, and converting the representation into a created binary program, which includes reserving spaces at the identified addresses in the created binary program's address space at the same addresses as the identified addresses in the representation.


