Skip to content

How a finding gets checked

Reverse engineering rarely comes back empty. What it does, much more often, is come back with a confident answer that happens to be wrong, and nothing in the work flags it. Most of this page is about making those answers show.

RetailOS is the oracle

When Chikuma and the original firmware disagree, Chikuma is the one that strayed. That costs little to check, because both boot the same disk on the same emulated machine. You drive both, screenshot both and subtract the two pictures.

The real iPod is the third witness. When the emulator and the device disagree, the emulator gets fixed, until it refuses everything the device refuses.

Every claim says where it comes from

Tag Meaning
MEASURED read from the image, or from a live trace
INFERRED reasoned on top of a measurement
OURS a stand-in, which says so in the file, right where it stands in

A stand-in names the function that would answer it

A gap in the reverse can get filled with an invention that looks like a result. The giveaway is often a comment such as "until the reader is found", sitting two lines under the reader's own address.

So every stand-in has to cite the firmware function that would replace it, and that function has to have been read. make gaps collects the addresses cited in every stand-in comment and asks the symbol dump what they are called today. A name still in the FUN_xxxxxxxx form is a function nobody opened yet, and that list is what remains to open.

About one marker in ten describes something already fixed. Live debt is written in uppercase, and a closed gap keeps its history in lowercase ("was ours"), so the tool can tell them apart.

The loop

  1. Refresh the disassembly dump before reading anything, or you re-derive from zero a function that got its name last week.
  2. Hypothesise in one line, with what would disprove it.
  3. Measure: read the body, or trace the original running on the same bytes.
  4. Name it in the Ghidra project as soon as it holds, then re-dump.
  5. Write it in Chikuma, with a test against the real volume or the real archive that fails if the behaviour changes.
  6. Record it in the notes and commit it with the code.

Then back to 2.

Tracing the original often beats reading it. The filesystem window holds 1,355 functions, and one traced boot pointed at the three that matter.

Traps in the firmware

A formula can fit every case it was derived from and still be wrong. It has to be checked on a case where the inputs really differ.

0xff8 is an end-of-chain marker in one place and a bit mask in another. Only the behaviour tells which one you hold: does the code loop on it, scale a cluster number with it, or call a block read.

One reader's literal pool holds no pointer to the co64 string, which makes the firmware look as if it had no co64 support. The string is in the image, reached PC-relative. Search the image for the string itself, not for a pointer to it.

A probe that prints a chapter start with %.0f rounds, where the reader divides integers, so 5682 against 5681 is no contradiction. Assert what the file carries, in the unit it carries it.

The decompiler shows a blx through a descriptor slot as a plain call, so the C reads like a settled answer exactly where the real question is. The disassembly keeps the question visible, which is why this project reads ARM assembly.

When the firmware crashes under Chikuma's drivers, the cause is almost always on Chikuma's side. A crash also likes to look like a stall: the firmware's halt path turns off the watchdog, pokes the clock controller and spins. Profile the PC first. If every sample lands on one address, that address is the halt.

Probes

Hook the instruction that uses a value, never the load before it. Hooked one instruction too early, the probe reads the previous contents of the register, and the table it prints looks plausible.

Hook the ATA command write rather than the data fetch. DMA completes long after the driver returned, and by then the caller's frames are gone.

A long run writes its output as it goes, so a capture that gets killed still leaves something. Save a savestate just before anything that takes a while to reach. And a probe that prints nothing has usually measured nothing, so check the hook fired before reporting "nobody reads it".