Developers working with poorly documented hardware must observe how vendor drivers behave correctly while identifying differences in their own implementations. In a case study using Claude Code, a film scanner driver was developed through a Windows virtual machine and Linux USB captures, while brightness and color issues in a laptop MIPI camera were also improved. The value of hardware reverse engineering lies not in speculating about vague principles, but in rapidly carrying out iterative traffic analysis and patch work.
Creating Comparable Reference Behavior
Development on the Plustek OpticFilm 8200i had been stalled for months because it was unsupported on Linux. But after recording USB data while running successful scans on Windows, the first Linux scan succeeded within hours. By the time an almost completed driver had been created, another developer had already added support for the scanner to SANE.
The publicly released hw-harness is a project that organizes the custom code used in this experiment for easy reuse. The code used in the actual project was not exactly identical to the public version, and not all three tasks were performed through the released harness.
What matters in hardware reverse engineering is not merely collecting large numbers of captures, but creating comparable runs. The physical device is passed through to a KVM Windows virtual machine, where a reference operation is performed with the Windows vendor driver. USB traffic beneath the passthrough layer is then recorded using usbmon on the Linux host, and the same operation is performed with the native Linux driver and captured again with the same tools.
Directly comparing the two execution traces reveals repeated sequences that differ by even a single byte, as well as differences in initialization order. Such differences provide evidence that turns vague “it does not work” behavior into a list of actionable driver bugs. AI was well suited to repetitive work such as finding patterns across thousands of lines of captured data, estimating the meaning of constants, and writing tests for verification. Humans remained responsible for deciding what functionality to implement and determining whether it behaved correctly on the actual device.
Film Scanning and Non-Destructive Post-Processing
The scanner backend uses a Genesys GL128 controller and the USB identifier 07b3:1825, with support for color, grayscale, infrared, and combined color and infrared modes. It can scan at 300 to 7200dpi with either 8-bit or 16-bit data per channel, while the infrared channel is used to remove dust and scratches. The Fedora RPM package was released to build automatically with every push.
After the upstream SANE genesys backend began supporting this scanner in September 2026, the two drivers were compared. At 3600dpi, they produced similar fine-detail levels, but scans at the maximum resolution took 34.6 seconds with the custom backend and 54.4 seconds with the upstream implementation. Because these results came from a single case involving one device and one frame, they should not be generalized to all performance conditions. The custom project is largely a proof of concept, and the upstream implementation is expected to be used once it reaches the same level of functionality.
Negative Vibes Preserves the Original Data
Negative Vibes is a GNOME application written in Rust that supports color and black-and-white negative scanning as well as slide scanning. It preserves the 16-bit linear data and infrared plane delivered by the scanner, accumulating post-processing settings so that the rendering can later be changed or re-exported. It provides negative inversion using an optical density space, crosstalk correction between the film base and dyes, and re-rendering for both entire film rolls and individual frames.
The application supports both infrared and software-based dust removal, along with IT8 calibration through ArgyllCMS. It can export TIFF, JPEG, PNG, and DNG files with ICC profiles and metadata, and is distributed as a Flatpak that includes the scanner backend. However, supporting every SANE film scanner would require the infrared channel to be exposed through a standard mechanism, and no such standard currently exists.
Expanding the Scope to MIPI Cameras
The same harness was also used to modify the MIPI camera in a Lenovo ThinkPad X1 Carbon Gen 14 Aura Edition. The laptop combines an Intel IPU7 with a Sony IMX471 sensor, and its images appeared dark on Linux, with reduced peripheral light and a strong yellow-green cast. Because the internal camera was difficult to capture directly, its baseline values were obtained by examining the Windows INF file, registry data, ACPI tables, and device properties.
The kernel driver fixes included an incorrect crop selection, an incorrect test-pattern register width, and an excessively low upper limit for analog gain. These changes resolved an issue that had caused the full pixel array to be used incorrectly and reduced the sensitivity loss of roughly 1.8 stops. In libcamera, lens shading correction was added, and the calculation that applied an 8-bit black level to white-balance statistics was corrected.
| Metric | Before | After |
|---|---|---|
| Frame brightness | 31.1 | 90.9 |
| Red-to-green ratio | 0.890 | 1.047 |
| Blue-to-green ratio | 0.672 | 0.823 |
In a controlled low-light test, the modified camera produced color ratios closer to those of the reference USB webcam, although blue remained approximately 17% low. The original article attributes this to gray-world white balance. This case demonstrates the importance of configuration data and reference-camera comparisons even for devices whose buses are difficult to record directly.
AI Development with Real-Hardware Validation
In this case, AI focused on highly repetitive tasks such as decoding captures, writing verification code, and cross-checking constants. Developers remained responsible for choosing what to implement and determining whether the results were correct on the actual scanner and laptop. Hardware reverse engineering can therefore be seen not as a process that ends with AI speculation, but as an iterative process that creates captures and reference data, then validates them on physical devices.
The results are not complete. The scanner produced visually acceptable film scans, and the camera was substantially improved, but additional tuning and refinement remain. The practical value of an AI agent does not lie in explaining every principle inside a device. Its value lies in rapidly narrowing the gap between correct and incorrect behavior, then validating those hypotheses through driver code and results from real equipment.
Source
This article was written after consulting the following source: geeknews — Reverse Engineering Hardware with AI

Leave a Reply