POWER-Z KM003C: what ChargerLab's official software sends
How the official Windows software talks to the KM003C (USB VID 0x5FC9, PID 0x0063), as input for an interoperable Go client.
Primary target: the user's POWER-Z Lab 3.0.0 (powerz_km_win_3.0.0/qt6_x64/POWER-Z.exe). Cross-reference: POWER-Z Lab 2.5.2 (Mtools.exe, PDM.exe), the official SDK sample and PDFs.
Nothing here was tested against a device.
P3 FUN_…: POWER-Z 3.0.0 POWER-Z.exe.
Mt FUN_…: 2.5.2 Mtools.exe.
PDM FUN_…: 2.5.2 PDM.exe.
All three are Ghidra 12.2 headless decompiles; the address is the function VA, and L<n> is a line number in that decompiler's C output.
docx: the official KM002C&3C API Description.docx.
capture: a USBPcap recording of the official 2.5.x app talking to a KM003C. These are third-party captures (repo okhsunrog/km003c-protocol-research, usb_master_dataset.parquet), used only to validate decompiled logic.
CONFLICT marks a contradiction between sources; it is left unresolved.1. Key findings
- POWER-Z 3.0.0 (the user's build) splits by interface:
- Live dashboard and recording use the CDC serial port with a newer framing, type 0x15:
- Header bits: seq nibble at 8–11, length at 12–23, sub-command at 24–31. Replies set bit 7, so they start
0x95. - Sub-commands: 01 info, 02 auth, 05 set (att 0x32 = stream start/stop), 07 ADC records (polled every 10 ms), 08 Type-C/PD/UFCS state logs (unused).
- Header bits: seq nibble at 8–11, length at 12–23, sub-command at 24–31. Replies set bit 7, so they start
- libusb/IF0 is used only for firmware update and factory provisioning, which includes a new 0x43 OTP-ID write.
- Live dashboard and recording use the CDC serial port with a newer framing, type 0x15:
- Transport (2.5.2). libusb bulk on IF0 (vendor class, WinUSB): EP
0x01OUT,0x81IN. CDC (IF1/2) carries the same binary commands plus a text "PDM" protocol-trigger language. HID (IF3) carries the same binary commands in 64-byte reports. - Bring-up, confirmed by the 2.5.2 decompile and capture:
CONNECT.- Four AES-encrypted memory reads:
0x420,0x4420,0x3000C00,0x40010450. - An AES challenge-response
0x4Ckeyed on the MCU UID. GET_DATA(Settings), thenGET_DATA(RecordList), thenSTOP_QUEUE.- Poll
GET_DATAwith an attribute bitmask.
- Auth is enforced by the device for streaming. In the capture the meter answers
START_QUEUE (0x0E)withREJECT (0x06). The app then re-runs CONNECT, the UID read and0x4C, and the retry succeeds. The decompile has the same recovery path (Mt FUN_14007c640L65782–65788). Which other commands are gated cannot be determined from PC code. - Keys. Hardcoded AES-128-ECB keys with 0xFF padding, all validated by decrypting captured traffic:
Lh2yfB7n6X7d9a5Z: memory reads, encrypted replies, firmware image.Fa0b4tA25f4R038a: auth request. The reply usesFX0b4tA25f4R038a(byte 1 replaced by'X').
- ADC block. 44 bytes on current firmware, not the docx's 40. 3.0.0 exposes the tail as roles
vsbu1/vsbu2, shown as TMP1/TMP2. Its UI says channel 1 = meter-internal temperature and channel 2 = external sensor (reserved); see §8.1. - IBUS sign. Negative means current flows receptacle → plug. Source: the new-ADC PDF, and the 3.0.0 UI text "KM003C电流从[母座]流向[公头]就是反电流". 3.0.0 has an optional "absolute current |A|" mode and a separate
polarityindicator. - Detected fast-charge protocol. Neither PC version has a code→name table for the on-screen "detected protocol". The PC triggers detection only through CDC text commands (
entry …), all of which change device state. - Unsafe commands exist (§14):
- JUMP_APROM/DFU (0x08/0x09), firmware download (0x40/0x42 plus 4080-byte chunks), flash write
0x4A, SET_DATA0x48. - PDM settings write
0x0A(key 8 = factory reset). - 3.0.0
setOtpID/allocOtpID(writes the device ID). - Every CDC text command, including undocumented
pd hrst. - 2.5.2 auto-sends JUMP_DFU when the HEAD reply word is non-zero.
- JUMP_APROM/DFU (0x08/0x09), firmware download (0x40/0x42 plus 4080-byte chunks), flash write
2. Software inventory
| Artifact | Source | Version | SHA-256 | Tech |
|---|---|---|---|---|
POWER-Z Lab 3.0.0 qt6_x64/POWER-Z.exe | official package powerz_km_win_3.0.0 (also contains qt5_x64/, qt5_x32/, firmware/, qt6_x64/log/) | "POWER-Z Lab 3.0", built 2025-02-23 | 0ee94e6300720ea9739071cbb5ad2ed4ffa9923c0a702b34c01a28e2cb3720b5 | Qt 6 C++ + QML (compiled into rcc), libusb-1.0, Qt6SerialPort, ChartDirector |
3.0.0 firmware/KM003C_V2.0.0.mencrypt | same bundle | FW 2.0.0, 2025.2.20 | 57cd634713090fb2993c44e0edb09d53405e18d24d1234ff5e3fd635cfc326fc | QDataStream container, AES-ECB image (§12) |
POWER-Z.zip → Setup.exe | chargerlab OSS (linked from power-z.com tech support) | 2.5.2 | zip cbbdadec09f153246397e86f83446154ddfa2ad2168d1cfdce4f3d49c086c616exe 0fc732ae644fb21dc235dd0b8e85fae741548e4c0faa9595361db2f63c7e6817 | Advanced Installer bootstrapper (payload not unpacked) |
Portable POWER-Z_free.zip | chargerlab OSS 2.5.2 | 2.5.2 | 497d73afcd356e001bde0eee6b8c9bdc415dcf7b75101f688ae22cfaf30e485f | — |
└ Mtools.exe | portable zip | "POWER-Z Lab 2.5.2" | 8ca204a3a42a24a5dd1395ead0d8dbb8a0f65ef6edb5418b0c8f4206f6176885 | Qt 6 widgets C++, libusb |
└ PDM.exe | portable zip | 2026-04-15 | 40e3a1af596ba0614ebfff0f0a742e1b62516af0bd103f7bb266f2f2222ef5e4 | Qt 6, Qt6SerialPort only |
| Official PDFs: new-ADC command, CDC trigger commands, PDM custom data | portable zip doc/, translations/cmd.pdf | 2026 | — | — |
SDK sample hiddemo_vs2019_for-KM002C3C.zip (+ docx) | chargerlab.com | 2022 | 00240281b0b2e724c09683f2712c9a8bee2c7c1e788a68f4b6b9912ef38e9c7d | C++ libusb (HID) |
Driver InstallDriver.zip | chargerlab.com | 2022-07 | 8f655497c94a8786bebb8279ce1cd85314df7e8499d53540985dbd260855f25b | dpinst + POWER-Z_WinUSB.inf |
Android "POWER-Z" cn.powerz.powerdumper 1.0.1 | vivo app store (official store) | 1.0.1 (Play has 1.0.3, not obtainable) | 54576d979b9517f7237ba379bf5a0c30f6e597dedd7e7c89d7cefb4eb47e7317 | no USB/BLE meter code (§13) |
iOS "POWER-Z" (com.powerz.powercalculator) | App Store id6754865141 | 1.1 | not obtainable | listing: phone power tool |
| Web (WebUSB/WebHID) tool | None official. The only one found is the third-party PowerScope. No macOS app exists either. | |||
3. POWER-Z 3.0.0 specifics
Filled in from the 3.0.0 decompile; see the sub-sections below.
3.0.0 is a different program from 2.5.2. It is a QML "MultipleRecord" multi-meter recorder with a firmware-update and factory-provisioning window. It has no PD analyzer and no protocol trigger. Ghidra decompiled 3691 functions; the class names come from RTTI and Qt moc metadata.
3.1 Which class talks to the meter, and how
| Class | Transport | Role | Key functions |
|---|---|---|---|
ModbusTransfer (vftable set at P3 L197458) | CDC serial via MySerialMaster/QSerialPort (opened 2 000 000 8N1 in P3 FUN_140112ed0; baud is irrelevant on CDC) | Live dashboard and recording. Despite the name it speaks two protocols: the ChargerLab "0x15" protocol to KM meters, and Modbus RTU to other products | FUN_140110ab0 open, FUN_140110d50 info, FUN_140112aa0 auth, FUN_140113670 timerEvent, FUN_1401131e0 ADC poll, FUN_1401122d0 record parser, FUN_140112130/FUN_140112d20 stream start/stop |
MySerialMaster (L191413) | CDC | request queue, timeouts ("Request timeout."), frame matching | FUN_1401058a0 sendRequest, FUN_140105d50 readyRead |
MyUsbPort / Upgrade / MyUsb / MyLibUsb (L169192, L170856, L167723, L160820) | libusb bulk, IF0 | firmware update window (FwUpWindow.qml) and factory provisioning: read info, jump, download, write OTP ID | FUN_1400e7a10 read info, FUN_1400e76b0 jumpApp, FUN_1400e5190 download, FUN_1400e82f0 setOtpID |
3.2 The "0x15" serial frame (new in 3.0.0)
u32 LE header: bits 0-6 type = 0x15 bit 7 = 1 in replies (0x95)
bits 8-11 seq nibble bits 12-23 payload length (bytes)
bits 24-31 sub-command
reply accepted iff (hdr ^ req) & 0x7f == 0 && (hdr ^ req) & 0xf00 == 0
&& (int8)hdr[0] < 0 && ((hdr >> 12) & 0xfff) == len - 4 (P3 FUN_140105d50)
payload handed to the caller = bytes after the 4-byte header
| Sub-cmd | Builder | Request body | Reply / meaning | Class |
|---|---|---|---|---|
| 0x01 | P3 FUN_140110d50 L197981 | 16 B: u32 now_secs, u32 rand×3 (header …|0x1010015) | 64 B Boot info block, 64 B App info block, OTP ASCII, 16 B, then a 32-B AES block (§3.5) | READ |
| 0x02 | P3 FUN_140112aa0 L198760 | 32 B AES_ECB(key0, rand0..3 | info[16..28] | rand7) | accepted if reply u32@4 == rand1 → +0x20d = authorized | SESSION |
| 0x05 | P3 FUN_140112d20 L198855 | u32 sub-hdr = 0x32 | 0x01000000 (att 0x32, size 4) + u32 value | "set attribute 0x32": 0 = stop, 0x303 = start at ≤ 1 ms, 1 = start (slower) (FUN_140112130 L198492–198496). The id nibble here is now_ms & 0xF, not the counter | STREAM CTRL |
| 0x07 | P3 FUN_1401131e0, timerEvent L199240 | none (header only …|0x7000015) | ADC record batch (§3.4) | READ |
| 0x08 | timerEvent L199278 | none | TLVs: 01 TypeCStateLog (u8 len), 02 PDStateLog (u8), 03 PDBuffer (u16), 04 ufcs_log (u16). Only the lengths are logged (P3 FUN_1401107b0), and the "protocol" timer that sends it is never started (only "adc" is, L197809) | READ (unused) |
3.3 3.0.0 connect and dashboard sequence (CDC)
- Open the COM port (
FUN_140110ab0). 0x15/01info query (FUN_140110d50). This fills the info list and decides "private" (+0x20e), see §3.5.0x15/02auth (FUN_140112aa0), which sets+0x20d.- Start a 10 ms timer named
"adc"(L197809). On each tick, if+0x20dis set:- "private": send
0x15/07. - Otherwise: send Modbus RTU fn 4 "read input registers 0, count 10" (
00 00 00 0a,FUN_140106690), which is for non-KM products.
- "private": send
- Recording start/stop sends
0x15/05 att 0x32. - The dashboard shows VBUS, IBUS (with a
polaritybadge), PWR, DP, DM, CC1, CC2, TMP1, TMP2 (QML rolesvbus ibus polarity power vdp vdm vcc1 vcc2 vsbu1 vsbu2,DevView.qml).
Developer log qt6_x64/log/2025-03-17.txt:
USB串口插入 "COM4"("USB serial port inserted") andUSB插入 "\\?\USB#VID_5FC9&PID_0063#001590#{A5DCBF10-…}"(serial001590).- 1624 ×
missN N, the gap detector inFUN_1401122d0. - The firmware window logs
"02010000" "03010000": CONNECT answered by DISCONNECT. That most likely happened while the CDC session held the meter.
3.4 3.0.0 ADC record batch (0x15/07 reply, P3 FUN_1401122d0 L198521)
payload[0..3] ? u32 payload[4..7] = flags (bit 3 set → no temperature fields valid)
payload[8] ? payload[9] = samples-per-record divisor (1..10, else 1)
payload[10] limit (<21) payload[11] = record count (min(count, limit))
record k (20 B) at 12 + 20·k:
i32 Vbus µV (/1e6) | i32 Ibus µA (/1e6, signed) | u16 ×4 (/1000 → V) | i16 T1 | i16 T2 (×1/128 °C; 0x8000 → -0.009 sentinel)
The four u16 values are in record order, which matches the new-ADC PDF's Vcc1, Vcc2, Vdp, Vdm; the code itself just labels them x1–x4. Snippet:
dVar27 = (double)*(int *)(pcVar9 + lVar14 + -8) / 1000000.0; // Vbus
dVar24 = (double)*(int *)(pcVar9 + lVar14 + -4) / 1000000.0; // Ibus (signed)
dVar4 = (double)*(ushort *)(pcVar9 + lVar14) / 1000.0; // x1..x4 at +0,+2,+4,+6
if ((uVar3 >> 3 & 1) == 0) {
if (*(short *)(pcVar9 + lVar14 + 8) == -0x8000) dVar34 = -0.009;
else dVar34 = (double)(int)*(short *)(pcVar9 + lVar14 + 8) * 0.0078125; // T1
... same for +10 → T2 }
Ah += Ibus/3600000 ; Wh += Vbus*Ibus/3600/1000 // per 1 ms sample
At rates of 1 ms or faster each record is emitted directly. At slower rates the app averages rate/1000 records, so the meter streams at 1 kSPS and the PC decimates. The QML rate options are 0.1/1/10/100/1000 SPS, stored in µs. The "Temp" option is disabled at 1 kSPS. Its tooltip translates as "Channel 1: meter internal (disabled at 1 ms sampling); Channel 2: external sensor (reserved channel, needs latest meter)".
3.5 3.0.0 device info and the "private" (genuine-device) check (P3 FUN_140110d50)
- Reply layout: 64 B Boot block, 64 B App block, then OTP ASCII.
- Each info block:
u32@0 == FFFFFFFF→ "none"; strings @0x10/0x1C/0x28/0x34 = name / version / date / plan. - OTP sections split by spaces: 0 = SN, 1 = UUID (shown truncated to 16 chars +
****), 2 = Unix factory date (renderedyyyy-MM-dd hh:mm:ss)."LYS"inside OTP[0x34..] → "true".
- Each info block:
- Labels (
FwUpWindowQML): Boot name/version/date/plan, App name/version/date/plan, 出厂日期 (factory date), SN, Authorize, UUID, GUID, ROM2.hwVersion = Boot version,fwVersion = App version. - Genuineness check: the trailing 32 B are decrypted with key3 whose byte [2] is stepped from
'0'up to'z'untildec[0] == challenge secs. Ifdec[4]anddec[1]also match two OTP words, the device is "private": Authorize ="private"and+0x20e = 1. - Effect: only "private" devices are polled with the KM
0x15/07command; others fall back to Modbus (L198285–198306, L199193).
3.6 3.0.0 libusb (IF0) path: firmware window and provisioning only
- Builders are identical to 2.5.2:
P3 FUN_1400dfae0ctrl,FUN_1400dfb70HEAD,FUN_1400dfbf00x44 read,FUN_1400dfe400x42 descriptor. - No 0x4C and no GET_DATA/START_QUEUE builders exist in 3.0.0: grep for
0x200004c/0x1004afinds 0 hits. - Read info (
FUN_1400e7a10L172523–172598) reads0x420,0x4420,0x3000C00and0x40010450with 0x44. jumpApp(n)(FUN_1400e76b0L172322–172326) sends CONNECT, then(n^1)+8, i.e. JUMP_APROM/JUMP_DFU.- New in 3.0.0: type 0x43 = OTP write (
FUN_1400e00b0, L167544), sent bysetOtpID(FUN_1400e82f0).
local_a4 = (uint)DAT_1402b4c78 << 8 | 0x1800043; // type 0x43, obj 6
append(00 0c 00 03) append(3c 00 00 00) // addr 0x03000C00, len 0x3C
append(serial.toLocal8Bit()) ' ' QUuid::createUuid().toString().toUpper() ' '
append(QByteArray::number(currentDateTimeUtc().toSecsSinceEpoch())) ' ' '\0' 'L' 'Y' 'S' '\0'
The provisioning QML numbers devices with an SN spin box (usbport.allocOtpID(sn) / setOtpID()). It then uploads the written ID with my_network.saveId(text). setOtpID only proceeds when the current OTP reads "undefined" and the device is in APP. PERMANENT: OTP is one-time-programmable
4. Transport: which interface for what
| Interface | Endpoints | Used by | Content |
|---|---|---|---|
IF0 vendor 0xFF (WinUSB via POWER-Z_WinUSB.inf, MI_00, DeviceInterfaceGUID {153261DD-0615-4691-DAFA-35232D8353D7}) | bulk 0x01 OUT / 0x81 IN (capture) | 2.5.2 Mtools (UsbPolicyMX), 3.0.0 (MyLibUsb/MyUsb/Upgrade) | binary 4-byte-header protocol: live data, info, auth, firmware upgrade |
| IF1/IF2 CDC-ACM | bulk + interrupt | 3.0.0 live dashboard (ModbusTransfer over MySerialMaster/MySerialPort), PDM.exe | 3.0.0's 0x15 frames (§3.2); the docx binary protocol (PDM's 0x8C memory read and 0x0A settings write); PDM text commands; the simplified 02 streaming command |
| IF3 HID (vendor page 0xFF00, 64-byte reports, no report ID) | interrupt | official SDK sample hiddemo.cpp | same binary protocol; docx limits HID payload to ≤ 60 bytes |
2.5.2 details:
- Open (
Mt FUN_1400774a0L62531): detaches the kernel driver and claims every interface. - Write (
Mt FUN_140078b00L63595): uses the first OUT endpoint whose transfer type is BULK (2). - Zero-length packet: after any write whose length is a multiple of 64, an empty bulk write follows (
Mt FUN_14007d5d0L66307–66313). - Class selection (
Mt FUN_140013380L11282–11293): VID0x5FC9→UsbPolicyMX; VID0x0483→UsbPolicyKM.
5. Framing
Every message starts with a 4-byte little-endian header (docx MsgHeader_TypeDef, identical in every builder of both app versions):
ctrl view : bits 0-6 type | bit 7 extend | bits 8-15 id | bit 16 encrypted | bits 17-31 att (15)
data view : bits 0-6 type | bit 7 extend | bits 8-15 id | bit 16 encode | 17-18 permi | 19-21 rsvd | bits 22-31 obj (# u32 words)
sub-header : bits 0-14 att | bit 15 next | bits 16-21 chunk | bits 22-31 size (bytes per chunk) (inside 0x41 payloads)
- id: one global byte counter, pre-incremented per packet (
Mt FUN_140078d70L63739). The device echoes it, e.g.02 01 00 00→05 01 00 00. - Bit 16: marks an AES/key0 payload on 0x44/0x4A requests, on the 0xC4 read-reply header and on encrypted 0x41 replies. It is not set on the 0x4C auth request, whose body is AES with key3.
- obj in plaintext replies does not equal the payload length. Capture: ADC reply
41 0a 82 02has obj = 10 but carries 48 bytes. Parse by sub-headersize. The app usesobj*4only as the decrypt length for encrypted replies.
5.1 Packet builders (2.5.2 Mtools; every writer of the tx-id counter)
| Builder | Header literal | Body / meaning |
|---|---|---|
Mt FUN_140078d70(type, att8) | ((att<<9|id)<<8)|type | generic control |
Mt FUN_140078e00(att16) | ((att<<9|id)<<8)|0x0C | GET_DATA, att = bitmask |
Mt FUN_140078e80() | id<<8|0x01000040 | HEAD + 16 zero bytes |
Mt FUN_140078ef0(addr,len) | id<<8|0x01010044 | memory read, 32 B AES (§9.2) |
Mt FUN_140079160(plain,key) | id<<8|0x0200004C | auth, 32 B AES (§9.1) |
Mt FUN_140079290(att,data) | id<<8|0x48, obj = len/4+2 | SET_DATA: sub-header att|len<<22 + data |
Mt FUN_140079370(info) | id<<8|0x04000042 | 64 B firmware descriptor (upgrade) |
Mt FUN_140079700(addr,data) | id<<8|0x0001004A | encrypted flash write (256 B chunks) |
PDM FUN_1400dd3e0(0x100,body) | ((0x100<<9|id)<<8)|0x1008C | GET_DATA + extend + encrypted: CDC memory read (§9.3) |
PDM FUN_1400dd470(map) | n<<23|id<<8|0x0A | settings write, key/value list (§8.5) |
6. Commands, attributes, SAFE/UNSAFE
6.1 Control types
| Type | Name | Use by official software | Class |
|---|---|---|---|
| 0x01 | SYNC | device → host during firmware upload | — |
| 0x02 | CONNECT | first command (capture; Mt FUN_14007afb0; 3.0.0 log "02010000") | SESSION required |
| 0x03 | DISCONNECT | device → host. 3.0.0 log: "02010000" "03010000", i.e. the meter answered CONNECT with DISCONNECT | — |
| 0x04 | RESET | never sent by either app | AVOID |
| 0x05 / 0x06 / 0x07 | ACCEPT / REJECT / FINISHED | device replies | — |
| 0x08 | JUMP_APROM | on_jump when not "APP" (Mt FUN_14007b620 L65172) | UNSAFE reboot |
| 0x09 | JUMP_DFU | on_jump in "APP" (L65168); also the 2.5.2 automatic HEAD-failure path | UNSAFE bootloader |
| 0x0A | GET_STATUS (docx) / settings write (PDM) | PDM SetDialog (PDM FUN_1400d8cc0) | UNSAFE |
| 0x0C | GET_DATA | all live data | SAFE READ |
| 0x0D | GET_FILE | never sent | AVOID |
| 0x0E | START_QUEUE (att = rate index) | Mt FUN_14007c640 L65764 | STREAM CTRL auth-gated |
| 0x0F | STOP_QUEUE | L65750; after connect | STREAM CTRL |
| 0x10 | START_ANALYZER (att 1 = PD) | Mt FUN_14007c4d0; capture 10 f4 02 00 | SNIFFER CTRL passive |
| 0x11 | STOP_ANALYZER | L65671 | SNIFFER CTRL |
6.2 Data types
| Type | Dir | Meaning | Class |
|---|---|---|---|
| 0x40 | both | HEAD (16 zero bytes). If the reply's u32@4 ≠ 0, 2.5.2 shows "您正在使用最原始的固件…请先升级固件" and auto-emits sign_jump(1) → JUMP_DFU (Mt FUN_140011b10 L10688–10709) | READ; never copy the jump |
| 0x41 | D→H | PUT_DATA, chained sub-blocks | — |
| 0x42 | H→D | firmware descriptor (model KM002C/KM003C/KM004C, size, version, CRC) | UNSAFE fw |
| 0x44 (reply 0xC4) | both | encrypted memory read | SAFE READ at the app's addresses |
| 0x48 | H→D | SET_DATA; 2.5.2 uses att 0x28 to rewrite the offline-record list (Mt FUN_14001b630 L15809) | UNSAFE |
| 0x4A | H→D | encrypted flash write (on_writeSpiFlash, Mt FUN_14007cad0) | UNSAFE |
| 0x4C | both | auth challenge/response | SESSION needed for streaming |
| raw 4080 B | H→D | firmware chunks (0xFF0 each) after CONNECT/HEAD/0x42 (Mt FUN_14007afd0) | UNSAFE fw |
6.3 GET_DATA attribute bitmask
| Bit | Name (docx / moc Attribute_type) | App use | Reply block |
|---|---|---|---|
| 0x001 | ADC | polled every 200 ms | 44 B (§8.1) |
| 0x002 | ADC_QUEUE | when the queue runs | N × 20 B (§8.2) |
| 0x004 | ADC_QUEUE_10K | — | — |
| 0x008 | SETTINGS | once after auth | 180 B (§8.5) |
| 0x010 | PD_PACKET | analyzer mode 1, every 5 ms | §8.3 |
| 0x020 | PD_STATUS | hex-logged only | unknown |
| 0x040 | QC_PACKET | analyzer mode ≥ 2, every 50 ms | as 0x010 |
| 0x080 | TICK | — | u32 tick + u8 |
| 0x100 | Tick__ | PDM: with extend + encrypt, carries the CDC memory read | — |
| 0x200 | RecordList | once after settings | offline-record list |
| 0x400 | PDList | — | — |
The lookup {1,2,4,…,0x400} is in Mt FUN_14007b4c0 L65099–65104. Masks seen in the capture: 0x001, 0x002, 0x003, 0x008, 0x010, 0x011, 0x200.
7. Connect and dashboard request sequence
2.5.2 Mtools, confirmed byte-for-byte by capture orig_adc_1000hz:
H→D 02 01 00 00 CONNECT → D→H 05 01 00 00 ACCEPT
H→D 44 02 01 01 + 32B AES(key0) read 0x420 /0x40 → c4 02 01 01 + echo, then 64B AES(key0) data
H→D 44 03 01 01 + … read 0x4420/0x40 → info strings (model, FW version, date)
H→D 44 04 01 01 + … read 0x3000C00/0x40 → OTP ASCII (serial etc.)
H→D 44 05 01 01 + … read 0x40010450/0xC → 12-byte MCU UID (one 16-B block)
H→D 4c 06 00 02 + 32B AES(key3) auth → 4c 00 03 02 + 32B AES(key3')
H→D 0c 07 10 00 GET_DATA att 0x008 → 41 07 02 0b | 08 00 00 2d | 180B settings
H→D 0c 08 00 04 GET_DATA att 0x200 → record list
H→D 0f 09 00 00 STOP_QUEUE → 05 09 00 00
H→D 0c 0a 02 00 (repeat) GET_DATA att 0x001 → 41 0a 82 02 | 01 00 00 0b | 44B ADC
The same order appears in the decompile:
- DeviceItem
Mt FUN_140011b10runssign_openUsb→sign_connectDev→ 50 ms sleep →sign_headDev→queryInfo. - DeviceView
Mt FUN_14001db20L16874–16888 then runssign_readOtpInfo→sign_security(1)→sign_getData(3)→sign_enQueue(0,rate)(= STOP).
Live polling (Mt FUN_14007d200 L66107, the timerEvent):
- Timer period: 10 ms in queue mode, 2 ms in analyzer mode.
- Flags accumulate into
+0x25a:0x001every 200 ms.0x002every[1000,200,100,32,10,…][rate]ms.0x010every 5 ms in analyzer mode 1.0x040every 50 ms in analyzer mode ≥ 2.
- The app then sends one
GET_DATA(att = flags)(disasm0x14007d333).
START_QUEUE carries a rate index with sample periods [1000,100,20,1] ms. On a non-ACCEPT reply the app sends CONNECT, then readOtpInfo, then security(1), and retries. Capture pd_adcqueue_new shows exactly this sequence after an 06 REJECT.
3.0.0 differs: its live dashboard runs on the CDC port with the 0x15 protocol. The sequence is info 0x15/01, then auth 0x15/02, then 0x15/07 every 10 ms (§3.3). 3.0.0 never sends GET_DATA, 0x4C or START_QUEUE.
8. Response structs
8.1 ADC block (att 0x001), 44 bytes on current firmware
| Off | Type | Field | Scaling / evidence |
|---|---|---|---|
| 0x00 | i32 | Vbus | µV → /1e6 V |
| 0x04 | i32 | Ibus, signed | µA → /1e6 A; negative = receptacle → plug (new-ADC PDF; 3.0.0 UI string @0x1cea2c) |
| 0x08 | i32 | Vbus_avg | filtered; not read by 2.5.2 |
| 0x0C | i32 | Ibus_avg | not read by 2.5.2 |
| 0x10 | i32 | Vbus_ori_avg | filtered, uncalibrated; /1e6 |
| 0x14 | i32 | Ibus_ori_avg | /1e6 |
| 0x18 | i16 | Temp (T1, ADC chip) | ×1/128 °C (Mt const 0.0078125 @0x140196348); 0x8000 = invalid |
| 0x1A | u16 | Vcc1 | 0.1 mV → /1e4 V |
| 0x1C | u16 | Vcc2 | /1e4 |
| 0x1E | u16 | Vd+ | /1e4 |
| 0x20 | u16 | Vd− | /1e4 |
| 0x22 | u16 | Vdd internal | not read (capture ≈ 3.24 V) |
| 0x24–0x2B | See the tail table below. | ||
ADC tail 0x24–0x2B
| Off | Type | 2.5.2 use (Mt FUN_14007a190, disasm 0x14007a7aa, 0x14007a847) | Capture value (KM003C, idle) | Best interpretation |
|---|---|---|---|---|
| 0x24 | i16 | emitted raw as the 8th value. Used as the temperature (raw °C, lightly smoothed) only when @0x18 == 0x8000 (KM002C Lite has no ADC-chip sensor) | 00 80 = 0x8000 | Second temperature channel (T2: MCU per the 2.5.2 changelog; "external sensor, reserved" per 3.0.0's Temp tooltip); 0x8000 = not present |
| 0x26 | u16 | not read | 7a 00 (122) | unknown |
| 0x28 | u16 | /10, stored at +0x288, substituted into queue-record temperature when START_QUEUE flag bit 8 is set (Mt FUN_14007c640 L65732, FUN_140079ca0 L64371–64376) | 1f 00 (31 → 3.1) | unknown; possibly the battery-% feature the V2.5.0 changelog says replaces temperature. Unproven |
| 0x2A | u16 | not read | 1b 00 (27) | unknown (plausibly MCU °C; unproven) |
- CONFLICT: the docx gives a 40-byte struct with
Rate:2 + n[3]at 0x24. - CONFLICT (scale): 2.5.2 treats
@0x24as integer °C, while 3.0.0's serial records scale both temperatures ×1/128 with a0x8000sentinel. - 3.0.0 does not parse the USB ADC block at all (it has no GET_DATA path), so it cannot settle 0x26–0x2B.
- The 3.0.0 QML role names for the two temperatures are
vsbu1/vsbu2, displayed as TMP1/TMP2. A hidden "SBU" option ("Type-C only, needs latest meter") shares the same channels.
8.2 ADC_QUEUE record (att 0x002), 20 bytes
| Off | Type | Field | Scaling |
|---|---|---|---|
| 0x00 | u32 | time / sequence | app detects gaps ("miss", also seen 1624× in the 3.0.0 log) |
| 0x04 | i32 | Vbus µV | /1e6 |
| 0x08 | i32 | Ibus µA | /1e6 |
| 0x0C | u16 | Vcc1 | /1e4 at rate index 0, else /1e3 (Mt FUN_140079ca0 L64359–64370) |
| 0x0E | u16 | Vcc2 | same |
| 0x10 | u16 | Vd+ | same |
| 0x12 | u16 | Vd− | same |
8.3 PD / UFCS analyzer block (att 0x010 / 0x040)
Mixed sources: capture pd_capture_new plus the decompile. 2.5.2 drops blocks with size < 12.
12-byte preamble : u32 time | u16 Vbus mV | i16 Ibus mA | u16 CC1 mV | u16 CC2 mV
message record : u8 (0x80 | len) | u32 time | u8 SOP (0 SOP, 1 SOP', 2 SOP'') | PD header (2) + data objects
e.g. 9f f9e95b00 00 a161 2c910108 2cd10200 … (Source_Capabilities, 6 PDOs)
87 90ea5b00 00 4102 (GoodCRC)
8b 94ea5b00 00 8210 dc700323 (Request + RDO)
Event codes come from Mt FUN_1400643c0 (L51945). The event byte is lo nibble = type, hi nibble = arg:
| Type | Event | Arg (hi nibble) |
|---|---|---|
| 1 | Attach | 1 CC1, 2 CC2 |
| 2 | Detach | 1 CC1, 2 CC2 |
| 3 | Bad Message ID | — |
| 4 | Receive Hard Reset | — |
| 5 | Cable Reset | — |
| 6 | Receive error | 0 Bmc, 1 Pulse Number, 2 Freq, 3 Kcode, 4 Sop, 5 Eop, 6 CRC Check, 7 Data Count, 8 Unknown, 9 Retries |
| 7 | Monitor Type | 0 PD, 1 UFCS, 2 VIVO |
| 8 | Big Message | — |
The PD message name tables (control/data/extended message types, PDO/RDO field decoding, USB-IF VID→vendor names) are in the 2.5.2 PD analyzer (Mt FUN_1400572d0, FUN_1400629e0 and others). They follow the USB-PD 3.2 spec. The hardcoded key Ya0b4u595f4X031f there decrypts 16 bytes of a vendor PD payload for display only (Mt FUN_1400572d0 L49639).
3.0.0 has no PD decoder: there are no PD message-name strings. Its only PD-related traffic is the unused 0x15/08 TLV (TypeCStateLog / PDStateLog / PDBuffer / ufcs_log), whose contents it never parses (§3.2).
8.4 Device info, OTP and UID (via 0x44)
Layout from captured replies decrypted with key0. Fields are NUL-terminated 12-byte slots.
| Addr / len | Content |
|---|---|
0x420 / 0x40 | bootloader/HW block: u32 0, u32 0x08001FFF, 8×FF; @0x10 model "KM003C", @0x1C HW version ("2.1"), @0x28 date, @0x34 empty |
0x4420 / 0x40 | app block: u32 0x4000 (load base), u32 FFFFFFFF, u32 image size, u32 checksum?; @0x10 model, @0x1C FW version (e.g. "1.9.5"), @0x28 build date, @0x34 "1". If u32@0 == FFFFFFFF the app shows "none" (Mt FUN_14007b790 L65348) |
0x3000C00 / 0x40 | OTP ASCII, space-separated: serial number, a 32-hex-character ID, a Unix manufacture timestamp, a short code; FF-padded (Mt FUN_140143720 splits it) |
0x40010450 / 0x0C | 12-byte MCU unique ID (reply = one AES block: 12 B + 4×00) |
2.5.2 builds its info list from 0x420 (4 strings) followed by 0x4420 (4 strings). The version label shows list entry 5, i.e. 0x4420@0x1C, in APP mode, and entry 1 (0x420@0x1C) in DFU mode (Mt FUN_140011b10 L10563–10604). 3.0.0 QML uses info.get(0).name as the model and info.get(5).name //版本号 ("version number") as the firmware version.
8.5 Settings blob (att 0x008), 180 bytes
Sources: PDM FUN_14000cc30 L8013–8061 and Mt FUN_14007a8d0 L64747–64757.
| Offset / bits | Meaning | PDM write key |
|---|---|---|
| u32@0x00 bit 0 | button group (probably language) | 1 |
| bits 3–9 | brightness 0–127 (default 50) | 3 |
| bits 10–11 / 14–15 / 16–18 | three combos (logo/rotate/theme/reduce; exact mapping not recovered) | 4 / 6 / 7 |
bit 27 (>>26 & 2) | checkbox (probably auto-rotate) | — |
| u32@0x1C…0x2C, 0x30…0x40, 0x58 | voltage cal ×5, current cal ×5, offset (display only) | — |
| u32@0x60 bits 0–1 | combo (default 1) | 0x15 |
| u32@0x60 bits 2–3 | sample-rate index | 0x14 |
CONFLICT, rate index 0: Mtools period table = 1000 ms (1 SPS); PDM label = "2 SPS"; new-ADC PDF = "4 per second". 3.0.0 offers 0.1 / 1 / 10 / 100 / 1000 SPS, stored as µs (indexToUsec = 1000000/value).
PDM settings write (type 0x0A, UNSAFE):
- The body is a list of
{u32 0x01008000|key, u32 value}, terminated by key0x7FFF = 0x1234(PDM FUN_14000c780). - The "reset" button sends key 8 = 1, a factory reset (
PDM FUN_14000d090L8080–8111).
9. Authentication and crypto
- Cipher: AES-128 with the standard tables (S-box @
Mt 0x1402836c0). Each 16-byte block is encrypted independently (Mt FUN_14007d930), i.e. ECB. - Padding (
Mt FUN_14007e970): mode 3 = the last partial block is padded with 0xFF. All protocol uses select mode 3. - Key selection:
Mt FUN_140080d20(idx)slices 16 bytes out of an obfuscation string. The same strings and function are inPDM FUN_1400182a0, and the strings are in 3.0.0. - Validation: everything below was checked by decrypting captured traffic with a small AES/CRC-32 script.
| idx | Source string | Offset | Key | Use |
|---|---|---|---|---|
| 0 | NmR0R.uz3KgNOu4xufpWLh2yfB7n6X7d9a5ZBwLe/CZ.iz8 | 20 | Lh2yfB7n6X7d9a5Z4c6832796642376e365837643961355a | 0x44/0x4A, encrypted replies, firmware image |
| 1 | 7imR35uca2H54rsdkW78R3k5dj0fHvcRmYA9xpHTtlTzTQ4 | 14 | sdkW78R3k5dj0fHv | no caller in 2.5.2 |
| 2 | MOhaDnvvU.BRgUy34VW13jHj3598equq0yNVdMa*4AdUK0g | 13 | Uy34VW13jHj3598e | no caller in 2.5.2 |
| 3 | XwcPWtquq0yNVdaQjaFO7LFa0b4tA25f4R038azbeXoxQ41po940gl90mNGZmdRvYk | 22 | Fa0b4tA25f4R038areply: FX0b4tA25f4R038a | 0x4C auth |
9.1 Handshake 0x4C (on_security(mode), Mt FUN_14007c100 L65510)
plain[32] = u64 now_ms | middle[16] | u64 rand
mode 1: middle = 16 B read from 0x40010450 (UID 12 B + 00 00 00 00) ← used by the app
mode 2: middle = first 16 B of OTP 0x3000C00
send : 4c id 00 02 | AES_ECB(key3, plain)
accept: reply type 0x4C; dec = AES_ECB^-1(key3 with [1]='X', reply[4:36]);
dec[0:8] == now_ms && dec[24:32] == rand (capture: dec == plain)
9.2 Memory read 0x44 (Mt FUN_14007cfb0 + FUN_140078ef0)
request: 44 id 01 01 | AES_ECB(key0, u32 addr | u32 len | u32 FFFFFFFF | u32 crc32(first 12 B) | 16×FF)
crc32 = standard reflected 0xEDB88320 (table @Mt 0x140195ae0), e.g. 0x420/0x40 → 0x241b8c1b
reply : c4 id 01 01 | plaintext echo of {addr,len,FFFFFFFF,crc} (20 B)
then IN transfers of AES_ECB(key0) data until len bytes; 0x06 = REJECT
Addresses the apps read: 0x420, 0x4420, 0x3000C00, 0x40010450, and 0x98000000+off (SPI flash; offline logs at 0x98100000+, Mt FUN_14007c050 disasm 0x14007c067).
9.3 PDM CDC memory-read variant (PDM FUN_1400d9490 L161624)
plain[48] = u32 addr | u32 len | u32 crc32(addr‖len) | 9 × u32 random
send = 8c id 01 02 | AES_ECB(key0, plain)[0:44] (GET_DATA, extend, encrypted, att 0x100)
reply : find the same 4-byte header, then AES_ECB^-1(key = plain[16:32], rest) (per-request session key)
9.4 3.0.0 serial auth
The serial path has its own authentication (§3.2, §3.5):
0x15/02sendsAES_ECB(key0, rand×4 | 12 B from info | rand). The reply must echorand1atu32@4; this is the host authenticating to the device.- The
0x15/01reply carries a block encrypted with a per-device key3 variant (byte [2] ∈'0'..'y') that must echo the challenge and OTP words; this is the device proving it is genuine ("private"). - Same key strings as 2.5.2:
P3 FUN_14001ac20(idx). AES helpersP3 FUN_140019fd0(setkey),FUN_140019fc0(pad mode 3),FUN_140019e90(encrypt),FUN_140019de0(decrypt). - Not validated against a capture; no 3.0.0 serial capture exists.
10. CDC serial
10.1 Simplified streaming command (official doc/获取ADC数据新命令.pdf), SAFE READ
request (1–4 bytes; just "02" is valid):
byte0 type:7|zero:1 01 keep-alive · 02 start ADC auto-upload · 03 stop
byte1 att hi nibble 0 ADC · 1 ADC+PD · 2 ADC+UFCS · 3 ADC+PD/UFCS
lo nibble 0 = 4/s · 1 = 10/s · 2 = 50/s · 3 = 1000/s · 4 = 10000/s (reserved)
byte2 obj ("5: 5*20 bytes") byte3 crc8
reply: same 4-byte header + N × 20-byte queue records (§8.2)
- Lifetime: streaming stops on USB disconnect or after 1 hour. Re-send
02or01periodically to keep it running. - CRC-8 not identified: no standard CRC-8 reproduces both PDF examples (
02 12 05→6A,02 02 06→F2), and no CRC-8 table exists in any binary. Send the 1-byte form.
3.0.0 does not use this command. It uses the 0x15 frames in §3.2 instead. On CDC the meter therefore accepts at least three binary dialects: the docx 4-byte-header commands, the PDF's 1–4-byte "02" command, and the 0x15 frames.
10.2 PDM text commands, ALL STATE-CHANGING
ASCII on the CDC port, baud ignored. Sources: the trigger PDF and PDM.exe strings.
| Group | Commands |
|---|---|
| module | pdm open, pdm close, reset, pdm set type=?,em=?,sink=?, pdm parm (undocumented read-back) |
| detection | entry pd|ufcs|qc|fcp|scp|afc|vfcp|sfcp|tfcp, entry bc, entry apple, entry list, entry list+ (VOOC/MTK PE, needs a dummy load) |
| requests | qc ?V, qc3 volt=|inc=|dec=, fcp ?V, scp volt=,cur=, afc ?V, sfcp ?V, vfcp volt=,cur=, tfcp volt=,cur=, ufcs req=,volt=,cur=, ufcs pdo|cmd=|data=, pd pdo, pd req=,…, pd cmd=, pd data=, pd drp, pd hrst (undocumented PD Hard Reset) |
| device → host | ready, error, cc disconnect, cc1 attach, cc2 attach, pdm mode entry, ufcs:/vfcp:/tfcp: dumps |
11. Detected fast-charge protocol
Not found in 2.5.2 (Mtools or PDM):
- There is no code→name table for the meter's on-screen "detected protocol".
- The vendor list near
Mt 0x140194…(Samsung, Apple, Huawei, Xiaomi, …) is a USB-IF VID→name table for PD Discover Identity. PD_STATUS(0x020) is only hex-dumped (Mt FUN_14007a8d0L64722–64731).- PDM detects protocols only via CDC
entry …, which is state-changing.
3.0.0: also not found.
- No protocol-name table, no
entrycommands, and no trigger UI. - The only candidate source of protocol state is the
0x15/08reply (TypeCStateLog / PDStateLog / PDBuffer / ufcs_log TLVs). 3.0.0 never sends it (its timer is never started) and never decodes it. - The detected-protocol string therefore has to come from firmware analysis or experiments. Note that the
0x15/08TLVs and the 2.5.2PD_STATUS(0x020) block are the two device replies that might carry it, and neither PC app interprets them.
12. Firmware container and upgrade path UNSAFE-BOOT, documentation only
.mencrypt is a Qt QDataStream: a u32 BE count, then length-prefixed UTF-16BE QStrings, then QByteArrays.
| # | KM003C_V2.0.0 | Meaning |
|---|---|---|
| 0 | "Firmware file" | magic |
| 1 | "ChargerLab" | vendor |
| 2 | "V1.0" | container version |
| 3 | "KM003C" | model (also KM002C, KM002C Lite, MI2) |
| 4 | "2.0.0" | firmware version |
| 5 | "2025.2.20" | date |
| 6 | "64118EC3" | CRC-32 of the plaintext image (verified) |
| 7 | "439396" | plaintext length (verified) |
| 8 / 9 | 120 B / 212 B | UTF-16 changelog (zh / en) |
| 10 | 439408 B | AES-128-ECB key0 image (0xFF pad). Decrypts to a Cortex-M vector table (SP 0x200068c8, reset 0x4295, load base 0x4000) |
Upgrade on the wire (2.5.2 Mt FUN_14007afd0, capture updating_firmware):
CONNECT.HEAD(replyu32@4must be 0).0x42descriptor (64 B: model flag 0x4000, size, version, CRC, rand); expectACCEPT.- Send the ciphertext in 0xFF0-byte bulk writes, each answered with
SYNC (0x01). - Wait for
FINISHED (0x07).
JUMP_DFU/APROM (0x09/0x08) switch between the bootloader and the application.
3.0.0 upgrade (Upgrade class) builds the 0x42 descriptor differently:
P3 FUN_1400dfe40decrypts the image with key0 and takes the 64-byte info block at image offset 0x420 (the same layout as the device's0x4420block).- It checks that the block's model string matches the device.
- It patches in size, CRC and a random word, and sends it as type 0x42 (L167492–167530).
- Process states in the moc enum: Start, Erase, Dnload, Verify, VerifyFail, VerifyCorrect, Finished, TestJump, ReadInfo, ReadOpt, ReadQuid, ReadFlash1.
13. Android / iOS
- Android
cn.powerz.powerdumper1.0.1 (vivo store; jadx): no KM003C/KM002C support.- No USB-host feature or filter.
- No
UsbDevice,bulkTransferorcontrolTransfer, and no VID0x5FC9/24521. - No native libraries and no Bluetooth.
- The only
UsbManagerreference is androidx's service-name table (ContextCompat.java:34). - The app reads the phone's own battery voltage/current (
PowerFragment.java:259–316). - Play's 1.0.3 could not be downloaded and is unchecked.
- iOS 1.1 (
com.powerz.powercalculator): the listing describes a phone power tool only; the app was not obtainable.
14. What the Go client must never send
- Control types
0x04RESET,0x08JUMP_APROM,0x09JUMP_DFU,0x0Asettings write (key 8 = factory reset),0x0DGET_FILE. - Data types
0x42,0x48,0x4A, and raw 4080-byte firmware chunks. - HEAD as part of an upgrade, and the 2.5.2 auto-jump on a non-zero HEAD word.
0x44reads outside the five documented addresses.- 3.0.0
setOtpID/allocOtpID/jumpApppaths. - Every CDC text command (
pdm …,entry …,reset,qc…,pd …,pd hrst,ufcs ……).
Safe set:
- CONNECT, the 0x4C auth (mode 1), and 0x44 reads of the info/OTP/UID addresses.
- GET_DATA with bits 0x001/0x002/0x008/0x010/0x040/0x200.
- START/STOP_QUEUE and START/STOP_ANALYZER (sampling or sniffing only).
- CDC
02/01/03.
Parse the ADC block by its sub-header size. Expect REJECT on START_QUEUE and recover the way the official app does.
Added by 3.0.0:
- Type 0x43 OTP write (permanent device identity).
0x15/05with any attribute other than0x32: unknown "set" semantics.0x32itself only starts/stops the stream.- Modbus RTU frames.
Safe 3.0.0 reads: 0x15/01, 0x15/02, 0x15/07, 0x15/08.
15. Method
- Inputs: the official files listed in §2, identified by package-relative name and SHA-256. Downloaded files were treated as untrusted data and never executed.
- Decompilation: a Ghidra 12.2 headless script decompiled every function of
qt6_x64/POWER-Z.exe(3.0.0),Mtools.exeandPDM.exe(2.5.2), and listed string cross-references. radare2 was used for disassembly checks. - QML: recovered from the 3.0.0 executable's embedded Qt resources: 16 zlib-compressed files and 17 plain-text files. The rest exist only as qmlcache bytecode.
- Helper scripts: small scripts parsed the
.mencryptQDataStream header, carved length-prefixed text resources, brute-forced CRC-8 parameters, and verified the AES keys and CRC-32 against captured traffic.