usbhid-dump(8)
โจ usbhid-dump(8) โ NAME โจ
usbhid-dump ๐ฆ is the tool that lets you dump USB HID device report descriptors and streams. Iconic, right?
๐ SYNOPSIS ๐
usbhid-dump [OPTION]...
๐ DESCRIPTION ๐
okay so usbhid-dump uses libusb to dump report descriptors and streams from HID (human interface device) interfaces of USB devices. By default it dumps HID interfaces of all connected USB devices, but you can narrow it down to a subset of them, or to a single interface, using options. main character energy ๐
๐จ NOTE: usbhid-dump detaches kernel drivers from the interfaces it dumps and uses them exclusively, so no other program receives the input in the meantime. The report descriptor dumping is instantaneous, but the stream dumping keeps going until you terminate it with SIGINT (^C from the terminal) or a timeout expires.
bestie, listen ๐ซถ if you accidentally start dumping a stream from the USB keyboard you're using to control the terminal, the system stops receiving your input and you can't terminate usbhid-dump. ๐ Just stop typing and wait for the timeout to expire. The stream dumping will stop, the keyboard gets reattached to the kernel driver, and you'll regain control. phew ๐ญ
The default stream dumping timeout is 60 seconds, and you can change it with the -t option. โฐ
๐ OPTIONS ๐
-h,--helpโ Output a help message and exit. ๐ธ-v,--versionโ Output version information and exit. โจ-s,-a,--address=bus[:dev]โ Limit interfaces by bus number and device address. Both are 1-255, decimal. Zeroes match any bus or device. ๐ง-d,-m,--model=vid[:pid]โ Limit interfaces by device vendor and product IDs. Both are 1-FFFF, hexadecimal. Zeroes match any vendor or product. ๐-i,--interface=NUMBERโ Limit interfaces by number (0-254), decimal. 255 matches any interface. ๐ฆ-e,--entity=STRINGโ The entity to dump: either "descriptor", "stream" or "all". You can shorten it down to one letter. The default is "descriptor". ๐-t,--stream-timeout=NUMBERโ Stream interrupt transfer timeout, in ms. Zero means infinity. The default is 60000 (60 seconds). โณ-p,--stream-pausedโ Start with the stream dump output paused. ๐-f,--stream-feedbackโ Enable stream dumping feedback: print a dot to stderr for every transfer dumped. ๐
๐ SIGNALS ๐
USR1/USR2โ Pause/resume stream dump output. ๐ฅ
๐งพ OUTPUT FORMAT ๐งพ
okay so usbhid-dump outputs dumps in chunks. Each chunk is separated by an empty line and starts with this header line:
BUS:DEVICE:INTERFACE:ENTITY TIMESTAMP
Here, BUS, DEVICE and INTERFACE are the bus, device and interface numbers respectively. ENTITY is either "DESCRIPTOR" or "STREAM". TIMESTAMP is the timestamp in seconds since epoch. โ
After the header, the actual dump data follows as hex bytes. A descriptor chunk includes the whole report descriptor. Every stream chunk usually includes a whole report, but if a report is bigger than the endpoint's wMaxPacketSize, it will span several chunks. ๐งฉ
๐ EXAMPLES ๐
Dump the report descriptor for a device with address 3 on bus number 2: ๐ป
usbhid-dump -a 2:3
Dump the report stream for a device with vendor ID 0x5543 and product ID 0x0005: ๐ฎ
usbhid-dump -m 5543:0005 -es
Dump the report descriptor from interface 1 of a device with vendor ID 0x5543: ๐
usbhid-dump -m 5543 -i 1 -ed
Dump report streams from all HID interfaces of all USB devices (caution: you will lose control over the terminal if you use a USB keyboard): โ ๏ธ
usbhid-dump -es
๐ AUTHOR ๐
Nikolai Kondrashov <spbnick@gmail.com> ๐ซถ
bestie, this was the usbutils package's usbhid-dump(8) page from the Linux USB Utilities set, last updated February 2012. Go slay your HID devices responsibly ๐ โจ๐ฆ
๐ฆ where this page comes from
- alpine 3.22: usbutils-doc 018-r0 ยท GPL-2.0-or-later
- alpine 3.23: usbutils-doc 019-r0 ยท GPL-2.0-or-later
- alpine 3.24: usbutils-doc 019-r0 ยท GPL-2.0-or-later
- arch rolling: usbutils 019-1
- arch rolling: usbutils 020-1 ยท GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-only AND LGPL-2.1-or-later AND MIT
- centos-stream 10: usbutils 018-1.el10 ยท GPL-2.0-or-later
- debian trixie: usbutils 1:018-2 ยท GPL-2.0-only OR GPL-3.0-only
- fedora 43: usbutils 018-4.fc43 ยท GPL-2.0-or-later
- fedora 44: usbutils 019-2.fc44 ยท GPL-2.0-or-later
- nixos 26.05: usbutils 019
- nixpkgs unstable: usbutils 019
- ubuntu questing: usbutils 1:018-2 ยท GPL-2.0-only OR GPL-3.0-only
- ubuntu resolute: usbutils 1:019-1 ยท GPL-2.0-only OR GPL-3.0-only
- ubuntu stonking: usbutils 1:019-1 ยท GPL-2.0-only OR GPL-3.0-only
- ๐ the page's license: GPL-2.0-or-later
- ๐ girlified by anthropic/claude-haiku-5.5 on : a language model's rewrite of the original, under its terms