Code Obfuscation via Stack Buffer Copying

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing computer software security measures, particularly code obfuscation, face challenges in protecting against reverse-engineering attacks, especially memory tracing, which simplifies the process for attackers by allowing them to track modifications and accesses in memory buffers, leading to potential degradation in code execution performance.

Innovation Solution

An obfuscation technique that modifies source or compiled code by copying or replacing buffer contents into local variables stored on the stack memory, using indirection through memory pointers, making it difficult for attackers to track memory modifications and accesses, while maintaining performance comparable to the original code.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If code morphing is used to obfuscate compiled code, then security against reverse-engineering is improved, but execution time is increased

Engineering Contradiction:
ImprovesecurityVSAvoidexecution time
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The patent applies code morphing selectively only to critical portions of the program (such as security-sensitive functions and data structures) rather than the entire codebase. This partial application maintains security for critical areas while avoiding the performance penalty of obfuscating non-critical code, thus resolving the contradiction between security improvement and execution time maintenance.

Inventive Principle:
Principle #16Partial or excessive action

2Reliability

If conventional obfuscation techniques are used, then security is improved, but code complexity is increased

Engineering Contradiction:
ImprovesecurityVSAvoidcode complexity
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The patent applies different obfuscation strategies to different parts of the code based on their security requirements. Critical sections receive morphing treatment while non-critical sections remain in their original form. This localized approach improves security where needed without unnecessarily complicating the entire codebase, resolving the contradiction between security and code complexity.

Inventive Principle:
Principle #3Local quality

3Productivity

If memory tracing is not protected, then code execution performance is maintained, but security against reverse-engineering is degraded

Engineering Contradiction:
Improvecode execution performanceVSAvoidsecurity
Core Design Contradiction:
ProductivityVSReliability

Solution Approach 1:

The patent introduces intermediary code (morphed code) that sits between the original code and the memory tracing attack. This intermediary layer performs additional operations that obscure the actual data flows and memory accesses, making it difficult for attackers to trace memory while maintaining the functional correctness and performance of the original code through semantic equivalence.

Inventive Principle:
Principle #24Intermediary (Mediator)

Data Source

PatentUS8775826B2Counteracting memory tracing on computing systems by code obfuscation
Publication Date: 2014.07.08 APPLE INC
  • US8775826B2 patent drawing
  • US8775826B2 patent drawing
  • US8775826B2 patent drawing

AI summary

Method and apparatus for obfuscating computer software code, to protect against reverse-engineering of the code. The obfuscation here is on the part of the code that accesses buffers (memory locations). Further, the obfuscation process copies or replaces parts of the buffer contents with local variables. This obfuscation is typically carried out by suitably annotating (modifying) the original source code.