How hanzla2006/process-injection-with-indirect-syscalls-and-tartarus-gate works
This is a Windows x64 process-injection research program. Its workflow accepts a target PID, reads the current thread’s PEB to locate ntdll, resolves syscall numbers and legitimate syscall instruction addresses, then uses an assembly-mediated indirect syscall path to perform the injection and start a remote thread. The README documents the Tartarus Gate fallback for hooked stubs. The sampled C excerpt is partial, so the injection calls are represented at the payload-orchestrator level rather than as an asserted sequence of individual native calls.
Main entry points: indirectSyscalls.c CLI coordinator · indirectSyscallStubs.asm Indirect syscall stub · structs.h PEB/TEB layouts
Components 13
Coordination
- CLI coordinator
indirectSyscalls/indirectSyscalls.c
Syscall Resolution
- TEB access
indirectSyscalls/indirectSyscalls.c - Export parsing
indirectSyscalls/indirectSyscalls.c - Name hashing
indirectSyscalls/indirectSyscalls.c - VX table resolver
indirectSyscalls/indirectSyscalls.c - Neighbor recovery
indirectSyscalls/indirectSyscalls.c
Injection
- Injection payload
indirectSyscalls/indirectSyscalls.c - Indirect syscall stub
indirectSyscalls/indirectSyscallStubs.asm
Native Internals
- PEB/TEB layouts
indirectSyscalls/structs.h
Other components
- PID user
- Loaded ntdll
- Windows kernel
- Target process
Connections 15
- PID user → CLI coordinator: provides PID
- CLI coordinator → TEB access: reads TEB
- TEB access → PEB/TEB layouts: uses layouts
- TEB access → Loaded ntdll: locates module
- CLI coordinator → Export parsing: parses exports
- Export parsing → Loaded ntdll: reads image
- CLI coordinator → VX table resolver: resolves calls
- VX table resolver → Name hashing: hashes names
- VX table resolver → Neighbor recovery: recovers hooked stubs
- Neighbor recovery → Loaded ntdll: scans neighboring stubs
- CLI coordinator → Injection payload: invokes payload
- Injection payload → Indirect syscall stub: dispatches syscalls
- Indirect syscall stub → Loaded ntdll: jumps to syscall
- Indirect syscall stub → Windows kernel: enters kernel
- Injection payload → Target process: injects and starts thread