Skip to main content

Advanced application proxy debugger and F12-style web console

Project description

🚀 h4-debug

The Universal Application Proxy Debugger & F12-Style Web Console


h4-debug is a ridiculously powerful, injection-free, cross-language runtime debugger. It seamlessly attaches to arbitrary scripts, applications, and native Windows executables to stream highly detailed runtime telemetry (Console, Network, Disk, Exceptions, and System Events) to an elegant, real-time web dashboard.


📖 Table of Contents


🛡 The Core Philosophy (Why No Injection?)

In the world of application tracing and reverse engineering, a common approach to gathering deep runtime telemetry is Dynamic API Hooking (e.g., injecting custom DLLs, patching memory in real-time using trampolines, or running Kernel-mode ETW rootkits).

h4-debug rejects this methodology completely.

Instead of mutating the target process or injecting rogue binaries, h4-debug achieves perfect observability through 100% native, sanctioned OS and runtime APIs.

Why is this better?

  1. Zero Anti-Cheat / DRM Tripping: By avoiding memory modification, h4-debug runs perfectly against heavily guarded applications. We act as a legitimate OS-level debugger, rather than operating like malware.
  2. Infinite Stability: API hooking is notorious for causing arbitrary segmentation faults, race conditions, and application crashes. By using passive OS telemetry and standard runtime intercepts, the target application runs with maximum stability.
  3. No Rootkits Required: You do not need to compile or install dangerous kernel-mode drivers to get network and disk observability.
  4. Universal Compatibility: Our architecture allows us to drop in and debug Python, Node.js, and raw .exe binaries with the exact same UX.

⚙ How It Works Under the Hood

The h4-debug architecture consists of two primary components:

  1. The Telemetry Server: A fast, asynchronous FastAPI instance managing real-time WebSocket connections and serving the UI dashboard.
  2. The Handlers / Interceptors: Language/target-specific wrappers that boot the target application and transparently route its telemetry back to the server.

Native Executables (Windows Native Debugger)

When you run h4-debug app.exe, the tool leverages the raw Windows Win32 Debugging API (kernel32.dll) via ctypes.

  • Event Loop Integration: We spawn the process using CreateProcessW with the DEBUG_PROCESS flag. We then capture WaitForDebugEvent, natively intercepting CREATE_PROCESS_DEBUG_EVENT, LOAD_DLL_DEBUG_EVENT, thread lifecycles, and unhandled exceptions.
  • Hidden Debug Strings: GUI applications (like Unity mods, game launchers, or heavy desktop apps) do not pipe logs to stdout. Instead, they typically use OutputDebugString. h4-debug intercepts OUTPUT_DEBUG_STRING_EVENT, uses ReadProcessMemory to safely read the buffer in real-time, and routes it to your console.
  • Piped stdout/stderr: For console-based native applications, we dynamically generate anonymous pipes (CreatePipe) equipped with STARTF_USESTDHANDLES to natively capture all standard command-line output.
  • Disk & Network Polling: Because we refuse to inject DLLs to hook ws2_32.dll (Network) or ntdll.dll (Disk), we launch a hyper-efficient, high-frequency background daemon (psutil). This daemon polls the target process 10 times a second, intelligently indexing newly opened file descriptors (fd) and newly active TCP/UDP endpoints, streaming live Disk and Network events directly to the dashboard.

(Note: Debugging installers or protected executables often requires Administrator privileges. h4-debug gracefully detects ERROR_ACCESS_DENIED [Error 5] or ERROR_ELEVATION_REQUIRED [Error 740] and halts, prompting you to elevate your terminal rather than crashing).

Node.js Deep Hooking

When you execute h4-debug node app.js, the tool dynamically sets the NODE_OPTIONS=--require ... environment variable before executing the Node binary.

  • Console & Errors: Overrides console.log, console.error, etc., intercepting the arguments and beaming them to the dashboard before passing them along to the original stdout. Automatically catches uncaughtException and unhandledRejection.
  • Network Interception: Hot-patches the native http.request and https.request modules to trace the exact URL, method, and protocol of outbound network calls.
  • Disk Tracing: Hooks raw filesystem methods like fs.open, fs.readFile, and fs.writeFile, logging the file paths being accessed.

Python Introspection

For h4-debug python main.py, the debugger alters PYTHONPATH and injects a custom sitecustomize.py.

  • Seamless Boot: Because sitecustomize.py is loaded before any user code executes, we establish the Telemetry Client instantly.
  • Module Hooking: We hot-patch sys.stdout and sys.stderr to mirror all terminal output. We also monkey-patch popular HTTP libraries (like urllib, requests, and aiohttp) to provide granular network request visibility.

📦 Installation

Install globally via pip:

pip install h4-debug --upgrade

Requires Python 3.8+


🚀 Usage

Using h4-debug is incredibly simple. Just prefix your standard commands with h4-debug:

1. Debug a Windows Executable (GUI or Console):

# Note: Run your terminal as Administrator if the .exe requires elevation!
h4-debug installer.exe --silent
h4-debug game_launcher.exe

2. Debug a Node.js Application:

h4-debug node index.js
h4-debug npm start

3. Debug a Python Script:

h4-debug python app.py

The Dashboard

Once executed, h4-debug immediately spins up a local web server (usually at http://localhost:8999) and provides a URL in the terminal. Open that URL to view the real-time F12-style developer dashboard!

The dashboard is broken into intuitive tabs:

  • Console: See standard output, errors, and native OutputDebugString traces.
  • Network: Monitor outbound HTTP/HTTPS connections and raw TCP/UDP socket activity.
  • Disk: Track file read/write operations and active open file handles.
  • System: Observe process creation, DLL loads, unhandled exceptions, and debugger state.

🛠 Advanced Details & Edge Cases

The "Access Denied" Error (Native Debugging)

If you attempt to debug a Windows executable and immediately see an Error 5 or Error 740 in your terminal or dashboard, this means the OS has rejected the debugger attachment.

  • The Fix: This is an intended security mechanism in Windows. If an application requests Administrative privileges in its manifest, a non-elevated debugger cannot attach to it. Simply close your terminal, re-open it as Administrator, and run the command again.

The Network / Disk Polling Interval

The native execution wrapper utilizes a 10Hz (0.1s) polling loop to track open files and socket connections without risking application stability. While this is incredibly robust and will catch the vast majority of I/O (like an installer downloading a payload), microsecond-length file touches might occasionally slip past the poll. This is a deliberate architectural trade-off to ensure 100% stability and zero injection risk.


Built for developers who demand total observability without compromising stability.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

h4_debug-0.2.4.tar.gz (26.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

h4_debug-0.2.4-py3-none-any.whl (24.8 kB view details)

Uploaded Python 3

File details

Details for the file h4_debug-0.2.4.tar.gz.

File metadata

  • Download URL: h4_debug-0.2.4.tar.gz
  • Upload date:
  • Size: 26.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for h4_debug-0.2.4.tar.gz
Algorithm Hash digest
SHA256 be83a18262363e04dd0c60c98e9310ec310e3e92d94184205ec821ba86202c11
MD5 fa7d016a7f025df0d8b98a40d098d40e
BLAKE2b-256 0e0ba230e53d535e5c0314dab05afeafcf9e2da06a964bacc9e3e04f3aeee02e

See more details on using hashes here.

File details

Details for the file h4_debug-0.2.4-py3-none-any.whl.

File metadata

  • Download URL: h4_debug-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 24.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for h4_debug-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 6e6c4118fed54312473387db368bbd74620a9b0d0ac33e793b85369b1662ffa5
MD5 2ebd25b178d0db2148aad2853526a5a4
BLAKE2b-256 c057bd211d1f2dae2e50bd9cbe683b183c03264882bcc262574ef867846777fa

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page