Skip to content

About

A lightweight C++ client-server suite for low-level remote typing automation using TCP sockets and the Windows Interception driver.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

KeyBridge Suite

KeyBridge Suite is a low-level remote typing automation toolkit for Windows. It bridges TCP network communication with low-level kernel input simulation using the Interception driver.

The system consists of two standalone components:

  1. Server Daemon (sock2key): A background service that listens on TCP port 8080, enumerates network interfaces, intercepts keyboard input via hardware scan codes, and executes automated keystroke injection.
  2. Client GUI (key2sock): A lightweight, native Win32 graphical application designed to connect to the server and transmit text payloads across the network.

Features

  • Kernel-Level Input Injection: Uses the Interception driver to inject hardware Set-1 Scan Codes directly into the OS input stream, bypassing standard SendInput limitations.
  • Hardware Hotkey Triggers: Start, stop, or resume typing tasks on-the-fly using configurable keyboard triggers (ESC and Right Shift by default).
  • Network Interface Enumeration: Automatically discovers and displays active IPv4 addresses (Ethernet, Wi-Fi, VPNs, Loopback) on startup using Windows IP Helper (iphlpapi).
  • Resumable Typing Buffer: Tracks typed characters with an atomic cursor (written_index), allowing the user to pause and resume long texts without restarting from the beginning.
  • Pure Win32 GUI: Minimal footprint client with zero external UI runtime dependencies and CLI support for specifying the server IP.

Server Command-Line Options:

Flag Description
--set-key Interactively capture and configure custom trigger keys for Start and Resume.
--disable-key Prevents the configured trigger keys from being forwarded to the operating system when pressed.

Client Command-Line Options:

Flag Description
--host ipaddress Server address (this can be VPN or LAN).

Prerequisites

  • OS: Windows 10 / 11 (64-bit recommended)
  • Compiler: MinGW-w64 (g++ with C++20 support)
  • Driver: Interception Driver installed on the server machine.

Compilation

Ensure g++ is in your system PATH. Run the following commands from the root of the project:

1. Build the Server Daemon

g++ main.cpp ItServerSocket.cpp Logger.cpp -o server.exe -std=c++20  -L. -linterception -liphlpapi -lws2_32

2. Build the Client GUI

g++ client.cpp -o client.exe -std=c++20 -lws2_32 -lshell32 -mwindows

(The -mwindows flag ensures no background console window appears when launching the GUI).

Troubleshooting & Known Issues

"terminate called without an active exception" & Keyboard Lockup

If the server terminates abruptly (e.g., via forced exit or unhandled thread termination), the C++ runtime raises:

terminate called without an active exception

Why this happens:

  • The Interception driver hook remains attached to the operating system's input stream because interception_destroy_context() was not reached during the unexpected shutdown.
  • While the crashed process is still releasing handles, or until the program is fully closed, physical keyboard keystrokes may be missed, swallowed, or misinterpreted.

Resolution:

  1. Ensure the server process is completely closed (check Task Manager for any lingering server.exe instances and kill them).
  2. If the keyboard remains unresponsive or acts erratically, unplug and replug the keyboard, or restart the Interception driver service.
  3. Always shut down the server gracefully using Ctrl + C so the application can clean up the driver context properly.

About

A lightweight C++ client-server suite for low-level remote typing automation using TCP sockets and the Windows Interception driver.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages