Duplicate Function Identification in Machine Code via Position Masking
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Debugging and translating large libraries of raw machine code across different hardware or software systems is inefficient due to the presence of position-dependent bits, which can lead to unrecognized duplicate function implementations, causing repetitive troubleshooting and inefficiencies when source code is unavailable.
Innovation Solution
A method that identifies position-dependent bits within machine code functions, masks them to create position-independent entities, and applies hashing to generate representative hash codes for comparison across executable images, facilitating the identification of duplicate function implementations.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Measurement precision
If direct comparison of machine code functions is performed, then duplicate functions can be identified, but position-dependent bits cause false negatives and reduce identification accuracy
Solution Approach 1:
The patent extracts position-dependent bits from machine code functions by identifying and masking them, separating the problematic position-dependent portion from the position-independent functional portion. This extraction allows the core function to be compared without the interfering position-dependent bits that cause false negatives in duplicate detection.
Solution Approach 2:
The patent changes the parameter representation of machine code by masking position-dependent bits, transforming the code from its original form with position-dependent variations into a normalized form where only position-independent functional characteristics remain. This parameter transformation enables accurate duplicate detection across different code positions.
2Productivity
If manual debugging of machine code is performed without source code, then debugging can proceed, but time and effort increase significantly due to inability to recognize duplicate functions
Solution Approach 1:
The patent performs preliminary processing of machine code functions by masking position-dependent bits and generating hash codes before the actual debugging process. This preliminary normalization of the code enables rapid duplicate detection during debugging, eliminating the need for time-consuming manual comparison and allowing debuggers to quickly identify whether a function has already been encountered.
3Loss of information
If position-dependent bits are included in function comparison, then complete function information is preserved, but duplicate functions with different memory positions are not recognized
Solution Approach 1:
The patent introduces hash codes as an intermediary representation between the original machine code and the comparison process. By generating hash codes from the position-independent portions of functions, the system creates a mediator that preserves essential functional information while eliminating position-dependent variations, enabling accurate duplicate detection without losing the core functional characteristics.
Data Source
AI summary
A method for identifying duplicate machine code function implementations provides for identifying position-dependent bits within a first function included in a first executable image and masking the identified position-dependent bits to create a position-independent entity. The method further provides for applying a hashing function to the position-independent entity to generate a representative hash code and comparing the representative hash code to a number of hash codes in a table to identify at least one duplicate implementation of the function that is associated in memory with a second executable image.


