Skip to content

Latest commit

ย 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ›ก๏ธ Obfus.h HIDE_STRING Dumper

Static Hidden String Recovery Tool for Obfus.h Protected Binaries


๐Ÿ“Œ Overview

Obfus.h HIDE_STRING Dumper is a specialized C++ analysis utility designed exclusively for detecting and reconstructing strings hidden by the HIDE_STRING macro from the Obfus.h TCC obfuscation framework.

Unlike generic string dumpers, this tool specifically targets the exact instruction patterns generated by Obfus.h during compile-time string protection. It statically parses Windows PE executables and rebuilds hidden plaintext strings directly from stack-based byte initialization sequences emitted by Tiny C Compiler (TCC).

The scanner identifies dynamically constructed strings without emulation, unpacking, or runtime execution.

Every recovered string is automatically resolved to its corresponding Virtual Address (VA), allowing instant navigation inside x64dbg, IDA Pro, Ghidra, or Binary Ninja.


๐Ÿš€ Features

  • โšก High-Speed Static PE Scanning
    Loads the target executable directly into memory for ultra-fast analysis.

  • ๐Ÿงต Obfus.h HIDE_STRING Reconstruction
    Detects the exact stack construction patterns generated by:

    • HIDE_STRING(...)
    • STACK_STRING(...)
    • Tiny C Compiler byte initialization code
  • ๐ŸŽฏ Virtual Address Resolution
    Converts raw file offsets into debugger-ready Virtual Addresses.

  • ๐Ÿ” TCC-Specific Pattern Matching
    Designed specifically around Tiny C Compiler opcode generation used by Obfus.h.

  • ๐Ÿง  PE Header Parsing
    Automatically processes:

    • DOS headers
    • NT headers
    • PE sections
    • ImageBase
    • RVA mappings
  • ๐Ÿ–ฅ๏ธ Colored Console Interface
    Styled hexadecimal reporting with debugger-friendly formatting.

  • ๐Ÿ“ฆ Zero Dependencies
    Pure WinAPI + standard C++ implementation.


๐Ÿ› ๏ธ Usage

Obfus.h HIDE_STRING Dumper is a command-line utility.

ObfusHide_StringDumper.exe <target_pe.exe>

Example:

ObfusHide_StringDumper.exe malware_sample.exe

๐Ÿ“„ Example Output

[+] Scanning file: malware_sample.exe (231424 bytes)

[VA: 0x000000014001A420 | File Offset: 0x00018820] -> "Hello World"
[VA: 0x000000014001A480 | File Offset: 0x00018880] -> "https://api.telegram.org"
[VA: 0x0000000140020F10 | File Offset: 0x0001F310] -> "Debugger detected"

[+] Found 3 hidden strings.

๐Ÿง  Under the Hood

How Obfus.h Hides Strings

The HIDE_STRING macro from Obfus.h avoids storing plaintext strings inside .rdata by constructing them byte-by-byte directly on the stack.

Original code:

HIDE_STRING("Hello World")

becomes something similar to:

mov eax, 48h
mov [rbp-0Fh], al

mov eax, 65h
mov [rbp-0Eh], al

mov eax, 6Ch
mov [rbp-0Dh], al

mov eax, 6Ch
mov [rbp-0Ch], al

mov eax, 6Fh
mov [rbp-0Bh], al

instead of the normal compiler output:

lea rax, "Hello World"

This removes plaintext strings from the binary data section and forces reconstruction at runtime.


Detection Engine

The scanner walks byte-by-byte through executable memory searching for exact instruction chains emitted by TCC and Obfus.h.

Supported patterns include:

B8 XX 00 00 00
88 45 YY

and stack-write variants:

C6 45 YY XX
C6 44 24 YY XX

When multiple sequential byte writes are detected, the tool reconstructs the original hidden string directly from opcode immediates.


โš™๏ธ Detection Logic

A string candidate is considered valid when:

  • Multiple sequential stack writes are detected
  • At least 4 printable characters are reconstructed
  • The opcode chain matches known Obfus.h/TCC generation patterns

Non-printable bytes are automatically filtered before output.


๐Ÿ”ฌ Designed For

Obfus.h analysis


๐Ÿ—๏ธ Build Instructions

The project targets Windows and is built using MSVC.

Requirements

  • Visual Studio 2019/2022
  • Windows SDK
  • C++17 recommended

Build

  1. Open the project in Visual Studio
  2. Select:
    • Release
    • x64 or x86
  3. Build the solution (Ctrl + Shift + B)

โš–๏ธ Disclaimer

This project is intended strictly for educational purposes, malware research, and authorized reverse engineering.

Do not use this software against systems or binaries you do not own or have permission to analyze.

About

๐Ÿ›ก๏ธ Static Obfus.h HIDE_STRING recovery tool for Windows PE binaries. Detects Tiny C Compiler (TCC) stack-based string construction patterns, reconstructs hidden plaintext strings, and resolves their Virtual Addresses (VA) for x64dbg, IDA Pro, Ghidra, and malware analysis.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages