rMVCI: a Rust driver for the Mini-VCI cable, and how Techstream stores its vehicle data
Table of Contents
Reverse-engineering the Mini-VCI J2534 cable's firmware, writing a Rust driver for it, decoding Toyota Techstream's diagnostic database, and reading my Prius's A/C servo position on Linux. Part one. rmvci on GitHub • rmvci-core 0.1.0 release Techstream is Toyota’s dealer diagnostic software. It’s a 32-bit Windows application, and it talks to the car through a J2534 pass-through adapter. The cheap clone adapter most people use is the Mini-VCI. It has one Linux driver, libMVCI by Asela Fernando, which supports K-line but not CAN. I wanted to read one value from my Gen-2 (NHW20) Prius on Linux: the position of the air-mix blend door servo in the climate control, commanded versus actual. That took about a week in August 2026 and turned into a new driver and a decoder for Techstream’s database. This is part one, because the project isn’t finished. OBDb has per-vehicle JSON databases of diagnostic signals. Its Prius repo covers the powertrain, hybrid battery and chassis but not the A/C amplifier. The shared Toyota base repo has a climate block used by the Camry, RX and 4Runner: CAN ID To send anything on CAN I needed the cable to do CAN, so the first question was whether the limitation was in the cable or in libMVCI. The cable is an FTDI FT232R feeding an NXP LPC2119 running firmware that identifies itself as “J2534 MINI V1.03”. The Windows driver DLL is protected by a commercial packer, with a decoy import table and an encrypted code section. The firmware was easier. A public firmware-restore image for this cable has code read protection off, and Ghidra found 480 functions in it: an ARM bootloader at Reading the firmware turned up several things a driver has to know about: I also found four errors in libMVCI’s protocol notes. Lengths are 16-bit, not 8. The status byte is at offset 3, not the end. The trailing bytes are uninitialized stack. And its “disconnect” command is actually the one that tears down the encrypted session, which is why it has to re-handshake after disconnecting. For bench testing I wired the cable to a CH340 USB-CAN analyzer and wrote a fake ECU in Python that answers I first added CAN to libMVCI on a branch: CAN, ISO-TP, the protocol fixes, all 24 test vectors passing, no K-line regressions. But I wanted a different design, so on August 7 I wrote a new driver in Rust. (The libMVCI branch is still local. I need to upstream it.) Against a fake ECU asking for a block size of 2 and a 50 ms separation time, the firmware path sent 7 frames with about 0 ms gaps. The host path paused after 2, at 50.0 ms. libMVCI pings the cable every 15 ms because “the adapter resets if left idle”. I tested that by idling for 5, 60, 300 and 900 seconds and then checking the session, the channel, and a full request and response. All of them worked after every idle period, so rMVCI sends no keepalive. It detects a stuck adapter by counting unanswered real requests. I also got it running on a rooted Android phone, which exposed four bugs in the JNI layer: USB permission always denied because of an immutable With the cable working I still didn’t know the right request for my car, so I looked at how Techstream knows. I couldn’t get Techstream running under Wine. Its data is in Microsoft Access databases behind ADO, which needed the Jet engine installed by hand, native ADO DLLs, and a larger stack reserve in the PE header. After all that, every version from v7 to v18 died with an uncaught C++ exception. I later traced it to Wine’s 32-bit C++ exception handling: an exception thrown from inside a Techstream turns out to contain very little vehicle knowledge in code. It’s a generic engine plus a database: So an open replacement only needs the database format reverse-engineered once, not each vehicle. The Some details from getting the decoding right: By that rule, my car’s A/C amplifier isn’t on CAN at all. To see Techstream’s requests I wrote a small logging DLL with the 14 When I selected my car and opened the Air Conditioner screen, Techstream never used CAN The logger was faking ECU responses at this stage, so it showed real requests but no real replies. I misread the capture because of that: I decided On August 9 I plugged the cable into the car, connected to a Raspberry Pi running The first attempt failed. FAST_INIT returned a single status byte, On the second attempt FAST_INIT returned the full key bytes, That evening I checked the extracted vehicle map against every ECU in the car using only reads: Next I changed the logging DLL to forward each J2534 call to a server on my PC, which replayed it on rMVCI over TCP to the Pi, the cable and the car. Techstream in the VM connected to the car and showed real data: 686 ECU responses in that session, including 65 from the ABS and 51 from the body ECU, which my own tool hadn’t been able to read. The capture showed why. When a LID goes unanswered, Techstream re-runs FAST_INIT after two empty reads and carries on. My driver does that now. The capture also corrected my static analysis: the KWP trouble-code read is service A later capture, with me clicking through every ECU and data list, covered 15 K-line and 5 CAN ECUs and showed how the CAN-side data lists work: Techstream v18 hung on connect after asking for 10400 baud on K-line, and I suspected the clone cable. I sniffed the genuine Windows driver talking to the cable, decrypted the session, and compared it to mine. They were byte-identical. Techstream tries 10400, gets refused, and falls back to 9600. Driving a Windows GUI in a VM is slow, so I tried running Techstream’s diagnostic engine without the GUI. The engine is a chain of DLLs behind a After a day of finding undocumented preconditions, it read the VIN from the replay, identified “NHW20 1NZFXE”, and produced request frames matching the real capture byte for byte: 98 of 98 for the A/C amplifier, plus data lists for six of the nine K-line ECUs. The harness enters the live-value poll path but fails a precondition check before sending any By August 10 my findings were spread over forty-odd markdown files that sometimes contradicted each other, so I spent a day consolidating them into one The extraction scripts became a pipeline, The rewrite found bugs the one-off scripts had hidden. The field I’d called the “mask” is a validity mask, and using it to extract values would have truncated 23% of bit-sliced signals. Trouble codes aren’t unique within an ECU. Analog active tests take two-byte drive values. The repo went public on August 30. On October 16 I tagged rmvci-core 0.1.0, with CI on Linux, macOS, Windows and Android. It isn’t on crates.io yet. It’s GPL-3.0 because it uses libMVCI’s captured test vectors and I haven’t asked the author about relicensing. Only the core is released. The J2534 shared library and Android layer are in the repo as source. Everything here was done on my own car with my own cable, and the only writes to the vehicle were ones Techstream itself made. Looking for the request
7C4, KWP2000 read 21 43, with byte 0 the target and byte 1 the actual servo position. I assumed that would work on the Prius. It doesn’t, as I found out later. The cable firmware
0x0 and the J2534 application at 0x8000. Probing my cable confirmed that the firmware accepts protocol IDs 1 through 6, which include CAN and ISO 15765. So CAN works in the cable and was only missing from the driver.[pattern & mask, pattern | ~mask], so the usual 0x7FF mask matches nothing useful and matching one CAN ID needs FF FF FF FF.SET_CONFIG returns success for unknown parameters and discards them. The ISO-TP flow-control settings (block size, separation time, padding) are stored and never read.id - 1 and only checks for zero. Recovering needs a port reopen, which pulses DTR/RTS to reset the chip.21 43. The cable answered the fake ECU’s multi-frame response with the flow-control frame 30 00 01, which is the hard-coded value I’d seen in the disassembly. rMVCI
Channel<P>, where the protocol is a type. A filter of the wrong width or an out-of-range protocol ID can’t be expressed.cdylib exporting the 14 standard J2534 PassThru* functions, so Windows tools like Techstream can load it.PendingIntent, the USB serial library rejecting reads smaller than 64 bytes, a SIGKILL from an uncleared Java exception on the actor thread, and a 5-second close caused by a cached ISO-TP object holding a second handle to the actor. On Linux I added a direct-USB backend using nusb, which can set the FTDI latency timer without root and cut exchange time from 48 ms to 30 ms. Techstream’s database
catch block loses the enclosing handler. So I used a Windows XP VM with the cable passed through over USB..vds files are renamed Access databases with vehicle lists and ECU addressing..ddb files, one per ECU family, hold every signal, trouble code, actuator test and customization setting, including the request bytes to send and the byte and bit slice to decode from the reply..ddb families are protocol generations. P3 ECUs use KWP2000 21 <LID> reads, P5 ECUs use UDS 22 <DID>, and P4 is a mix. Matching trouble codes identified A_C_P3.ddb as my car’s A/C amplifier, which meant the 21 43 request from OBDb belonged to a newer generation.(raw × num / den + offset) / 10^decimals. The ambient temperature sensor came out as ×0.35 − 23.3 °C, which matches OBDb.0xFF or less means K-line, and larger means CAN. Capturing what Techstream sends
PassThru* entry points that records every call and streams the log to my Linux host. (The first build crashed Techstream on launch because it opened a socket from DllMain, which deadlocks under the loader lock.)7C4. It switched to K-line, ISO 14230, address 0x98, as the database rule predicted, sent a few identification reads, then polled 21 E1 repeatedly. With some OCR-driven automation of the VM I captured request frames for 11 of the car’s 15 ECUs.21 E1 was a bulk “read the whole data list” command. On the real car it returns a two-byte trouble-code count, and Techstream uses the per-LID reads from the database for live data. On the car
rmvci-bridge, a small TCP service that forwards the driver’s transport primitives so I could work from my desk.08, and every write timed out. I had skipped the bring-up sequence Techstream does before using K-line: twelve SET_CONFIG timing parameters, plus a periodic-message clear before init and before each write. These turned out to be ordinary J2534 timing IDs (9600 baud, P1_MAX, TINIL and so on) with Toyota’s values.83 f0 98 c1 e9 8f 44, but every reply seemed to belong to the previous request. The A/C amplifier answers 7f 21 78 (“response pending”) first and sends the real 61 <LID> a moment later. Once the driver drained the pending frames:Signal Request Raw Value Air-mix damper, actual 21 0D9 −9.5 % Air-mix damper, target 21 138 −10.0 % Ambient temperature 21 02164 34.1 °C Blower 21 1C0 off 21 52 and the DTC read) produced an endless stream of “response pending” frames and left the amplifier stuck until re-initialised. The driver now drains these and re-inits. 21 52 turned out to be the one A/C LID the database flags as unsupported on this ECU. Techstream through rMVCI
0x13, not 0x18.A8 01 enumerates the PIDs, A1 defines a poll set, and A2 polls it. Active tests are service 30. Running the engine headless
DiagAPI facade, and the Wine crash is in code that chain doesn’t call. I built a harness that loads the engine DLLs under Wine, with the J2534 layer answered by replaying my car captures.21 <LID>, and I haven’t found the cause. The extractor
DATA_MODEL.md and marking the rest as current, log, or superseded.techstream_extract. Run against a Techstream installation, it takes about four seconds and produces, for 415 ECUs and 2,480 vehicles: 56,684 data-list signals, 61,072 trouble codes, 5,995 active tests, 3,451 freeze-frame items, 2,139 customisation settings, and the vehicle-to-ECU map. The tool is published. Its output isn’t, because it derives from Toyota’s database. Release
rmvci-diag (KWP2000 and UDS clients) and rmvci-net (the TCP bridge) are held back: diag doesn’t yet implement the DTC service I learned about on the car, and the bridge listens on all interfaces with no authentication. Still to do
rmvci-diag: DTC read (13) and clear (14), freeze frames, active tests, then customisation writes behind a confirmation step. Turn the car captures into mock tests.tsdiag, a CLI that scans the car and decodes everything using the extracted JSON, is written but hasn’t been run against the car.27), which I’ve never seen, so the immobiliser, theft and meter ECUs return nothing.