Abstract
Dynamic binary analysis is essential for security research, yet traditional software-based instrumentation tools suffer from significant performance overhead and are easily detected by adversarial malware. This paper introduces LibIHT, a hardware-assisted framework that leverages Intel's Last Branch Record (LBR) and Branch Trace Store (BTS) features to perform transparent, high-fidelity execution tracing. By shifting monitoring logic into the kernel and hardware, LibIHT achieves near-native performance and remains invisible to common evasion techniques.
Introduction
Malware analysis and reverse engineering rely heavily on dynamic binary analysis—the process of observing a program's behavior during execution. Industry-standard tools like Intel Pin and DynamoRIO achieve this through software instrumentation, injecting monitoring code directly into the target process. However, this approach introduces two critical vulnerabilities: massive performance overhead (often exceeding 100x) and high detectability. Malware frequently employs "anti-analysis" tricks, such as checking for timing discrepancies or searching for code-cache artifacts, to hide its malicious intent when it detects these tools.
Methodology: Hardware-Assisted Tracing
LibIHT addresses these challenges by replacing software hooks with hardware-level branch tracing. It utilizes two specific Intel processor features:
- Last Branch Record (LBR): High-speed registers providing a snapshot of the most recent control-flow transfers.
- Branch Trace Store (BTS): A hardware mechanism that logs every branch taken by the CPU into a dedicated memory buffer.
System Architecture
The LibIHT framework is divided into two primary components to ensure both efficiency and stealth:
- Kernel-Space Module (Ring-0): This module interacts directly with the CPU to configure tracing and manage raw data storage in protected memory. By operating at the kernel level, the tracing process remains invisible to user-space applications.
- User-Space Library: This component retrieves raw branch data via secure system calls (
ioctl) and reconstructs the program's Control-Flow Graph (CFG), mapping every path taken during execution.
Evaluation and Results
The researchers evaluated LibIHT against standard GNU coreutils for performance and a suite of 10 adversarial malware samples for evasion resistance.
Performance and Accuracy
LibIHT demonstrates a significant leap in efficiency. While Intel Pin and DynamoRIO showed average slowdowns of 1,053x and 237x respectively, LibIHT maintained an average slowdown of only 7x. Despite the "coarse" nature of hardware branch data, LibIHT achieved over 98% accuracy in CFG reconstruction and 99.48% basic block coverage.
Evasion Resistance
In adversarial testing, LibIHT remained undetected by 100% of the evasion techniques used by the PoC malware. In contrast, traditional software-based tools were consistently flagged due to their internal artifacts or the significant timing anomalies they introduced.
Discussion and Future Work
LibIHT proves that shifting analysis to the hardware level can effectively bypass the "arms race" between malware and analysis tools. However, some limitations remain. Currently, LibIHT focuses on control-flow (branches) and does not capture specific data values or memory accesses. Furthermore, the implementation is currently specific to Intel hardware.
Future research could explore hybrid approaches: using LibIHT's lightweight hardware tracing to identify suspicious "areas of interest" and then selectively applying software instrumentation for deeper forensic inspection of data states.
Summary updated