2026-11-26 15:49 UTC

LLM-assisted Nikon Z 6II reverse engineering exposes both promise and limits

state: seedheat: lowuncertainty: mediumrelevance: mediumllm-assisted-reverse-engineering consumer-hardwareArne Baeyens

What is this?

Arne Baeyens, a robotics software developer and hobbyist, describes using agentic LLMs to help reverse-engineer the Nikon Z 6II. He built qemu-expeed, a QEMU-based emulator, and used a camera memory-reading protocol, firmware analysis and public documentation and code from related chips to reproduce parts of the camera’s behavior; a separate earlier project ported Doom to the camera. Baeyens stresses that he had no Nikon internal documentation and that some hardware reconstruction rests on educated guesses. This is his first-person account, not an independent technical evaluation.

Why it matters

The case illustrates a plausible new route into obscure consumer hardware: an emulator gives coding agents a fast, observable environment to probe, while reverse engineering and public materials supply clues that might otherwise be hard for an individual to assemble. That could lower barriers to device research and community firmware work. But the author’s account also shows the costs: agents produced verbose, sometimes incorrect code and documentation that required close supervision, and he is concerned about maintenance, learning and resource use. Doom is a vivid demonstration, not evidence that agents can reliably deliver production-quality firmware or broadly unlock Nikon cameras.

Current assessment

New evidence is Baeyens’s first-person retrospective on his Nikon Z 6II reverse-engineering project. He says he used agentic LLMs and a custom QEMU emulator, then accessed camera memory over PTP/USB to compare real and emulated state. He combined those observations with firmware analysis and public RTOS specifications, Linux code and related-chip materials. His earlier Doom port took an afternoon after he had mapped relevant T-Kernel functions and found a way to execute code through RAM writes. The account supports the claim that LLM assistance helped make progress on an individual hardware-research project; it does not establish that the model independently reverse-engineered the camera. Baeyens reports substantial failure modes: misleading documentation, invented behavior and unnecessary code, with tests sometimes reinforcing the agent’s mistakes. He says he removed the generated documentation before publishing qemu-expeed and intends to continue with more manual work. He explicitly warns that some reconstruction may be wrong because he lacked Nikon internal documentation. Search results also point to recent custom-firmware activity around other Nikon cameras, but the supplied secondary coverage is not enough to establish the scope or verify those claims. Track the project as an instructive example of LLM-assisted reverse engineering, not as proof of reliable or general-purpose consumer-device hacking.

Measured heat

now 0 pts/hpeak 3 pts/hcomments 0/hpeers p34momentum: steady2 platformsage 146h
points/hour across evidence · reading as of 2026-11-27 02:23:58.509736+11:00 · deterministic, not a model opinion

How the heat travelled

11-20 13:00⭐ origin echo-reconstructedThe author describes using agentic LLMs while reverse-engineering the Nikon Z 6II and building the qemu-expeed emulator, then critiques the
Arne Baeyens on blog (echo) · attributed from hn.story.50645246
—
11-25 17:58first on hacker news · published · +125.0hReverse engineering the Nikon Z 6II with LLMs
fortran77
—
11-25 17:58amplified on hacker news 👑hn.story.50645246
fortran77
peak 1 · 0 comments · 103% of case engagement
11-25 18:20our radar first saw it · +125.3hdiscovery anchor: hn.story.50645246—

Evidence (2) — ⭐ canonical anchor

sourceobjectauthorscorecomments
🟧 hnReverse engineering the Nikon Z 6II with LLMs
Retrieved article excerpt

Open article · Retrieved 2026-11-25T18:22:01.933232+00:00

*Early morning at Emerald Lake, Yoho National Park*   
 67 mm   F6   1/80   ISO 200

Two weeks back I posted about [running Doom on the Nikon Z 6II](https://arnebaeyens.com/blog/2026/doom-on-nikon-z6ii/), where I also introduced the [qemu-expeed](https://github.com/abaeyens/qemu-expeed) emulator I built. Today I want to talk a bit about how this went, and how this has made me feel about using LLMs in the reverse engineering process. For decorative purposes, I inserted some pictures I shot with my Z 6II and the Z 24-200 in summer 2025.

Let me preface this by saying I don’t do this kind of thing professionally. By education I’m a mechanical engineer and by day I work on robotics software, with fancy filtering and control algorithms and quite a bit of math, which is on a far higher abstraction level than this project. In fact, this project was the first time I read assembly. Apart from general software skills, like knowing my way around Linux and Docker, probably most helpful was my bachelor’s in electrical engineering, which included a very decent course in chip design. (I’m grateful my alma mater allowed following a mechanical master after an electrical bachelor.)

Like just about any other software engineer these days, I’ve been using LLMs (often called “GenAI” or even just plain “AI”) at work, and I noticed they were quite decent at getting things to “work” (more on those quotation marks later). That made me wonder whether they could be of help in getting some insight into my Nikon camera.

Camera hacking has a long history, with Magic Lantern by far the most successful project. Originating around 2010 and the Canon EOS 5D Mark II, it has since spread to many Canon cameras and adds very relevant features like waveforms and raw video. Progress on Nikon cameras has been significantly more limited, however, and while Simeon Pilgrim and others of nikonhacker.com clearly put significant effort in this subject, their extensions were mostly limited to enabling and disabling existing features, and their project kind of fizzled out. Similar story for the other brands. As a result, Nikon cameras acquired the aura of being impenetrable.

Today, I know they (well, at least the recent Z-series) are actually extremely hackable once one gets through their obscurity. Coincidentally, I’m not alone in discovering this, as simultaneously the Wonder Lantern project arose, which currently provides firmware extensions for several Z-series cameras. (I’d like to be clear that none of my code or findings originate from the Wonder Lantern project, though their releases did push me to get my work out faster.)

### From a firmware update file to running Doom

#### How about we use an emulator?

Poking at the Nikon firmware purely myself, like the previous projects, would only have led me to run into the same wall as everyone before. So I opted to use agentic LLMs and adapt the working strategy. In classical reverse engineering, the physical device is closely observed, trying to get in through exposed UART and JTAG headers. This approach isn’t very compatible with LLMs, which I don’t trust to leave alone probing, and neither did I want the [reverse centaur](https://pluralistic.net/2025/09/11/vulgar-thatcherism/#there-is-an-alternative) of me probing on instruction. What I did know, however, is that these agentic LLMs work better the faster they’re confronted with the results of their actions. Therefore I chose to put emphasis on building a good emulator, a piece of code that makes my computer behave like the Z 6II’s hardware. Most importantly, this gave the agent a clear target to work towards - the further the program counter gets, the better.

This emulator-only approach has its limits though, and the reason is that while some hardware components were easy to identify (like the two Cortex-A7 cores and the ARM926 coprocessor), others are basically invisible (like the many hardware accelerators, peripherals, and flash areas not part of the firmware update package). Getting access to the camera’s internals was therefore key. My initial plan was to screw it open and dump bus traffic, though after some coaxing and trial-and-error, the agent got something far better to work: the read-RAM-over-PTP protocol, [documented years ago in older Nikons](https://github.com/simeonpilgrim/nikon-firmware-tools), was still present on the more recent Z 6II, albeit changed slightly. This provided an extraordinary view on the camera’s internals - little need to attach a bus dumper if one can just read the communication buffers. This revealed the communication protocol with the microcontroller (an STM32F412) which interfaces the main Expeed with the buttons and dials as well as the battery. (Fun fact: in one of the first emulator boots, the emulated camera complained hard about not being powered by an authentic Nikon battery.)

Next to dumping bus traffic, this memory read primitive also made it straightforward to read the camera’s internal state because the Cortex-A7, being ARM, has MMIO, so next to RAM I could also read the peripheral registers. Comparing those reads with the same reads in the emulated machine allowed me to pinpoint where the two diverged and especially what correct emulation looks like.

This approach worked pretty well and got the camera booted, but got stuck on the more complex tasks.

#### Open source

What helped there was the observation that, counter-intuitively, several things of this camera’s software are public, it’s just that Nikon (understandably) does not advertise this. The first one was the OS this camera runs, SMP T-Kernel 1.00.01, a Japanese RTOS. While its code is closed source, [TRON Forum helpfully published a very detailed spec](https://www.tron.org/wp-content/themes/dp-magjam/pdf/specifications/en_US/TEF020-S001-01.00.01_en.pdf) which made it straightforward to name all the firmware functions handling OS tasks.

With the already gathered facts in hand, and in combination with some general public knowledge such as that Nikon in the past partnered with Fujitsu and that [Nikon’s Expeed is of Socionext Milbeaut lineage](https://en.wikipedia.org/wiki/Milbeaut) I started searching for datasheets and related code. This turned up the [Socionext M10V/SC2000](https://www.eu.socionext.com/assets/files/pr2017055-socionext-m10v.pdf), a SoC similar to the Expeed 6 (PCIe Gen2, USB3 device), though with some differences such as having four instead of two Cortex-A7 cores and (as far as I’m aware) the Expeed 6 omitting the HEVC codec. Searching more on Socionext, GoPro caught my eye. As Mark Kirschenbaum of Hypoxic shared in [his excellent reverse-engineering blog post](https://gethypoxic.com/blogs/technical/socionext-gp1-sc2000a-study), GoPro’s GP1 (their custom SoC that debuted in their HERO6) relates closely to the SC2000. Most importantly, GoPro runs Linux on one of the cores, and following the Linux GPL2 license, this meant they had to distribute their kernel source modifications. While usually not a lot of code, because the kernel takes care of interacting with the hardware, this was exactly what I needed. [The GP2 (HERO10) release](https://github.com/hypoxic/GP2-linux-4.19.124) (I didn’t find a GP1 release) was helpful because it carries material related to both the M20V and the older M10V, and with that provided the register map of the inter-processor mailbox (IPCU, key for emulating the dual-core processor) as well as the SPI, I2C, HDMAC and EXIU peripherals.

Further searches on Linux releases of other manufacturers revealed that the Ricoh GR III and Pentax K-3 III run the SC2000, and their kernel provided the GPIO controller and confirmed the SPI block. Ricoh’s release includes [Socionext’s Stubby bootloader](https://github.com/hypoxic/stubby-1.60.1), containing code for the M8M clock controller, which after adding some registers happens to fit the Expeed 6. Helpfully, Socionext spent considerable effort in mainlining their kit (thank you!), which gave the SD driver and XDMAC. [One of their patches didn’t make it into mainline](https://lore.kernel.org/all/[email protected]/), but nevertheless provided me the Expeed 6’s counter block. Finally, the PCIe host bridge glue came from Socionext’s SynQuacer server processor. With this approach already having yielded fruitful results, I cast the net even wider, getting the Linux releases of the newer Nikon, Fuji, Panasonic and Sony cameras. Apart from a few remaining bits, this mostly yielded the knowledge that the Expeed 7 may have as siblings the Socionext M20V/SC2006 (Panasonic GH6 and S5II) and perhaps also the Fuji X-Processor 5 (Fuji X-H2). (Fun fact: the Z 6II shares its USB block, a Fujitsu “F\_USB30DR”, with the Sony A7 III.)

> Disclaimer: I did not have access to any of Nikon’s internal documentation; as such, I pieced this together from public sources, the firmware itself and a large number of educated guesses. Some of it may be wrong. Corrections are welcome at [email protected].

Combined with many RAM reads and a lot of trial and error, this made for a camera with basic functionality working. A nice side effect of using known peripherals is that all of the otherwise fiddly items - like PCIe for example - got operational pretty quickly, and with functionality that generalizes beyond the exact sequence the firmware drives it.

       

*Hiking up to Yoho Pass, overlooking Mount Burgess and the plains leading to Emerald Lake, Yoho National Park*   
 29 mm   F8   1/125   ISO 100

### The code

The Doom port thereafter only took an afternoon, as I already knew all the T-Kernel function addresses and had figured out how to execute code with a handful of well-placed RAM writes over PTP/USB. So, the project is a great success, the proof of the new age of AI? Let’s have a closer look.

We shall start by running `cloc` (Count Lines Of Code) on all committed files. This rolls in at a whopping **344859 lines spread over 723 files**. (For the non-software people reading this: usual write speed of a productive programmer is on the order of 100 lines/day, equating those 345 kloc to over 13 years of full-time development.) Now, to be fair, one third of that is due to me storing the firmware annotations in JSON in a line-hungry format. I also let the agent keep a log of all investigations, and this markdown file has grown to 60 kloc. Remaining we have 46 kloc of documentation, 64 kloc of Python tooling, 50 kloc of C code (which is mostly the emulator), and finally another few kloc of various type (git diffs, bash, Dockerfile etc.).

In classical (non-regulated) software development, having documentation expressed in dozens of kloc is basically unheard of. But before we pride ourselves in documenting our project so outstandingly well, let’s take five minutes to read some excerpts from these files.

A first one, from `sensor.md`, which ought to document the sensor and the Expeed’s front end:

> **Measured: the whole keyed property space is unset at boot** […]
>
> **And §3.7 says what those four bytes are, which turns the measurement into an explanation.** They read `1f ba 1f 10` — the magic that the **region load-failure path stamps**. This array *is* reserved region `0x08` (128 KB at `0xc20d2954`), and its loader runs at boot and fails: measured in a block census, `0x103c31aa` → `0x103c2bb6` → the storage helpers `0x102a9352`/`0x102a9308` all execute, and then so do the failure arms `0x103c31c8` (clear) and `0x103c31d0` (stamp the magic). The image template at `0x118b6bf0` is itself 12 non-zero bytes in 128 KB, so there is no factory data to fall back on either.

The keyed property area refers to a flash storage region next to the firmware which Nikon in the factory programs with various calibration and other settings. I dumped that flash region over PTP/USB and made it part of the emulated flash so the camera reads in the correct settings. The doc snippet above originates from before that 
fortran7710
🟧 echo.blog ⭐The author describes using agentic LLMs while reverse-engineering the Nikon Z 6II and building the qemu-expeed emulator, then critiques the Arne Baeyens——

Interpretation history

Decision trace