DLL Replacement in Windows CE via Name Manipulation

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

In the Windows CE operating system, replacing a ROM-based DLL with a RAM-based DLL is challenging due to the system's inability to load the ROM-based DLL if it shares the same name as the RAM-based DLL, preventing indirect calls from applications to the original ROM-based DLL, which violates the conditions for successful DLL replacement.

Innovation Solution

A trusted application manipulates DLL file names to allow both the hook DLL and the target DLL to be loaded, changing their names so that the target DLL is only callable by the hook DLL and not by other applications, ensuring successful replacement irrespective of which DLL is loaded first.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Adaptability or versatility

If a RAM-based DLL is loaded to replace a ROM-based DLL in Windows CE, then the replacement DLL can be executed, but the original ROM-based DLL cannot be loaded or called by the replacement DLL

Engineering Contradiction:
ImproveDLL replacement capabilityVSAvoidDLL callability
Core Design Contradiction:
Adaptability or versatilityVSReliability

Solution Approach 1:

The patent changes the file name parameter of the target DLL to a temporary name, allowing the replacement DLL to be loaded with the original name. After the replacement DLL is successfully loaded and can call the target DLL, the file names are swapped so the target DLL gets the original callable name and the replacement DLL gets the temporary name. This parameter change enables both DLLs to coexist with proper callability.

Inventive Principle:
Principle #35Parameter changes

Solution Approach 2:

The patent introduces a file name as an intermediary mechanism to resolve the conflict between loading the replacement DLL and maintaining callability to the target DLL. By temporarily changing file names, the system creates an intermediate state where both DLLs can be loaded, then finalizes the names to ensure proper calling relationships.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Stability of the object's composition

If the target DLL and hook DLL share the same name in Windows CE, then the system prevents duplicate loading, but this prevents successful DLL replacement

Engineering Contradiction:
ImproveDLL loading integrityVSAvoidDLL replacement functionality
Core Design Contradiction:
Stability of the object's compositionVSAdaptability or versatility

Solution Approach 1:

The patent performs a preliminary action by changing the file name of the target DLL to a temporary name before loading the replacement DLL. This preliminary name change prevents the system from detecting a name conflict, allowing both DLLs to be loaded successfully. The name is then restored/swapped to achieve the final replacement state.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent makes the DLL file names dynamic rather than static. The file names are changed temporarily during the loading process and then swapped to achieve the final state. This dynamic name manipulation allows the system to temporarily bypass the static name-checking mechanism of Windows CE.

Inventive Principle:
Principle #15Dynamics

3Ease of operation

If the hook DLL is loaded first with the same name as the target DLL, then the target DLL cannot be loaded, but if the target DLL is loaded first, the hook DLL cannot replace it

Engineering Contradiction:
ImproveDLL loading sequence flexibilityVSAvoidDLL replacement success
Core Design Contradiction:
Ease of operationVSAdaptability or versatility

Solution Approach 1:

Regardless of which DLL is loaded first, the patent applies a preliminary action of changing the file name of one DLL to a temporary name. This preliminary name change enables the second DLL to be loaded successfully. After both are loaded, the names are swapped to achieve the proper replacement relationship.

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentUS8997074B1Dynamic linking library (DLL) replacement in an embedded operating system environment
Publication Date: 2015.03.31 TREND MICRO INC
  • US8997074B1 patent drawing
  • US8997074B1 patent drawing
  • US8997074B1 patent drawing

AI summary

Techniques for replacing ROM-based (Read-Only Memory) DLLs (Dynamic Link Libraries) in a Windows CE type embedded operating system such that the target DLL is replaceable by the hook DLL, and the target DLL is callable by the hook DLL but not callable directly by any other applications after loading of the hook DLL. The techniques enable replacement irrespective whether the hook DLL and the target DLL have the same name and irrespective of which DLL is loaded first. The techniques change the file name of the target DLL in a list of loaded DLL modules by a trusted program that executes in the full kernel mode.