How loof-sys/examplehook works
Project Type & Purpose
• A Windows-focused injection/hooking toolkit for “Discord voice hooks.”
• Multi‐stage chain: installer → kernel driver → injector → in‐process hook DLL → Discord voice pipeline → overlay UI.
Top-Level Components (from file tree)
• Setup/ Installer
– Setup/Setup.vcxproj, SystemMask.inf
• Kernel Driver
– SystemMask/systemmask.sys (source.cpp)
• Injector Layer
– Injector/Injector.exe (CreateRemoteThread + LoadLibrary)
– HiddenInjector/HiddenInjector.exe (manualmapper.cpp → stealth injection)
• Hook DLL
– ExampleHook/ExampleHook.dll
· dllmain.cpp, exceptions.cpp/.hpp
· Hook libraries: minhook/, hde/, trampoline.c/.h
· Audio codec: opus/ (celt & silk subfolders, include/, src/)
· UI: imgui/, implot/
· Scheduler: scheduler.cpp/.hpp/.asm
· Utilities: ini.hpp, offsets.cpp/.hpp, utils.cpp, window.cpp
• AntiScan DLL
– AntiScan/AntiScan.dll (minhook + ntdll API detours)
Interactions & Data-Flow
a. Installation Phase
• User runs Setup.exe → installs SystemMask.sys via SystemMask.inf.
• On boot, SystemMask.sys masks kernel handles to enable stealth.
b. Injection Phase
• User launches Injector.exe (standard) or HiddenInjector.exe (manual map).
• Injector locates Discord.exe → injects ExampleHook.dll + AntiScan.dll.
c. In-Process Hooking
• DllMain calls AntiScan to hook low-level APIs (hide modules).
• ExampleHook uses MinHook/HDE & trampolines to detour Discord voice functions in ntdll.
• Voice data path: intercepted calls → Opus engine (encode/decode) → Scheduler → original Discord logic.
• Config loader (ini.hpp) reads config.ini/boot.ini for offsets and settings.
Architectural Patterns & Key Libraries
– Multi-stage injection (user-mode + kernel stealth + manual map)
– Kernel-mode driver for concealment (masking objects)
– Function detouring via MinHook + HDE disassembler + trampolines
– Modular in-process plugin (ExampleHook.dll)
– Third-party libs: Opus (celt/silk), ImGui/ImPlot, manualmapper, scheduler
Key Details to Capture
– External cloud service to show where voice packets ultimately go.