qltool CLI

qltool CLI

Command-line tool for quick binary and shellcode emulation.

Commands

CommandDescription
runEmulate a program binary
codeExecute shellcode
qltuiTerminal UI for qltool
examplesPrint usage examples

run Options

OptionShortArgumentDescription
--filename-ffilenameBinary to emulate
--rootfsdirnameEmulation root directory
--argsProgram command line arguments

code Options

OptionShortArgumentDescription
--filename-ffilenameInput file
--input-ihexHex string input (when --format hex)
--formatasm/hex/binInput format
--archx86, x8664, arm, arm_thumb, arm64, mips, a8086, evmTarget architecture
--endianlittle/bigEndianness (default: little)
--oslinux, freebsd, macos, windows, uefi, dos, evmTarget OS

When --format hex: reads from --input first, falls back to --filename.

Common Options

OptionShortArgumentDescription
--verbose-voff/default/debug/disasm/dumpLogging verbosity
--envfilenamePickle file or Python dict string for environment
--gdb-g[server:port]Enable GDB server
--qdbAttach Qdb at entry point (MIPS/ARM thumb only)
--rrEnable record-and-replay (requires --qdb)
--profilefilenameProfile file path
--no-consoleSuppress program stdout
--filter-eregexpFilter log output by regex
--log-filefilenameWrite log to file
--log-plainNo color in log output
--rootEnable sudo-required mode
--debug-stopStop on first error (requires debug/dump verbose)
--multithread-mMulti-threaded emulation
--timeoutmicrosecondsEmulation timeout (1000000μs = 1s)
--coverage-file-cfilenameCoverage output file
--coverage-formatdrcov/drcov_exactCoverage file format
--jsonEmit JSON emulation report

Examples

 1# Shellcode from hex file
 2./qltool code --os linux --arch arm --format hex -f examples/shellcodes/linarm32_tcp_reverse_shell.hex
 3
 4# Shellcode from assembly file
 5./qltool code --os linux --arch x86 --format asm -f examples/shellcodes/lin32_execve.asm
 6
 7# Binary emulation
 8./qltool run -f examples/rootfs/x8664_linux/bin/x8664_hello --rootfs examples/rootfs/x8664_linux/
 9
10# MIPS binary
11./qltool run -f examples/rootfs/mips32el_linux/bin/mips32el_hello --rootfs examples/rootfs/mips32el_linux
12
13# UEFI binary with environment pickle
14./qltool run -f examples/rootfs/x8664_efi/bin/TcgPlatformSetupPolicy --rootfs examples/rootfs/x8664_efi --env examples/rootfs/x8664_efi/rom2_nvar.pickel
15
16# GDB server
17./qltool run -f examples/rootfs/x8664_linux/bin/x8664_hello --gdb 127.0.0.1:9999 --rootfs examples/rootfs/x8664_linux
18
19# Binary with arguments
20./qltool run -f examples/rootfs/x8664_linux/bin/x8664_args --rootfs examples/rootfs/x8664_linux --args test1 test2 test3
21
22# Disassembly output
23./qltool run -f examples/rootfs/mips32el_linux/bin/mips32el_hello --rootfs examples/rootfs/mips32el_linux --verbose disasm
24
25# With LD_PRELOAD
26./qltool run -f examples/rootfs/x8664_linux/bin/tester --rootfs examples/rootfs/x8664_linux --env '{"LD_PRELOAD":"hijack.so"}' --verbose debug
27
28# Launch TUI
29./qltool qltui