# Vault 7: Projects

This publication series is about specific projects related to the Vault 7 main publication.

### Protego

# MLA -- USB Library

20 December, 2013

- 1
- 2
…
- 242
- 243
- 244
- 245
- 246
…
- 311
- 312

command when sent to the device firmware has no data payload.
Table: QUERY_DEVICE command format (when sent from the host to the device).
Packet Byte Content
0 QUERY_DEVICE (0x02)
1-63 (padding – init to 0x00)
After the QUERY_DEVICE command packet has been sent to the device firmware, the device responds with an USB IN
(that is, IN to the host) packet, with the format:
Table: QUERY_DEVICE response format (sent from USB device firmware to host PC GUI application)
Packet Byte Content
0 QUERY_DEVICE (0x02)
1 bytesPerPacket
2 deviceFamily
3 Type1
4-7 Address1
8-11 Size1
12 Type2
13-16 Address2
17-20 Size2
… …
48 Type6
49-52 Address6
53-56 Size6
57 versionFlag
58-63 (padding)
The bytesPerPacket indicates how many data bytes are sent in the write or read command data payload section.
The deviceFamily parameter indicates which device family (ex: PIC18, PIC24, PIC32, etc.) that is the current target. Type1,
Type2 etc. indicate the type of memory (ex: flash, EEPROM, User ID, config bits) that is targeted by this memory range
description.
Address1, Address2 etc. is the 32-bit starting address of the data range (in little endian format). Size1, Size2 etc. is the size
of memory range in bytes (in 32-bit unsigned integer, little endian format).
The versionFlag is an indicator that is used to tell the PC GUI program that the version is v1.01 or later, and that it supports
the QUERY_EXTENDED_INFO command (v1.00 based bootloader firmware did not implement this particular command).
For each memory range a new range description is added. A total of 6 memory ranges will fit into the 64-byte packet. After
the entry of the last valid data field, the Type parameter for the next entry should be 0xFF (End of List).
The padding bytes should be treated as reserved and should be initialized to 0x00.
Table: Parameters for QUERY_DEVICE response deviceFamily field
Value Family
0x01 PIC18
0x02 PIC24F
0x03 PIC32
1.6 Demos MLA - USB Library Help Device - Boot Loader - HID
244

- 1
- 2
…
- 242
- 243
- 244
- 245
- 246
…
- 311
- 312