Compiler Assembly Modification for Library Initialization Control

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing software libraries and applications lack control over the initialization and de-initialization of their global variables and objects, and proprietary information is exposed due to unscrambled symbols, leading to potential conflicts and security issues.

Innovation Solution

The ASMFIX tool modifies assembly files by rewriting memory management symbols, scrambling symbols to protect proprietary information, and reorganizing global variable declarations and initializer/de-initializer functions to allow the library or application to control their lifecycle and avoid name clashes.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Adaptability or versatility

If the operating system controls initialization and de-initialization of global variables, then the system maintains standard startup and shutdown procedures, but the library cannot effectively control or release its own global variables

Engineering Contradiction:
Improvelibrary control over initialization and de-initializationVSAvoidassembly code modification complexity
Core Design Contradiction:
Adaptability or versatilityVSDevice complexity

Solution Approach 1:

An assembly modification tool serves as an intermediary between the compiler and assembler, automatically inserting special assembly code that enables library-controlled initialization and de-initialization while maintaining compatibility with the operating system's standard procedures

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The assembly modification tool performs preliminary actions by pre-inserting control code into assembly files before assembly, setting up the infrastructure for library-controlled global variable management in advance

Inventive Principle:
Principle #10Preliminary action

2Loss of information

If symbols are left unscrambled, then debugging and maintenance are easier, but proprietary information is exposed to inspection

Engineering Contradiction:
Improveproprietary information protectionVSAvoidsymbol inspection difficulty
Core Design Contradiction:
Loss of informationVSDifficulty of detecting and measuring

Solution Approach 1:

Different scrambling approaches are applied to different symbols based on their sensitivity - critical proprietary symbols are heavily scrambled while public API symbols remain accessible, creating local variations in symbol protection quality

Inventive Principle:
Principle #3Local quality

Solution Approach 2:

The scrambling process transforms symbol names by changing their parameter representation (names, addresses, identifiers) while maintaining their functional relationships, making inspection difficult without the proper decryption key

Inventive Principle:
Principle #35Parameter changes

3Adaptability or versatility

If the same variable or object name is used by multiple libraries, then code reusability is improved, but name conflicts arise when libraries are loaded in the same system

Engineering Contradiction:
Improvesymbol name uniquenessVSAvoidsystem stability
Core Design Contradiction:
Adaptability or versatilityVSReliability

Solution Approach 1:

The symbol namespace is segmented by library, with each library receiving a unique prefix or namespace identifier. This segmentation prevents name conflicts while maintaining internal reusability within each library context

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

Symbol names are extended into an additional dimension by adding library-specific identifiers or namespaces, transforming one-dimensional symbol names into multi-dimensional identifiers that resolve conflicts across libraries

Inventive Principle:
Principle #17Another dimension (Dimensionality change)

4Adaptability or versatility

If standard memory management functions are used, then system compatibility is maintained, but the library cannot implement its own specific memory management functions

Engineering Contradiction:
Improvecustom memory management capabilityVSAvoidassembly code complexity
Core Design Contradiction:
Adaptability or versatilityVSDevice complexity

Solution Approach 1:

The assembly modification tool acts as an intermediary that automatically inserts custom memory management function calls into the library code, replacing standard system functions with library-specific implementations while maintaining the appearance of standard function usage

Inventive Principle:
Principle #24Intermediary (Mediator)

Data Source

PatentUS8930928B2Method for modifying the assembly output of a compiler
Publication Date: 2015.01.06 OPERA SOFTVEAR AS
  • US8930928B2 patent drawing
  • US8930928B2 patent drawing
  • US8930928B2 patent drawing

AI summary

The present invention performs manipulations on the assembly file level. As a compiler outputs an assembly file, the assembly file may be inspected and modified before it is sent to the assembler. One or more of the following modifications may be made to the assembly file: rewrite certain symbols, scramble program symbols, reorganize declarations of global variables so that their layout and default values are known prior to linking, and identify initializer and de-initializer functions in order to make them callable through central initialization and de-initialization functions, respectively.