How d3ext/hooka works
Hooka is a command-line shellcode-loader generator, with a Go library exposing related capabilities. Its principal workflow is to select or obtain a payload, configure encoding and evasion options, and generate an EXE or DLL loader using a chosen execution technique. The README documents the generator’s capabilities; the excerpts show CLI-side generation and library wrappers, but not the complete dispatch path. The graph therefore uses documented relationships for that workflow and avoids inferring unshown internal calls.
Main entry points: main.go Generator CLI · hooka/shellcode.go Execution API · hooka Public library · utils/shellcode.go Payload input
Components 22
Loader generation
- Generator CLI
cmd/main.go - Generated loader
cmd/main.go
Payload handling
- Payload input
utils/shellcode.go - DLL conversion
utils/dll.go - Payload encryption
utils/aes.go - 3DES encryption
utils/3des.go - RC4 encryption
utils/rc4.go - XOR encryption
utils/xor.go
Execution techniques
- Execution API
pkg/hooka/shellcode.go - Suspended process
shellcode/createprocess.go - Process hollowing
shellcode/processhollowing.go - NtCreateThreadEx
shellcode/ntcreatethreadex.go - ETW thread
shellcode/etwpcreateetwthread.go - APC injection
shellcode/ntqueueapcthreadex.go - No-RWX technique
shellcode/no-rwx.go
Evasion and inspection
- Evasion capabilities
evasion - Sandbox checks
evasion/sandbox.go - Hook removal
evasion/unhook.go - API hashing
evasion/hashing.go
Library and utilities
- Public library
pkg/hooka - Utility functions
utils
Other components
- CLI user
Connections 21
- CLI user → Generator CLI: configures
README.md - Generator CLI → Payload input: accepts payload
README.md - Generator CLI → Generated loader: generates
README.md - Generator CLI → Execution API: selects technique
README.md - Generator CLI → Evasion capabilities: configures
README.md - Generator CLI → Payload encryption: encrypts payload
cmd/main.go - Generator CLI → 3DES encryption: encrypts payload
README.md - Generator CLI → RC4 encryption: encrypts payload
README.md - Generator CLI → XOR encryption: encrypts payload
README.md - Execution API → Suspended process: delegates to
pkg/hooka/shellcode.go - Execution API → Process hollowing: delegates to
pkg/hooka/shellcode.go - Execution API → NtCreateThreadEx: delegates to
pkg/hooka/shellcode.go - Execution API → ETW thread: delegates to
pkg/hooka/shellcode.go - Execution API → APC injection: delegates to
pkg/hooka/shellcode.go - Execution API → No-RWX technique: delegates to
pkg/hooka/shellcode.go - Public library → Execution API: exposes
pkg/hooka/shellcode.go - Public library → DLL conversion: exposes
pkg/hooka/dll.go - Public library → Sandbox checks: exposes
pkg/hooka/sandbox.go - Public library → Hook removal: exposes
pkg/hooka/unhook.go - Public library → API hashing: exposes
pkg/hooka/hashing.go - Generator CLI → Utility functions: uses helpers
cmd/main.go