2026-09-01 (injector exhaustive diagnostic logging instrumentation) (D292)
Instrumented the entire injection and process control pipeline with exhaustive diagnostic telemetry to eliminate trial-and-error round trips during hardware verification:
- Target Discovery Telemetry
(
src/injector/target.c):- Every evaluated process logs PID, UID, comm name, and classification
(
skip system procvs>>> candidate user proc). - Logs
kprocanducredkernel virtual addresses for all candidate userland processes. - Explicitly logs Title ID matching details and candidate selection reasoning.
- Every evaluated process logs PID, UID, comm name, and classification
(
- Credential & Prison Telemetry
(
src/injector/krw.c):- Logs
my_ucredandtarget_ucredkernel virtual addresses alongside their respectivecr_prisonjail pointer addresses (ucred + 0x30). - Logs original and elevated auth IDs, capabilities, attribute flags,
and UID triplets (
cr_uid,cr_ruid,cr_svuid). - Thread scanner logs calling thread
tdpointer, resolvedtd_ucredoffset (verified0x140), previous credential address, and patched address.
- Logs
- Process Control & Remote Syscall Telemetry
(
src/injector/procctl.c):procctl_attach: Inspects targetstruct procin kernel memory prior to attachment, logging targetkproc,p_flag(offset0xB0), andp_state(offset0x08). Logs return code, errno, andwait4stop signal details.- All ptrace helpers (
step,continue,getregs,setregs,copyin,copyout,detach) log target addresses and POSIX errno on any failure. procctl_remote_syscall: Logs syscall number, single-stepping step count, safety loop guard (2000 steps max), and returned%rax.procctl_remote_mmap: Logs requested virtual address, length, protection flags, and allocated base.
- Remote Loader Telemetry
(
src/injector/loader.c):- Logs ELF header
e_entry,e_phnum, total virtual size, and allocatedtarget_base. - Every
PT_LOADsegment logs its index, destination virtual address,p_filesz,p_memsz, and protection mask. - Logs final calculated entry point address.
- Logs ELF header
- Injector Lifecycle Telemetry
(
src/injector/injector.c):- Logs
payload_argsaddresses (kpipe_addr,kdata_base_addr). - Logs pre-hijack thread register state (
RIP,RSP,RBP,RAX,RFLAGS). - Logs post-hijack target register state (
RIP,RSP,RDI). - Reads back and verifies target thread registers via
procctl_getregs()afterprocctl_setregs(). - Logs
procctl_detach()return code.
- Logs
Verified: make payload injector HARDWARE=1
(9,394,336 bytes) compiles 100% clean with zero warnings
and zero errors.