powerz

KM003C firmware analysis

This page covers static analysis of every KM003C application image on ChargerLAB's official Google Drive: 21 packages, 1.7.9 through 2.0.7. Version 1.9.5, the version the user's meter reports, was analysed in depth. 1.9.7, 1.9.9 and the whole 2.0.x line were analysed for the questions that differ between versions. The 2.0.0 build that ships with the Windows app 3.0.0 was also checked. Nothing was sent to a meter and nothing was flashed. All addresses are runtime flash addresses, with the image loaded at 0x00004000. Function names are Ghidra's FUN_xxxxxxxx unless noted.

1. Findings for the CLI

2. .mencrypt container

The container is Qt QDataStream, all integers big-endian. A QString is a u32 byte length (0xFFFFFFFF = null; never used) followed by UTF-16BE. A QByteArray is a u32 length followed by bytes. Layout of KM003C_V2.0.7.mencrypt; other versions differ only in string lengths:

OffsetSizeTypeField2.0.7 value
0x0004u32 BEstring count10
0x0044+26QString[0] magic"Firmware file"
0x0224+20QString[1] vendor"ChargerLab"
0x03A4+8QString[2] format version"V1.0"
0x0464+12QString[3] model"KM003C"
0x0564+10QString[4] firmware version"2.0.7"
0x0644+18QString[5] build date"2026.9.29"
0x07A4+16QString[6] CRC-32 of plaintext, hex"A175E4A0"
0x08E4+12QString[7] plaintext size, decimal"456896"
0x09E4+216QString[8] release notes, Chinese
0x17A4+586QString[9] release notes, English
0x3C84u32 BEQByteArray length0x0006F8D0 = 456,912
0x3CC456,912bytesAES-128-ECB ciphertextends at EOF
after0–1,746bytesstale trailer (some packages)none

Trailers. Drive packages 1.8.5 (226 B), 1.8.8 (258), 1.9.3 (2), 1.9.9 (4), "2.0.0" (1,746), 2.0.1 (452) and 2.0.3 (168) have bytes after the QByteArray. In 1.8.5, 1.8.8 and 2.0.1 these bytes contain ccf2649e…f1f1, the encrypted all-0xFF block, and other ciphertext. They look like the tail of a previously written, longer file that the packaging tool overwrote without truncating. Parse exactly the QByteArray length and ignore the rest. FIRMWARE.md reaches the same rule ("exclude outer file trailers").

3. Decryption

key   = "Lh2yfB7n6X7d9a5Z"        (protocol key 0, also the MemoryRead key)
plain = AES-128-ECB-Decrypt(key, QByteArray)[:int(QString[7])]
check = crc32(plain with bytes 0x428..0x42F set to 0xFF) == int(QString[6], 16)   # zlib CRC-32
image = flash 0x00004000; padding after 'size' is 0xFF (a full extra block when size % 16 == 0)

4. All official images

"Tail" is the ADC payload layout from §8. "L0 mask" is the GetData attribute mask applied at auth level 0. "MR flag" is the MemoryRead confirmation byte 2. All 22 images were analysed.

PackageEmbedded ver / dateSizeCRC (✓)TrailerSPTailL0 maskGetData / MemoryReadMR flag
1.7.91.7.9 / 2023.7.14426,92865C433B5 ✓00x20008500old0x190x42F14 / 0x433881
1.8.01.8.0 / 2023.8.4440,832B513EA7F ✓00x200087F8old0x190x44560 / 0x449D41
1.8.41.8.4 / 2023.9.25441,480C7BF2374 ✓00x20008648old0x190x445F4 / 0x44A681
1.8.51.8.5 / 2023.12.6441,5521FAF5B0B ✓2260x20008648old0x190x4468C / 0x44B001
1.8.61.8.6 / 2024.1.15444,45645E63082 ✓00x20008690old0x190x44B20 / 0x44F941
1.8.71.8.7 / 2024.2.18444,448685B68A5 ✓00x20008690old0x190x44B10 / 0x44F841
1.8.81.8.8 / 2024.7.2447,81687B21A94 ✓2580x20008698old0x190x456C0 / 0x45B341
1.8.91.8.9 / 2024.7.18448,000A0B15145 ✓00x200086A0old0x190x456F8 / 0x45B6C1
1.9.01.9.0 / 2024.9.13450,396B1769B86 ✓00x200067C0old0x190x46074 / 0x464B41
1.9.21.9.2 / 2024.10.25450,916DEC1AF5E ✓00x200067C0old0x190x462A4 / 0x466E41
1.9.31.9.3 / 2024.11.12451,5240CFDB021 ✓20x200067A8old0x190x463C4 / 0x468041
1.9.51.9.5 / 2025.1.6451,7483F85AC89 ✓00x200067A8old0x190x46494 / 0x468D41
1.9.71.9.7 / 2025.8.7452,4604A453F41 ✓00x200067A8old0x190x46654 / 0x46A941
1.9.91.9.9 / 2025.9.22453,612E7A75D5B ✓40x200067B0old0x190x4686C / 0x46CAC1
Win app 2.0.02.0.0 / 2025.2.20439,39664118EC3 ✓00x200068C8old0x190x435D8 / 0x439E41
Drive "2.0.0"2.0.1 / 2026.4.9454,39634049BEC ✓1,7460x20008658new0x7F0x44760 / 0x44BB01
2.0.12.0.1 / 2026.4.21454,896AD739165 ✓4520x1FFFCA80new0x7F0x44970 / 0x44DC01
2.0.22.0.2 / 2026.4.29455,020C28A54B1 ✓00x1FFFCA80new0x7F0x449D8 / 0x44E281
2.0.32.0.3 / 2026.5.20454,86462891FA8 ✓1680x1FFFC9F0new0x7F0x44B74 / 0x44FC41
2.0.52.0.5 / 2026.7.15456,42401ED2B08 ✓00x1FFFD260new0x7F0x450C4 / 0x455140
2.0.62.0.6 / 2026.8.9456,48018F401E1 ✓00x1FFFD260new0x7F0x450D4 / 0x455241
2.0.72.0.7 / 2026.9.29456,896A175E4A0 ✓00x1FFFD260new0x7F0x4516C / 0x455BC1

The Drive file named KM003C_V2.0.0.mencrypt declares version 2.0.1 (2026.4.9) in both its header and the embedded app info. It is not the 2.0.0 (2025.2.20) that ships with the Windows app. The Drive 1.9.9 and 2.0.7 packages are byte-identical to the copies in km003c-protocol-research and the 2.0.7 package from the official update catalog. Package SHA-256 prefixes, in order: f8974b15, a9ddb5f2, 48b9a98c, b36be632, 6043bbab, d1cf2ecb, 20de23e9, 9a0da5a9, ec87e015, b0fd6412, ea6d1781, a8cb82cd (1.9.5), 71c81457, cdbdd032, e1e67c5c, b0953bf1, 7f229082, 9f73eba2, b3f6705b, 33e7034c, 7a081af8.

5. The meter's 1.9.5 vs the Drive 1.9.5

The repository fixture hardware/km003c/testdata/fw1.9.5/bulk_W6_2_plain.hex is a MemoryRead of 0x4420 captured from the user's meter. It decodes to:

00 40 00 00  ff ff ff ff  a4 e4 06 00  1d d2 9a dd  "KM003C"  "1.9.5"  "2025.1.7"  "1"
base 0x4000  (unused)     size 451748  CRC DD9AD21D  (written by the bootloader after flashing)

The Drive 1.9.5 has the same size, but its date is 2025.1.6 and its CRC is 3F85AC89. Writing "2025.1.7" into the Drive image and recomputing gives 5097DFBD, not DD9AD21D, so the meter runs a different build of the same size. The bootloader block at 0x0420 on the meter reads "KM003C", "2.2", "2024.9.23" (bulk_W6_1_plain.hex). Nothing visible in the captures contradicts the Drive 1.9.5 analysis:

A read-only MemoryRead of the meter's application flash (0x4000..0x72CA4, about 450 KB) compared against the decrypted Drive 1.9.5 (plaintext sha256 22281fde…443d) would settle it. That is a decision for whoever owns the meter.

6. USB command dispatch per interface (1.9.5)

The 1.9.5 USB task is at 0x0001EDD4. It waits for an event, with the session timeout as the wait time, and serves three inputs. The table shows what each interface accepts:

InterfaceRX bufferHandlerAccepted
IF0 vendor bulk, EP 0x01/0x81 (gopower-z)0x20010000FUN_00052514full command set below
CDC virtual serial port, OUT EP 20x20010A00 (256 B)inline in the task0x0C GetData (with bit 7: encrypted sub-read limited to XIP, OTP 0x3000C00+<0x3BF and flash < 0x7D000, size < 0xFF0); 0x0A settings batch, no auth; anything else goes to the text parser FUN_00042df2 (§12)
HID (IF3), OUT EP 5, 64-byte reports0x20011600inline0x0C GetData only

The OUT endpoint-to-buffer mapping comes from the receive-complete callback FUN_00051ee8: EP 1 → bulk, EP 2 → CDC, EP 5 → HID. In 1.9.5 the CDC branch has no binary 0x02 handler, so such a frame reaches the text parser and is ignored there. 2.0.x added CDC 0x02/0x03 start/stop streaming. The repository's guard.go says CDC 0x02 starts a push stream; that matches 2.0.x, not this 1.9.5 code path.

The bulk dispatcher, FUN_00052514 in 1.9.5, is identical to FUN_00052af0 in 1.9.9. If the connected bit (0x20003CD6 bit 2) is clear, it sets auth to 0 and accepts only 0x0C and 0x02; everything else gets Reject 0x06.

TypeName1.9.5 behaviour
0x01, 0x0A, 0x12, 0x13ignored, no reply
0x02Connectfrom unconnected: set connected, receive timeout 5,000 ms; while connected: clear flags 0xFFFC, timeout 120,000 ms; reply Accept 0x05
0x03DisconnectOnly accepted while connected; otherwise Reject 0x06. It calls the same routine as the idle timeout, FUN_0001c374, which:
  • clears the connected, graph and PD-capture flags (0x20003CD6 bits 2–5);
  • sets the receive timeout to infinite;
  • resets auth to 0;
  • immediately sends 03 id 00 00 with the meter's own incremented counter (0x20003D20), not the host's id.
No timeout is left armed, so nothing more is queued. The host must read that reply, or it stays pending on EP 0x81. 2.0.7 (FUN_00053f84) does the same but clears only flags 0x64.
0x04ResetNVIC_SystemReset (FUN_00011de4)
0x09JumpDfu0x12345678 → 0x200F0FF0 (retention SRAM), reset into the bootloader
0x0CGetDataFUN_00046494(src, attr), §7
0x0DGetFileFUN_00046872: attribute bit 0 gives the log catalog, otherwise an empty 0x41
0x0E / 0x0FStart/StopGraphsets the live rate (the rate setter FUN_00018138 resets the averages)
0x10 / 0x11PdEnable/DisableNo auth check. PdEnable is rejected (0x06) if the PD flag (0x20003CD6 bit 4) is already set, or if attr is 0. Otherwise it sets that flag (FUN_0005243a), which mainly drives a status-bar icon, and then:
  • attr 1: empties the PD record FIFO. FUN_00005fe0 zeroes its read and write indices with one 32-bit store.
  • attr ≥ 2: re-arms the D+/D− protocol engine (FUN_0004de48).
The flag is RAM-only. PdDisable clears it, and so do Disconnect, the idle timeout, and a Connect sent while already connected.

Recording does not depend on PdEnable. The PD task 0x0001E794 queues every good-CRC received message (FUN_0000f23c) and every attach, detach and receive-status event (FUN_0000f36c) unconditionally. They go into a 252-byte ring at PD object 0x20004044+0x55E, which drops the oldest records when full (FUN_00005f74).

0x40Headreply 0x01000040, 0x1000 (APP mode)
0x44MemoryRead§11; connected, no auth
0x48SettingsBatchFUN_00046a1c, no auth at dispatch (per-op gates in §12)
0x4AFlashWriteauth ≥ 1; external NOR 0x300000–0x37FFFF, ≤ 256 B, erases on a 64 KiB-aligned address (FUN_0000d18c, FUN_0000d364)
0x4BNOR readMemoryRead of 0x98000000 + addr
0x4CAuthdecrypts 32 B with Fa0b4tA25f4R038a. Bytes 8–19 equal to the UID (0x40010450) give level 1; equal to the first 12 bytes of the OTP calibration record they give level 2. Replies 0x4C, attribute 0x201|level<<1, encrypted with FX0b4tA25f4R038a. On 1.9.x nothing else changes; 2.0.7 also stores a wall-clock offset from bytes 0–7.
0x4DSettingsBatchsame handler, only at auth 2

For types ≥ 0x40, header bit 16 means the payload is AES-ECB(key 0). Requests without bit 16 are accepted as plaintext.

2.0.7 differences. One task, 0x0001F894, handles all three inputs. The CDC path gained Start/Stop streaming (0x02/0x03), reset/DFU, an authenticated memory or NOR read (0x0D), device info (0x14), an alternative auth (0x15) and NOR write (0x16), with a CRC-8 (poly 0x29) in header byte 3 for some commands. The bulk session deadline is 5 s after the last command, checked when the 10 s receive wait expires.

7. GetData attributes

AttrContent (1.9.5; same layout in 2.0.7)Level 0 on 1.9.5Level 0 on ≥ 2.0.1
0x001ADC, 44 B (§8)yesyes
0x002AdcQueue, 20 B each: u32 uptime_ms, i32 vbus_uV, i32 ibus_uA, u16 cc1, cc2, d+, d−noyes
0x008settings-A (96 B) + settings-B (84 B) = 180 Byesyes
0x010u32 uptime_ms, u16 vbus_mV, i16 ibus_mA, u16 cc1_mV, u16 cc2_mV + PD event recordsyesyes
0x020two PD trace queues (u8 len + ≤ 200 B each)noyes
0x040u32 uptime_ms, u16 vbus_mV, i16 ibus_mA, u16 d+_mV, u16 d−_mV + D+/D− protocol-engine eventsnoyes
0x080u32 uptime_ms, u32 byte at 0x40054062 (clock trim)nono
0x200offline-log catalog, N×48 Bnono
0x800bare header 0x00000800nono

Masked attributes are dropped silently. Your capture of attribute 0x11 returned the PD preamble tick 0x1EA9A8, vbus 6 mV, ibus 0 mA, cc1 70 mV, cc2 25 mV, which matches this layout.

8. ADC payload and the 0x24–0x2B tail

The payload is a memcpy of the first 44 bytes of the ADC state struct, followed by overrides. The struct is at 0x20002560 on 1.9.5, 1.9.7 and 1.9.9 (accessor FUN_000180ac on 1.9.5) and at 0x1FFFACF0 on 2.0.7. Struct fields come from the 1.9.5 ADC task 0x0001D934 and the measurement function FUN_00017e20:

OffsetTypeMeaning
0x00 / 0x04i32VBUS µV (calibrated, clamped ≥ 0) / IBUS µA (calibrated, signed)
0x08 / 0x0Ci321-second averages (window = SPS samples), calibrated
0x10 / 0x14i321-second averages, uncalibrated ("ori")
0x18i16INA229 die temperature, 1/128 °C; 0x8000 right after a rate change
0x1A–0x20u16×4CC1, CC2, D+, D− in 0.1 mV (refreshed every 250 ADC iterations)
0x22u16internal VDD
0x24–0x2Au16×4CC1, CC2, D+, D− in mV, 50-sample averages
0x2E–0x35, 0x38–0x3Fu16×4CC1, CC2, D+, D− instantaneous mV (two copies)
0x4Ci16second-temperature slot; the only writer (rate setter) stores 0x8000; Ghidra xrefs and a MOVW/MOVT scan found no other
0x4Eu8 (1.9.x) / u16 (2.x)bits 0–1 rate index; 2 new sample; 3 ADC done; 4–6 average ready; 2.0.1+ bits 7–10 accelerometer I²C status, 11–14 orientation
0x66 / 0x68 (1.9.5); 0x68 / 0x6A (2.0.7)u16 / i16VBUS mV (INA229 raw×100/512) / IBUS mA; used by PD preambles and the dashboard

Old tail: 1.9.5, 1.9.7, 1.9.9, Windows-app 2.0.0

/* 1.9.5 FUN_00046494 */
memcpy(p, adc, 0x2c);
*(u16*)(p+0x18) = adc[0x18];
*(u16*)(p+0x24) = adc[0x4c];                       /* 0x8000 */
p[0x26] = (adc[0x4e] & 3) | (p[0x26] & 0xFC);    /* rate index into the CC2 average's low bits */
PayloadMeaningYour capture 00 80 1a 00 56 00 5a 00
0x24 i16second temperature; 0x8000 = invalid or absent0x8000
0x26 bits 0–1sample-rate index2 = 50 SPS
0x26 u16 & 0xFFFCCC2 50-sample average, mV, low 2 bits lost24 (true 24–27)
0x28 u16D+ 50-sample average, mV86
0x2A u16D− 50-sample average, mV90

New tail: every build from 2.0.1 (2026.4.9) through 2.0.7

/* 2.0.7 FUN_0004516c; identical in Drive "2.0.0" (=2.0.1), 2.0.1, 2.0.2, 2.0.3, 2.0.5, 2.0.6 */
memcpy(p, adc, 0x2c);  p.u16[0x18] = adc[0x18];  p.u16[0x24] = adc[0x4c];     /* 0x8000 */
p.u16[0x28] = (pd[0x29]==0x79 && full!=0 && full!=0xFFFF && present<=full) ? present*1000/full : 0;
              /* pd = PD object; full = +0x460 (Battery_Capabilities last-full capacity),
                 present = +0x462 (Battery_Status present capacity) */
p[0x26] = adc[0x4e] & 3;                  /* rate only */
p[0x27] = (adc[0x4e] >> 7) & 0xFF;       /* lo: SC7A20 I2C status (0 = ok), hi: orientation 0-3 or 0xF = flat */
p[0x2a] = 0xFF;                            /* p[0x2b] = stale high byte of the D- average */
Read with the old layout, a 2.0.1+ meter shows an absurd CC2 average. The 61.441 V reported after a test flash to 2.0.7 is 0xF001: rate 1 (the boot default), accelerometer OK, orientation 0xF (flat). Pick the layout by firmware version: ≤ 2.0.0 old, ≥ 2.0.1 new (see the version table below). The rate, p[0x26] & 3, is valid in both. On 2.0.1+ read D+/D− from 0x1E/0x20 (0.1 mV).

Rate index: the per-rate SPS table ({2, 10, 50, 1000}; 1.9.9 0x55DF8, 2.0.7 0x558E6) matches the UI strings "2SPS", "10SPS", "50SPS" and "1KSPS". AdcQueue line voltages come from struct offset 0x1A + 10×rate:

That is why the queue units change with rate.

Layout by version

Each of the 22 images was checked the same way. I located the GetData builder (extended header 0x8001/0xB00, 44-byte copy) and read its tail overrides, found every writer of ADC struct +0x4C, and read the SPS table the rate setter indexes. 1.7.9–1.8.9 copy the 44 bytes as eleven words rather than calling memcpy; the overrides are the same.

Firmware (date)Tail layoutGetData0x240x26Level-0 maskDashboard label
1.7.9 (2023.7.14)old0x42F14adc+0x4C = 0x8000CC2 avg, rate in bits 0–10x191.9.5 logic
1.8.0 (2023.8.4)old0x44560samesame0x191.9.5 logic
1.8.4 (2023.9.25)old0x445F4samesame0x191.9.5 logic
1.8.5 (2023.12.6)old0x4468Csamesame0x191.9.5 logic
1.8.6 (2024.1.15)old0x44B20samesame0x191.9.5 logic
1.8.7 (2024.2.18)old0x44B10samesame0x191.9.5 logic
1.8.8 (2024.7.2)old0x456C0samesame0x191.9.5 logic
1.8.9 (2024.7.18)old0x456F8samesame0x191.9.5 logic
1.9.0 (2024.9.13)old0x46074samesame0x191.9.5 logic
1.9.2 (2024.10.25)old0x462A4samesame0x191.9.5 logic
1.9.3 (2024.11.12)old0x463C4samesame0x191.9.5 logic
1.9.5 (2025.1.6)old0x46494samesame0x19reference
1.9.7 (2025.8.7)old0x46654samesame0x191.9.5 logic
1.9.9 (2025.9.22)old0x4686Csamesame0x191.9.5 logic
2.0.0 (2025.2.20, Windows app)old0x435D8samesame0x191.9.5 strings and thresholds, inputs computed differently (see §10)
2.0.1 (2026.4.9, Drive file "V2.0.0")new0x44760adc+0x4C = 0x8000rate only; 0x27 accelerometer0x7F2.0.7 logic
2.0.1 (2026.4.21)new0x44970samesame0x7F2.0.7 logic
2.0.2 (2026.4.29)new0x449D8samesame0x7F2.0.7 logic
2.0.3 (2026.5.20)new0x44B74samesame0x7F2.0.7 logic
2.0.5 (2026.7.15)new0x450C4samesame0x7F2.0.7 logic
2.0.6 (2026.8.9)new0x450D4samesame0x7F2.0.7 logic
2.0.7 (2026.9.29)new0x4516Csamesame0x7Freference

The switch happened between 2.0.0 (2025.2.20) and 2.0.1 (2026.4.9). No official build exists between those two dates. Version strings are the reliable selector: <= 2.0.0 uses the old layout and >= 2.0.1 the new one. Both 2.0.1 builds use the new layout.

9. IBUS sign

So the meter measures both directions symmetrically and the firmware defines no physical convention. Which way is positive depends on how the shunt is wired. The official "new ADC" PDF (negative = receptacle → plug) and the km003c-rs comments (positive = female → male, which is the same thing stated the other way) conflict on paper. A bench test with a known load direction settles it. Until then the CLI should report the raw sign.

10. Fast-charge protocol labels

No GetData attribute carries the dashboard's protocol text or the engine's detected-protocol state. The engine object is at 0x200056B0 on 1.9.5 (FUN_0004f8c6) and 0x1FFFC140 on 2.0.7. Reading it needs a version-specific RAM MemoryRead, which is not recommended. What the CLI can do instead:

Dashboard voltage label, 1.9.5 (FUN_0001fb44, called at 0x0004b476 with the ADC struct)

Inputs:

This is a branch-by-branch translation:

line1(v, i, dp, dm):
  if v < 3300                                   -> "[ N/A ]"
  if dp > 2800:
    if dm > 2800:
      if v >= 19001                             -> "QC2.0 20V"
      if v > 7000 && i > 1000                   -> "VFCP | UFCS"
      return v < 5500 ? "DCP 1.5A" : "[ N/A ]"
    if 451 <= dm <= 1099: return v > 8500 ? "QC2.0 9V" : "VOOC"
    return v > 8500 ? "SVOOC" : "[ N/A ]"
  if 2501 <= dp <= 2800: return (v < 5500 && 2501 <= dm <= 2899) ? "Apple 2.4A" : "[ N/A ]"
  if 1101 <= dp <= 1300: return (v < 5500 && 1101 <= dm <= 1299) ? "Samsung 2.0A" : "[ N/A ]"
  if 501 <= dp <= 1000:
    if dm > 2800                                -> "QC3.0 | QC3+"
    if 501 <= dm <= 699:
      if 10501 <= v <= 12499                    -> "QC2.0 12V"
      return 4501 <= v <= 5499 ? "DCP 1.5A" : "[ N/A ]"
    if dm < 200:
      if i >= 2001                              -> "QC2.0 | SCP"
      if 8501 <= v <= 12499                     -> "FCP | AFC"
      return 4501 <= v <= 5499 ? "QC2.0 5V" : "[ N/A ]"
  return "[ N/A ]"

line2(v, i, dp, dm):
  if v < 3300                                   -> "[ N/A ]"
  if 8501 <= v <= 9999  && 1100<=dp<=1699 && 1100<=dm<=1699  -> "SFCP 9V"
  if 10000 <= v <= 12499 && 2100<=dp<=2699 && 2100<=dm<=2699 -> "SFCP 12V"
  if v >= 12500 && dp < 700                     -> "FCP | SCP"
  if i <= 2000:
    alt = "[ N/A ]"
    if |dp - dm| < 100:
      if 4501 <= v <= 5499: alt = "DCP 1.5A"
      elif v < 19500 && dp > 3000: alt = "QC2.0 20V Err"
    return (501 <= dp <= 699 && dm < 300) ? "FCP | SCP | AFC" : alt
  if dp > 2900: return v >= 7001 ? "SVOOC" : (v < 5500 ? "VOOC" : "[ N/A ]")
  return "[ N/A ]"

The function first checks whether the engine reports an identified proprietary session (engine +0xD == 0x13). If so, it shows VOOC/SVOOC, VFCP %d.%dW or UFCS %d.%dW from engine state instead of the labels above.

Same logic in other versions. I normalised the decompiled function in every image by stripping addresses and variable numbers, then diffed it against 1.9.5.

Dashboard voltage label, 2.0.1–2.0.7 (FUN_00022098 line 1, FUN_00021bd4 line 2, called from FUN_000213c8)

Inputs:

The 2.0.x payload no longer exports dp/dm. The closest exported values are payload 0x1E/0x20 divided by 10: 0.1 mV values refreshed every 250 ADC iterations. There is no current input. Both functions normalise to identical text in all seven 2.0.1–2.0.7 images.

line1(v, dp, dm):                                       // FUN_00022098
  if v < 3300                                   -> "[ N/A ]"
  if dm > 2800 && 501 <= dp <= 699             -> "QC3.0 | QC3+"
  if v < 5500:
    if dp < 110 && dm < 100                     -> "DCP"
    if dp > 2500 && 2501 <= dm <= 2899          -> "Apple 2.4A"
    if dm < 100 && 501 <= dp <= 699             -> "QC2.0 5V"
    return |dp - dm| < 100 ? "DCP" : "[ N/A ]"
  if 8501 <= v <= 9499:
    if dp > 2800 && 451 <= dm <= 1099           -> "QC2.0 9V"
    if 1101 <= dp <= 1299 && 1101 <= dm <= 1299 -> "Samsung 2.0A"
    if dm < 100 && 501 <= dp <= 699             -> "FCP | AFC"
    if 501 <= dp <= 699 && 501 <= dm <= 699     -> "QC2.0 12V Error"
    return (dp > 2800 && dm > 2800) ? "QC2.0 20V Error" : "[ N/A ]"
  if 11001 <= v <= 12999:
    if 501 <= dp <= 699 && 501 <= dm <= 699     -> "QC2.0 12V"
    return (501 <= dp <= 699 && dm < 100) ? "FCP | AFC" : "[ N/A ]"
  if 18501 <= v <= 20999 && dp > 2800 && dm > 2800 -> "QC2.0 20V"
  return "[ N/A ]"

line2(v, dp, dm):                                       // FUN_00021bd4
  if v < 3300                                   -> "[ N/A ]"
  if 8501 <= v <= 9999  && 1100<=dp<=1699 && 1100<=dm<=1699  -> "SFCP 9V"
  if 10000 <= v <= 12499 && 2100<=dp<=2699 && 2100<=dm<=2699 -> "SFCP 12V"
  if v >= 12500 && dp < 700                     -> "FCP | SCP"
  return (dm < 300 && 501 <= dp <= 699) ? "FCP | SCP | AFC" : "[ N/A ]"

In 2.0.x the dashboard uses these labels only while the engine's protocol code (+0x234) is not one of the values below. Otherwise it shows AFC %dV (2), FCP %dV (3), Huawei SCP (4), UFCS %d.%dW (5), VFCP %d.%dW (6), TFCP %d.%dW (8) or VOOC/SVOOC (10), all taken from RAM state that is not on USB.

Differences from 1.9.5:

Use the classifier that matches the meter's firmware generation.

Label variant by version

Method: normalise each image's decompiled label functions (strip addresses and variable numbering) and diff them against the 1.9.5 and 2.0.7 references, including the 2.0.x wrapper that picks between the protocol-code labels and the voltage classifier. The arguments come from each wrapper's call site.

Firmware (date)VariantFunctions (line 1 / line 2 / wrapper)InputsDifference from the reference
1.7.9–1.9.91.9.5one function (1.9.5: 0x1FB44)VBUS mV, IBUS mA (u16), D+/D− 50-sample avgnone in the classifier; only the format strings of the proprietary branch differ
2.0.0 (2025.2.20, Windows app)1.9.5 constants0x20728same quantities, computed from another structurenot proven identical line by line
2.0.1 (2026.4.9, Drive "V2.0.0")2.0.70x21C50 / 0x2182C / 0x21020struct +0x68, +0x28, +0x2Anone (0 diff lines in all three)
2.0.1 (2026.4.21)2.0.70x21DE4 / 0x21958 / 0x2114Csamenone
2.0.2 (2026.4.29)2.0.70x21E48 / 0x219BC / 0x211B0samenone
2.0.3 (2026.5.20)2.0.70x21D54 / 0x218C8 / 0x210BCsamenone
2.0.5 (2026.7.15)2.0.70x21FF0 / 0x21B64 / 0x21358samenone
2.0.6 (2026.8.9)2.0.70x21FF8 / 0x21B6C / 0x21360samenone
2.0.7 (2026.9.29)reference0x22098 / 0x21BD4 / 0x213C8struct +0x68, +0x28, +0x2A—

The label variant changes at exactly the same version as the ADC payload tail, so choosing it by layout (<= 2.0.0 → 1.9.5 logic, >= 2.0.1 → 2.0.7 logic) is correct for every official build.

The 2.0.x classifier does not take instantaneous D+/D−. Its wrapper is called with the ADC struct (2.0.7: from the dashboard at 0x4A780, pointer from FUN_00017dae). It passes +0x28/+0x2A, the 50-sample D+/D− averages that the ADC task fills, which are the same fields 1.9.x exports at payload 0x28/0x2A. 2.0.x no longer exports them in the ADC payload, so a host has two approximations:
  • payload 0x1E/0x20 divided by 10, a 0.1 mV value refreshed every 250 ADC iterations;
  • AdcQueue (0x02, readable without auth on 2.0.x) records taken while the rate index is 1. At rate 1 the four line voltages in each record are exactly struct +0x24..+0x2A, the 50-sample averages. Changing the rate to get there is a state change.
Values near a threshold may label differently from the screen.

PD label (1.9.5 FUN_0002768c; 2.0.7 FUN_00025590)

The label is the PD revision ("PD3.0", or "PD3.1" with "EPR"; 2.0.x adds "PD3.2") plus suffixes:

All of these come from PD traffic, which the CLI sees with PdEnable(1) and attribute 0x10. I did not trace which message fills the VID field; Discover Identity or Source_Capabilities_Extended are the candidates.

11. MemoryRead (0x44) validation

/* 1.9.5: dispatcher case 0x44 + FUN_000468d4.  Identical logic in every analysed version. */
req = (hdr bit16) ? AES-ECB-Decrypt(key0, payload) : payload      // {u32 addr, u32 size, u32 magic, u32 tag}
if (addr - 0x03000C00) < 0x180:                                   // OTP calibration window
    p = first 64-byte record from 0x03000C00 whose first word is 0xFFFFFFFF (max 0x03000D80)
    if p > 0x03000D40: addr = 0x03000D80
if magic == 0xFFFFFFFF && size < 0x3D0901 && addr < 0x983D0901:
    send {0xC4, id, 0x01, 0x01} + {addr, size, 0xFFFFFFFF, tag}     // 20 bytes; byte 2 bit 0 = encrypted
    for each 0x9F0-byte chunk (last rounded up to 16): send AES-ECB-Encrypt(key0, mem)   // raw, no header
else: send Reject {0x06, id}
CLI policy: allow only flash 0x0000–0x7FFFF, OTP 0x03000C00–0x03000FFF, SRAM and the 12-byte UID at 0x40010450. Keep each request ≤ 2,528 bytes and never touch other peripheral space. Useful fixed reads: 0x0420 (bootloader info) and 0x4420 (app model, version, date, installed size and CRC).

12. State-changing commands

A read-only CLI must never send these:
  • 0x04 and 0x09;
  • 0x48 and 0x4D (every op changes state);
  • 0x4A;
  • level-2 auth;
  • CDC 0x0A;
  • any CDC text line.
Reboots also interrupt offline logging. Level-1 auth on 1.9.x is side-effect-free. Start/StopGraph (0x0E/0x0F) changes the live sample rate, which also shows on screen, but is not persisted.

Settings-batch operations (1.9.5 FUN_00046a1c; identical in 2.0.7 FUN_00045704)

Format: [op:15 | next:1 | rsv:6 | size:10] + payload, chained while next is set. The handler is reachable from bulk 0x48 (no auth), bulk 0x4D (auth 2) and CDC 0x0A (no auth).

OpGateEffect
0x01nonesettings-A bit 0 (language)
0x02noneclear settings-A bit 2 (calibration-required flag)
0x03nonesettings-A bits 3–9 (brightness)
0x04, 0x05nonesettings-A bits 10–11, 12–13
0x06, 0x1Cnonesettings-A bits 14–15, applied
0x07nonesettings-A word 1 bits 0–2
0x08nonesave, reinitialise, reset MCU
0x09nonefactory reset of both settings blocks, then op 8
0x0Aauth 2write the 5 VBUS calibration offsets; may re-zero the current offset
0x0B, 0x0Cauth 2write positive-current gains
0x0Dauth 2write negative-current gains; brightness forced to 50
0x0Eauth ≥ 1unlock PWC.FPRC and write a signed byte to CMU register 0x40054062 (clock trim; exact name unconfirmed)
0x0Fauth 2write the current zero offset (settings-A 0x58)
0x14–0x17nonesettings-B: screen orientation, default sample rate (applied at once), bits 4–5, main page; persisted to NOR
0x28noneappend 48-byte offline-log catalog entries
0x7FFFnonepersist settings-A

The OTP calibration record that level-2 auth compares against is itself readable through 0x44. Level 2, and with it calibration writes, is therefore reachable by any host.

CDC text mode: "Protocol Trigger by Virtual Serial Port"

On the CDC port, any frame that is not a 0x0C or 0x0A header goes to the text parser (1.9.5 FUN_00042df2, 2.0.7 FUN_00040718). ChargerLAB's own document, "KM003C/002C Protocol Trigger by Virtual Serial Port (Instructions)", published on their Google Drive next to the firmware, lists the commands:

The firmware parser also knows debug, list, ver, info, hrst (hard reset), drp, tfcp, apple and bc.

These commands make the meter act as a decoy sink and negotiate higher voltages, up to 20 V, or 48–50 V with EPR, onto whatever is connected on the output side.

13. Address index

What1.9.5 (Drive, 2025.1.6)2.0.7
USB task (bulk, CDC and HID inputs)0x0001EDD40x0001F894
Bulk dispatcher0x00052514inline in task
GetData / MemoryRead / SettingsBatch0x00046494 / 0x000468D4 / 0x00046A1C0x0004516C / 0x000455BC / 0x00045704
ADC struct / accessor0x20002560 / 0x000180AC0x1FFFACF0 / 0x00017DAE
ADC task / measurement / rate setter0x0001D934 / 0x00017E20 / 0x000181380x0001DE5C / 0x00017B1C / 0x00017E34
INA229 CURRENT read0x00006E6E0x00006D78
AES-ECB decrypt / encrypt (HW AES 0x40008000)0x00004FB0 / 0x000050900x00004F9C / 0x00005074
Auth level byte / session flags0x20004041 / 0x20003CD60x1FFFB485 / 0x1FFFB1A2
Disconnect + timeout0x0001C3740x00053F84
NVIC_SystemReset0x00011DE40x000119D8
Dashboard voltage label / PD label0x0001FB44 / 0x0002768C0x000213C8 (0x22098, 0x21BD4) / 0x00025590
D+/D− protocol engine object0x200056B00x1FFFC140
CDC text parser0x00042DF20x00040718
NOR program / erase (QSPI 0x9C000000)0x0000D364 / 0x0000D18C0x0000CE84 / 0x0000CCAA

14. Not established

15. Reproduction

No firmware, decrypted or encrypted, is stored in this repository. The inputs are the official .mencrypt packages from ChargerLAB's Google Drive and the four packages bundled with the Windows app 3.0.0, identified below by SHA-256.

  1. Decrypt. A short Python decryption script (pycryptodome) parses the QDataStream header, AES-128-ECB-decrypts the QByteArray with key 0 and truncates to the declared size. It checks the CRC-32 with 0x428..0x42F set to 0xFF, the vector table and the app info block at 0x4420. It then prints the table in §4.
  2. Analyse. Ghidra 12.2 headless with -processor ARM:LE:32:Cortex -loader BinaryLoader -loader-baseAddr 0x4000. A pre-script adds the HC32F460 memory map (SRAMH, SRAM, retention SRAM, OTP, peripherals, QSPI XIP and registers) and seeds functions from the 160-entry vector table. A post-script decompiles every function. The never-returning RTOS tasks have no prologue, so I created them by hand at the addresses in §13. ECB was fingerprinted by counting repeated and shared 16-byte ciphertext blocks.
  3. Per-version ADC check. In each decompiled image, find the GetData builder: the function that copies 0x2C bytes with extended header 0x8001/0xB00. Record the level-0 mask and the tail overrides, find every writer of ADC struct +0x4C, and read the per-rate SPS table that the rate setter indexes.
PackagePackage SHA-256Plaintext SHA-256
1.7.9f8974b15601e2a6c58e9daddf9136ee9f903db723f2bca190d4249f659a65fc2fab69c2f14a137d578996a6ddb36243dd9dd855ffb74a575d452b5ff58d22d3c
1.8.0a9ddb5f20307562182acde6797e819cf5fbdc578e0851a19712b14e445b6661d8ab421d5f3cd4657633ebb088fddf1c14060dd5ce6086f5f1a9ddc8d25434687
1.8.448b9a98c9cec03331e964ad707737ad8f5d69adbcc8c4103fd93782265e21ef378cf2e21ad4f15bb8957d9f43094d45f9cae8c95612d3aa8533c3ccfa1b5f142
1.8.5b36be632b21baddb63379ec24d76be7d7cbfeabd20ca046f1a0686de7a0740d7a897ece9eb00a8090944be2b905fe8f1460d83dc60d440630b6d61e87ae5c9f8
1.8.66043bbab97dccb93738a77b80cace13d4a7253cde320aceb241c6b2979a6a2759f2fa172b18ba5bf55efe9dce02d9d24ca969288eb39912416e50e5fbe1535ae
1.8.7d1cf2ecb63469338d5b577ac9a3fc9d38b00dcdf883f44b3454f8637cb21f093224af714526d0a3a4bd44d8e52fb45af79e7b494391362ee1fc6f21876e8c40a
1.8.820de23e9032bf2b33a611b0bc23122f39f7236662a487ab15c9cc4b962a0bbc389b07ebaf1b0fefed9e7b8057edf4bdfc8b484026c5207bb499bac20ed7baf80
1.8.99a0da5a9565ac7de1b24948bd52cae39cba50f113af21a348e4a70962c96166564ad5c4728b7ed56d1e8b16fe10528ad4ee9ef684f77e475f0a61c540fb0bcc1
1.9.0ec87e015e1198ebc531570a224a6ad902c61f0bd2b66bad7cd9dfc12dc08c361e9f3b166fc029ecbd80afa064f740970264107b5078d14c2927ad55e62e39315
1.9.2b0fd64123147638742b5cbdfb0304c41521ff74371b4eb214223fc1191961f25fdf6f0470bb97b2b1ed886869896e250fbff43699c28946f9f9a450073ead6f5
1.9.3ea6d1781beb748740e3904c0b3b5735803b29e5c0c39e26a10c1922f20559c394a4810d3f5e6303396fe6a14a644139d41f019215f30d263cc07b6f474b147d7
1.9.5a8cb82cd1980fbdab8df54b2d1dfc8a6bbc4a9092815a5d2d2210b340726294622281fde35c4622e1f5e5bd7a1fd496de8f72517c43befb7cf701f02d343443d
1.9.771c814571f0d3384ea294bb3f6e83d0b863b6b152e5ec553e8f581728069c9db933e7ca6f50db208dc2a8a9951a125655607c7dc2bd24334082601c47b5a65b7
1.9.9cdbdd032c49f074510dcb8f746daf227e77ca4c40e63df7161f18a879f4aecdc0787c2284d95db50adccdd887dbe137fe0d8e68b056d099d5f848729a6c9358b
Windows-app 2.0.057cd634713090fb2993c44e0edb09d53405e18d24d1234ff5e3fd635cfc326fc2b00081aa5f5c2ca3107de26420a4a62375c7bb5fefe19cafc3628cf03f6f2d1
Drive "2.0.0" (2.0.1, 2026.4.9)e1e67c5c60ec3e0449561ac36005c03215e22f30d1ddeeb3351f814217b65efe91a6f2ff3ac88a9d5dd6ec388452a5165aa954b9669f36705bad26e9be1b1b5a
2.0.1b0953bf12accfe1b3aff2d1034b21180218fc17a69ac1f84c63aee001c192907af41f168720bc8675c7193d7ad9e4a2acb99b05cf0de6decacd611c4b892910f
2.0.27f229082db7ec763ef083af06684ff73be986862e21063593dddc939bb73e634fc7758010a8bf57a73b9f21f58fac62eb17314cf84203ecf026d07d2fd792e7e
2.0.39f73eba25b74aa6c6d5ac1baf71117900a85c5a2faa543b8b67a942f5b162cd0866683d04a5761c6d2c184ba9abfa34ef044cd78023ed41f58ccd7658930abdb
2.0.5b3f6705b14bb959576905b2f4c72a79556c8e1944b2232b60eb6c5900f38bd7b627b60ea653771e431c532c161ab3bb95a3f0f549daeeba98fe60635ad3cb141
2.0.633e7034cb15c221e6d772389b42b01f37eab55334d04282e4763bb34868a24442e2a959aad8cfbda85b88d9f4f1b036bf28bc9d4e0daaa4d3864e51656590aec
2.0.77a081af887fa8873d9e0cfc9cee9654187ab392f882efed16c1904a184ce84541440925005e848ff4d7b17fabb4a015a972b2b4dd519ed7c7a7352f8b236d1bf

View this page's source on GitHub