How ultrasound123d/winsockpacketeditor works
Project type and purpose
• This is a Windows desktop application (“Winsock Packet Editor” or WPE x64) built with C#/.NET Framework 4.8.
• Its purpose is to intercept, inspect, modify, and replay WinSock network packets from target processes. It supports two modes: in-process injection (via EasyHook) and an external SOCKS proxy.
File structure
Top-level solution:
• WinSockPacketEditor.sln – Visual Studio solution.
• Two projects:
– WPELibrary (class library + WinForms UI + EasyHook services)
– WinsockPacketEditor (WinForms UI “host” + injection launcher + Web-based UI)
• Each project has:
– x86 and x64 folders containing compiled hook services (EasyHook32Svc.exe, EasyHook64Svc.exe).
– Lib/NativeMethods for P/Invoke wrappers around WinSock and Windows APIs.
– Web and WebAPI folders for built-in HTTP UI and REST controllers.
– UserControl and multiple Form *.cs files for UI screens (proxy, filters, packet views, robots).
– app.config, packages.config, .csproj for .NET build and dependencies.
Readme insights
• Core technologies: C#/.NET Framework 4.8, EasyHook for injection, multi-threading, message queue.
• Deployment: ClickOnce auto-update, online/offline modes.
• Architecture: two modes of interception, advanced filters, programmable robots, REST/WebUI for remote control.
Main components
a. Client UI (WinForms)
– Packet Editor Form
– Injector Form
– Filter, Compare, Send, Robot configuration Forms
– Process list Form
b. Interceptor Services (x86 & x64)
– EasyHook32Svc.exe / EasyHook64Svc.exe
– DLL hook handlers (WinSockHook.cs)
– Message queue buffer
c. Application Core (WPELibrary/WinsockPacketEditor)
– Injection Manager (select target, call EasyHook API)
– Proxy Mode Manager (embedded SOCKS5 server, port mapping)
– Packet Processing Engine (Socket_*.cs classes)
– Robot Engine (Socket_Robot.cs + triggers)
– Filter Engine (Socket_FilterInfo.cs)
– WebAPI Controllers (CCProxy_Controller, ProxyAccount_Controller, etc.)
– Local Configuration Store (app.config, Resources.resx, settings persistence)
d. External Dependencies
– Target Processes (games, browsers, emulators)
– WinSock APIs (Kernel32, WS2_32, User32)
– .NET runtime
– Network / SOCKS upstream servers
– ClickOnce update server
Relationships and data flows
• UI ↔ Core: user actions (inject, start proxy, apply filters) invoke Core services via in-process calls.
• Core ↔ Interceptor Services:
• Injection mode: Core uses EasyHook to inject hook DLL into target → hook DLL intercepts WinSock calls → sends raw packets back via IPC or memory-mapped queue.
• Proxy mode: Core hosts a local SOCKS server → target process traffic routed through this server → Core inspects/modifies packets.
• Interceptor Services → Core: intercepted packets flow into the Message Queue → Core dispatches to UI, Filter Engine, Robot Engine, and WebAPI.
• Core → WebAPI / Web UI: local HTTP server exposes REST endpoints → Web UI (HTML/JS files) communicates via AJAX to display packet logs and controls.
• Core → Persistence: configuration and logs saved to resources or local files on change.
Architectural patterns and design principles
• Layered architecture (UI layer, Application/Core layer, Hook/Service layer, Infrastructure).
• Plugin-style injection via EasyHook (decoupling host and hook code).
• Asynchronous message queue for packet buffering (producer/consumer).
• MVC-like controllers for WebAPI.
• Multi-threading for non-blocking packet processing.
Essential architectural elements to capture
• Dual-mode interception entry points (Injection vs. SOCKS proxy).
• EasyHook service processes running out-of-process.
• Central message queue buffering.
• UI forms and WebUI as distinct presentation channels.
• Packet Processing Engine, Filter Engine, Robot Engine as sub-modules within Core.
• Persistence and auto-update mechanism.