Space-Efficient Binary Rewriting for Indirect Branches

Resolve Bottlenecks,
Find Innovative Solutions
Generate 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

VSEngineering 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

Engineering Contradiction:
Improverewriting capabilityVSAvoiddisk space
Core Design Contradiction:
Adaptability or versatilityVSQuantity of substance

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.

Inventive Principle:
Principle #2Taking out (Extraction)

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.

Inventive Principle:
Principle #26Copying

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

Engineering Contradiction:
Improvefailure hedgeVSAvoidbinary size
Core Design Contradiction:
ReliabilityVSQuantity of substance

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.

Inventive Principle:
Principle #10Preliminary action

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.

Inventive Principle:
Principle #24Intermediary (Mediator)

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

Engineering Contradiction:
Improveoperation simplicityVSAvoidcode-data disambiguation accuracy
Core Design Contradiction:
Ease of operationVSMeasurement precision

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.

Inventive Principle:
Principle #25Self-service

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.

Inventive Principle:
Principle #28Mechanics substitution (Replace mechanical system)

Data Source

PatentUS10452370B2System, method and computer readable medium for space-efficient binary rewriting
Publication Date: 2019.10.22 UNIV OF VIRGINIA PATENT FOUND
  • US10452370B2 patent drawing
  • US10452370B2 patent drawing
  • US10452370B2 patent drawing

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.