Skip to content

ZeroTrace HID

Utility Commands

Timing, flow control, variables, LED, storage, and system commands for ZeroTrace payloads

Utility commands cover everything that isn't keystrokes or pointer input — pauses, flow control, variables, the on‑board LED, mass storage, and device/system actions.

How arguments work

Every argument is expanded first, so ${var}$ and operators like _$random(...) work anywhere. Argument counts are matched exactly — a command given the wrong number of arguments is silently skipped.

Timing

Pauses execution for ms milliseconds. Negative values are treated as 0; a single delay is capped at 1 hour (3,600,000 ms).

delay 1000

defaultdelay, which inserts a fixed pause after every eligible line, is documented with the keyboard timing commands — it is consumed once, before the script runs.

Flow control

Ends the running script immediately. exit is an alias. Typically paired with an IF branch to bail out early.

_$VAR os = "_@detectedOS"
IF "${os}$" is not "windows"
stop
IF_END

Variables and math

Assigns a value to a variable. Reference it later as ${name}$.

set counter 0
set target 'Windows'

LED

The device drives a single addressable pixel. Colors are 0255 per channel.

Sets the LED to a solid RGB color.

ledColor 255 0 0
ledColor 0 255 100

Storage

Mounts the device to the host as a USB mass‑storage volume. Bringing the volume up self‑sequences a detach → configure → reattach and blocks about 650 ms — account for that pause in scripts.

storageMode "MYDISK" "1234" "5678"

Arguments: <volumeName> <productId> <vendorId>.

Device and system

Restarts the device.

reboot
Irreversible commands

selfDestruct erases the whole flash chip and formatStorage wipes the filesystem — neither can be undone. Guard them behind conditions and test payloads without them first.

Related feature commands

Two commands live with their own feature pages rather than here:

  • bruteForceBrute Force
  • watchdog — the WiFi geofence routine (its numeric arguments are parsed as 8‑bit values, 0255).

Command Palette

Search for a command to run...