Archive for the ‘Reverse Engineer Microcontroller’ Category
Reverse ATmega2560 protected program file
A request to reverse ATmega2560 protected program file begins with the fact that ATmega2560 carries 256 KB of in-system programmable flash and 8 KB of SRAM and runs at 16 MHz in a 100-lead TQFP body. The work starts with the lock byte and the fuse bytes, because a megaAVR guards its arrays with lock bits rather than a numeric readout level.
Reverse Engineering Microcomputer ATmega2560 internal memory, and extract MCU ATmega2560 Program out from flash memory, crack Microcontroller ATmega2560 security fuse bit by focus ion beam technique
how to reverse ATmega2560 protected program file without losing the array
A classic megaAVR protects its memory with a lock-bit byte rather than a graded level. LB1 and LB2 are the memory lock bits: with both unprogrammed the flash, EEPROM and fuse bytes are readable over the programming interface, programming either one blocks further writes and verification, and programming both closes read-back so an external tool sees only blank words for the arrays. The fuse bytes sit beside the lock byte: CKSEL and SUT choose the clock, BOOTSZ and BOOTRST size and place the boot section, EESAVE decides whether a chip erase keeps the EEPROM, SPIEN enables serial programming and RSTDISBL repurposes the reset pin. The lock and fuse bytes stay readable while the arrays do not, which is why the first move on the bench is always a read of those bytes and never an erase.
the ATmega2560 memory geometry and its protection cost
On the ATmega2560 the 256 KB program array is written a page at a time and erased as a whole, with a boot section whose size is set by the BOOTSZ fuses. Beside it sits 8 KB of SRAM and 4 KB of data EEPROM, the latter being an independent array that a chip erase clears unless EESAVE was programmed. The only operation that clears the lock bits is a chip erase, and that same operation wipes the flash and, unless EESAVE is set, the EEPROM. The protection therefore comes down only at the exact moment the firmware disappears, and the 100-lead TQFP body changes nothing about that arithmetic because the array size is fixed by the ordering code rather than by the lead frame.
| ATmega2560 recovery geometry | Value |
|---|---|
| Program flash | 256 KB, page-programmable, boot section by BOOTSZ |
| Data EEPROM | 4 KB, cleared by chip erase unless EESAVE |
| SRAM | 8 KB |
| Core and clock | AVR RISC at 16 MHz |
| Protection | lock bits LB1/LB2 and BLB0/BLB1, fuse bytes |
| Package | 100-lead TQFP, 100 pins |
reading the ATmega2560 over the programming interface
The part is reached over the in-system serial programming interface driven by the reset, clock and data pins, and the same wires carry the read of the fuse and lock bytes. What fails under a set lock byte is the array read: a programmer asking for flash or EEPROM receives blank words while the part still runs its firmware normally and returns its configuration bytes cleanly. The practical routes are a clean read while the lock byte is open, a firmware-assisted dump where the boot lock bits allow it, or a chip erase the customer must approve in writing.
when a reverse ATmega2560 protected program file job needs an authorised erase
Read the fuse and lock bytes first, then decide, because that result settles whether any firmware can be recovered at all. An open lock byte means a clean read over the programming interface and the heximal can be pulled directly, while a part with LB1 and LB2 both programmed leaves only the destructive erase as a route to a blank device. The ATmega2560 is the 256 KB of flash device in a 100-lead TQFP body, so the capacity marking and the package settle the array size before anything is priced. The 100-pin body and the external memory interface are the traits that separate this member from the 64-pin siblings. What survives the lock: the fuse and lock bytes themselves, the device signature and the calibration byte, the peripheral registers while the part runs, and the EEPROM if EESAVE was programmed before any erase.
identifying the ATmega2560 against its siblings
When a board arrives marked only with a partial code, the megaAVR family is the place to look, because its members share the same lock byte, the same fuse layout and the same erase coupling while differing in flash, SRAM, EEPROM, pin count and on-chip peripherals. Neighbouring members span 16 KB to 256 KB of flash with SRAM from 1 KB to 16 KB, and the low-voltage V grades trade clock speed for a wider supply range without changing the lock byte.
The same read-first routine appears in break atmega32u2 au microcontroller flash memory, break atmega64l secured microcontroller flash memory, break atmega8 encrypted mcu fuse bit and break atmel avr mcu atmega8535l heximal, with break avr atmega64a binary showing how the larger array changes the pricing.
the deliverable for a reverse ATmega2560 protected program file request
For a board that arrived as a reverse ATmega2560 protected program file request, the deliverable is a confirmed capacity, a lock-byte state and a priced route agreed in writing before any destructive step, and our engineers read the fuse and lock bytes first.
Five Flash Layouts and Their Fingerprints
A flash dump arrives as a single file with no map. Before any code analysis is possible, someone has to decide where the boot loader ends, where the application begins, whether there is a file system, and where the calibration constants live. That decision is made from the binary, not from a datasheet, because the datasheet describes the silicon and not the product.
Five layouts account for almost everything we see. Each has a fingerprint that is visible in a hex view, an entropy plot, or a search for a handful of byte patterns.
Layout one: a single flat region
The simplest layout is one image occupying the whole array, starting at address zero with a reset vector and continuing without interruption.
The fingerprint is a valid vector table at the very start — a stack pointer value that lies inside RAM, a reset vector that points inside the array, and a run of handler addresses all in the same range. After that the entropy stays roughly constant, with occasional clusters of zeros or 0xFF where constant tables and uninitialised padding sit.
The mistake this layout invites is assuming that a low-entropy region is unused. It is more often a lookup table, and deleting it to save space breaks the device in a way that is hard to trace later.
Layout two: a boot loader plus an application
The second layout splits the array into a small boot region at address zero and a larger application above it. This is what makes field update possible without a debugger.
The fingerprint is two vector tables. The first is at address zero and belongs to the boot loader. The second sits at the application’s base address, which is aligned to a block boundary and usually to a round number such as 0x4000 or 0x8000. Between the two there is a gap of unused space, filled with 0xFF, which is the visual signature of a layout boundary.
| Feature | Boot region | Application region |
|---|---|---|
| Vector table | At 0x0000 | At its base address |
| Size | Small, one to sixteen blocks | The rest of the array |
| Contents | UART or USB protocol handler | The product |
| Tell in the binary | A jump into higher memory | A second SP and reset pair |
The jump instruction at the end of the boot loader is the confirmation. It loads the application’s stack pointer from the second table and branches to the second reset vector, and seeing that sequence removes any doubt about where the boundary lies.
Layout three: dual bank
Dual bank exists so that an update can be interrupted without bricking the device. One bank holds the running image, the other receives the new one, and a marker decides which is valid after the next reset.
The fingerprint is symmetry. Two regions of identical size, each starting with a vector table, each ending at a block boundary, and each accompanied by a small header containing a version number, a length, and a checksum. Often one bank is entirely 0xFF because it has never been used.
| Observation | Interpretation |
|---|---|
| Two equal regions, one blank | Bank B never written |
| Two regions, different versions | Update completed, old bank retained |
| Two regions, one with a bad checksum | Interrupted update |
| Header at bank start, not at 0x0 | Swap mechanism is header-driven |
The interrupted-update case is the one worth care. The bank with the bad checksum is not garbage; it is a partially written image, and the intact part of it is often useful for comparison against the running bank.
Layout four: an image plus a file system
Devices that log, store configuration, or hold user assets usually carry a small file system above the code. The common choices are littlefs, SPIFFS, and on larger parts a FAT variant.
The fingerprint is block-structured rather than code-like. Instead of a dense stream of instructions, there are repeating headers at fixed intervals, wear-levelling counters that increment across erase cycles, and a superblock near the start of the region that names the geometry.
| File system | Tell in a raw dump |
|---|---|
| littlefs | Pairs of blocks with revision counters; a superblock with block size and count |
| SPIFFS | Object headers with page indices; a large proportion of 0xFF at the end |
| FAT | A boot sector with 0x55AA at offset 510, then a FAT table |
The counter pattern is the most reliable sign. A region whose first few bytes change every few hundred bytes, incrementing slowly, is a journal, and journals belong to file systems.
Layout five: an image plus a parameter area
The fifth layout adds a small region that is written far more often than the rest. Calibration values, run-hour counters, MAC addresses, and trimmed oscillator settings all live here.
The fingerprint is a small erase-block-sized region, usually the last block or the one immediately after the code, with a short record structure repeated at intervals. Each record starts with a marker and ends with a checksum, and older records are superseded by newer ones rather than overwritten, because a flash cell can be programmed without an erase only if it is still erased.
| Signal | Meaning |
|---|---|
| Same structure repeated every 16 to 64 bytes | Append-only record log |
| A monotonic counter field | Sequence number for the newest record |
| A single-byte or two-byte checksum | Record integrity |
| Region under 4 KB | Sized to one erase block on purpose |
This region is the one most often lost in a careless rebuild, because it looks like padding. It is also the region that a reference device cannot supply, since the values are per-unit.
Fingerprints that do not lie
Three measurements settle most layout questions quickly, and all three can be scripted.
The entropy plot comes first. Code sits in a narrow band, compressed data sits near the top, erased flash sits at zero, and a layout boundary shows as a step rather than a slope.
The second is a scan for vector-table candidates: any offset where two consecutive words both point inside the array and the second one, masked to the instruction-set alignment, lands on another plausible pointer chain. Genuine tables appear two or three times in a well-structured image and nowhere else.
| Measurement | What it resolves |
|---|---|
| Entropy per block | Where data ends and code begins |
| Vector table scan | Where each bank or image starts |
| 0xFF run lengths | Where regions were never programmed |
| ASCII string map | Which region is configuration rather than code |
The third is a string map, filtered to printable runs of six characters or more. Version strings, file system names, boot messages, and AT command tables cluster inside the region that owns them, and the clustering is usually enough to assign a region to a role.
Reading the map before reading the code
The order matters because the map decides which tool applies. A code region goes to a disassembler for the right architecture. A file system goes to a parser. A parameter block goes to a record decoder, and the record decoder needs the record layout, which is inferred from the repetition rather than from documentation.
Attempting the disassembler first is the usual failure. A file system region disassembles into plausible-looking instructions, because any byte sequence does on a variable-length instruction set, and the analysis produces pages of meaningless output before anyone notices.
What the service does
We produce a layout map as a separate deliverable, before analysis, because it makes the analysis quotable.
| Output | Content |
|---|---|
| Region table | Start, end, size, and role for each region |
| Confidence | Which regions are certain and which are inferred |
| Fingerprint evidence | The measurement that supports each assignment |
| Per-unit data list | Regions that a reference device cannot supply |
The map is also the input to two downstream questions: which regions an extraction must preserve byte for byte, covered in floating gate margins, and which regions a copy can legitimately rebuild, covered in NAND and NOR copying.
Where the code itself then needs to be understood rather than located, the method is the one in MCU source code reverse engineering. The layout map is what tells that work where to start.
Decode ATmega2560V locked program file
A request to decode ATmega2560V locked program file begins with the fact that ATmega2560V carries 256 KB of in-system programmable flash and 8 KB of SRAM and runs at 8 MHz in a 100-lead TQFP body. The work starts with the lock byte and the fuse bytes, because a megaAVR guards its arrays with lock bits rather than a numeric readout level.

reading the protection state before you decode ATmega2560V locked program file
A classic megaAVR protects its memory with a lock-bit byte rather than a graded level. LB1 and LB2 are the memory lock bits: with both unprogrammed the flash, EEPROM and fuse bytes are readable over the programming interface, programming either one blocks further writes and verification, and programming both closes read-back so an external tool sees only blank words for the arrays. The fuse bytes sit beside the lock byte: CKSEL and SUT choose the clock, BOOTSZ and BOOTRST size and place the boot section, EESAVE decides whether a chip erase keeps the EEPROM, SPIEN enables serial programming and RSTDISBL repurposes the reset pin. The lock and fuse bytes stay readable while the arrays do not, which is why the first move on the bench is always a read of those bytes and never an erase.
what the ATmega2560V array and erase cost mean
On the ATmega2560V the 256 KB program array is written a page at a time and erased as a whole, with a boot section whose size is set by the BOOTSZ fuses. Beside it sits 8 KB of SRAM and 4 KB of data EEPROM, the latter being an independent array that a chip erase clears unless EESAVE was programmed. The only operation that clears the lock bits is a chip erase, and that same operation wipes the flash and, unless EESAVE is set, the EEPROM. The protection therefore comes down only at the exact moment the firmware disappears, and the 100-lead TQFP body changes nothing about that arithmetic because the array size is fixed by the ordering code rather than by the lead frame.
| ATmega2560V recovery geometry | Value |
|---|---|
| Program flash | 256 KB, page-programmable, boot section by BOOTSZ |
| Data EEPROM | 4 KB, cleared by chip erase unless EESAVE |
| SRAM | 8 KB |
| Core and clock | AVR RISC at 8 MHz |
| Protection | lock bits LB1/LB2 and BLB0/BLB1, fuse bytes |
| Package | 100-lead TQFP, 100 pins |
the ATmega2560V programming interface under protection
The part is reached over the in-system serial programming interface driven by the reset, clock and data pins, and the same wires carry the read of the fuse and lock bytes. What fails under a set lock byte is the array read: a programmer asking for flash or EEPROM receives blank words while the part still runs its firmware normally and returns its configuration bytes cleanly. The practical routes are a clean read while the lock byte is open, a firmware-assisted dump where the boot lock bits allow it, or a chip erase the customer must approve in writing.
the decision tree for a decode ATmega2560V locked program file job
Read the fuse and lock bytes first, then decide, because that result settles whether any firmware can be recovered at all. An open lock byte means a clean read over the programming interface and the heximal can be pulled directly, while a part with LB1 and LB2 both programmed leaves only the destructive erase as a route to a blank device. The ATmega2560V is the 256 KB of flash device in a 100-lead TQFP body, so the capacity marking and the package settle the array size before anything is priced. The 100-pin body and the external memory interface are the traits that separate this member from the 64-pin siblings. What survives the lock: the fuse and lock bytes themselves, the device signature and the calibration byte, the peripheral registers while the part runs, and the EEPROM if EESAVE was programmed before any erase.
what the neighbouring parts tell you about ATmega2560V
When a board arrives marked only with a partial code, the megaAVR family is the place to look, because its members share the same lock byte, the same fuse layout and the same erase coupling while differing in flash, SRAM, EEPROM, pin count and on-chip peripherals. Neighbouring members span 16 KB to 256 KB of flash with SRAM from 1 KB to 16 KB, and the low-voltage V grades trade clock speed for a wider supply range without changing the lock byte.
Related work on attack mcu atmega162 flash, attacking atmega328p lock bit protection how the fuse and lock bytes work, recover mcu atmega2560 flash follows the same order of operations, while avr mcu atmega64 flash firmware cloning covers the next capacity step and break atmega16l locked mcu flash memory the larger package.
what to hand back for a decode ATmega2560V locked program file request
For a board that arrived as a decode ATmega2560V locked program file request, the deliverable is a confirmed capacity, a lock-byte state and a priced route agreed in writing before any destructive step, and our engineers read the fuse and lock bytes first.
Decrypt ATmega1281 encrypted EEPROM program
A request to decrypt ATmega1281 encrypted EEPROM program begins with the fact that ATmega1281 carries 128 KB of in-system programmable flash and 8 KB of SRAM and runs at 16 MHz in a 64-lead TQFP body. The work starts with the lock byte and the fuse bytes, because a megaAVR guards its arrays with lock bits rather than a numeric readout level.
Decrypt Microprocessor ATmega1281 Eeprom and extract MCU ATmega1281 code from flash memory, prepare Microcontroller ATmega1281 unit clone by copy the firmware to new MCU unit
decrypt ATmega1281 encrypted EEPROM program: reading the protection before the array
A classic megaAVR protects its memory with a lock-bit byte rather than a graded level. LB1 and LB2 are the memory lock bits: with both unprogrammed the flash, EEPROM and fuse bytes are readable over the programming interface, programming either one blocks further writes and verification, and programming both closes read-back so an external tool sees only blank words for the arrays. BLB0 and BLB1 are separate boot lock bits that govern what the boot section and the application section may do with SPM writes and LPM reads, so a firmware-assisted dump is either enabled or walled off independently of the main lock bits. The fuse bytes sit beside the lock byte: CKSEL and SUT choose the clock, BOOTSZ and BOOTRST size and place the boot section, EESAVE decides whether a chip erase keeps the EEPROM, SPIEN enables serial programming and RSTDISBL repurposes the reset pin. The lock and fuse bytes stay readable while the arrays do not, which is why the first move on the bench is always a read of those bytes and never an erase.
how the ATmega1281 memory is laid out
On the ATmega1281 the 128 KB program array is written a page at a time and erased as a whole, with a boot section whose size is set by the BOOTSZ fuses. Beside it sits 8 KB of SRAM and 4 KB of data EEPROM, the latter being an independent array that a chip erase clears unless EESAVE was programmed. The only operation that clears the lock bits is a chip erase, and that same operation wipes the flash and, unless EESAVE is set, the EEPROM. The protection therefore comes down only at the exact moment the firmware disappears, and the 64-lead TQFP body changes nothing about that arithmetic because the array size is fixed by the ordering code rather than by the lead frame.
| ATmega1281 recovery geometry | Value |
|---|---|
| Program flash | 128 KB, page-programmable, boot section by BOOTSZ |
| Data EEPROM | 4 KB, cleared by chip erase unless EESAVE |
| SRAM | 8 KB |
| Core and clock | AVR RISC at 16 MHz |
| Protection | lock bits LB1/LB2 and BLB0/BLB1, fuse bytes |
| Package | 64-lead TQFP, 64 pins |
the ATmega1281 interface once protection is set
The part is reached over the in-system serial programming interface driven by the reset, clock and data pins, and the same wires carry the read of the fuse and lock bytes. What fails under a set lock byte is the array read: a programmer asking for flash or EEPROM receives blank words while the part still runs its firmware normally and returns its configuration bytes cleanly. The practical routes are a clean read while the lock byte is open, a firmware-assisted dump where the boot lock bits allow it, or a chip erase the customer must approve in writing.
choosing the route for decrypt ATmega1281 encrypted EEPROM program
Read the fuse and lock bytes first, then decide, because that result settles whether any firmware can be recovered at all. An open lock byte means a clean read over the programming interface and the heximal can be pulled directly, while a part with LB1 and LB2 both programmed leaves only the destructive erase as a route to a blank device. The ATmega1281 is the 128 KB of flash device in a 64-lead TQFP body, so the capacity marking and the package settle the array size before anything is priced. The 64-pin body with the same large flash array is the identifying trait of this member. What survives the lock: the fuse and lock bytes themselves, the device signature and the calibration byte, the peripheral registers while the part runs, and the EEPROM if EESAVE was programmed before any erase.
comparing ATmega1281 with its family
When a board arrives marked only with a partial code, the megaAVR family is the place to look, because its members share the same lock byte, the same fuse layout and the same erase coupling while differing in flash, SRAM, EEPROM, pin count and on-chip peripherals. Neighbouring members span 16 KB to 256 KB of flash with SRAM from 1 KB to 16 KB, and the low-voltage V grades trade clock speed for a wider supply range without changing the lock byte.
Our notes on attack mcu atmega162 flash, attacking atmega328p lock bit protection how the fuse and lock bytes work, recover mcu atmega1280v program and avr mcu atmega64 flash firmware cloning use the same bench sequence, and break atmega16l locked mcu flash memory records the variant with the wider supply range.
what the customer receives from a decrypt ATmega1281 encrypted EEPROM program job
For a board that arrived as a decrypt ATmega1281 encrypted EEPROM program request, the deliverable is a confirmed capacity, a lock-byte state and a priced route agreed in writing before any destructive step, and our engineers read the fuse and lock bytes first.
Decrypt ATmega2561 protected dump file
A request to decrypt ATmega2561 protected dump file begins with the fact that ATmega2561 carries 256 KB of in-system programmable flash and 8 KB of SRAM and runs at 16 MHz in a 64-lead TQFP body. The work starts with the lock byte and the fuse bytes, because a megaAVR guards its arrays with lock bits rather than a numeric readout level.
Decrypt Microprocessor ATmega2561 memory and extract dump from flash memory and eeprom memory, the content include program and data which will be presented in the format of binary or heximal
how to decrypt ATmega2561 protected dump file without losing the array
A classic megaAVR protects its memory with a lock-bit byte rather than a graded level. LB1 and LB2 are the memory lock bits: with both unprogrammed the flash, EEPROM and fuse bytes are readable over the programming interface, programming either one blocks further writes and verification, and programming both closes read-back so an external tool sees only blank words for the arrays. BLB0 and BLB1 are separate boot lock bits that govern what the boot section and the application section may do with SPM writes and LPM reads, so a firmware-assisted dump is either enabled or walled off independently of the main lock bits. The fuse bytes sit beside the lock byte: CKSEL and SUT choose the clock, BOOTSZ and BOOTRST size and place the boot section, EESAVE decides whether a chip erase keeps the EEPROM, SPIEN enables serial programming and RSTDISBL repurposes the reset pin. The lock and fuse bytes stay readable while the arrays do not, which is why the first move on the bench is always a read of those bytes and never an erase.
the ATmega2561 memory geometry and its protection cost
On the ATmega2561 the 256 KB program array is written a page at a time and erased as a whole, with a boot section whose size is set by the BOOTSZ fuses. Beside it sits 8 KB of SRAM and 4 KB of data EEPROM, the latter being an independent array that a chip erase clears unless EESAVE was programmed. The only operation that clears the lock bits is a chip erase, and that same operation wipes the flash and, unless EESAVE is set, the EEPROM. The protection therefore comes down only at the exact moment the firmware disappears, and the 64-lead TQFP body changes nothing about that arithmetic because the array size is fixed by the ordering code rather than by the lead frame.
| ATmega2561 recovery geometry | Value |
|---|---|
| Program flash | 256 KB, page-programmable, boot section by BOOTSZ |
| Data EEPROM | 4 KB, cleared by chip erase unless EESAVE |
| SRAM | 8 KB |
| Core and clock | AVR RISC at 16 MHz |
| Protection | lock bits LB1/LB2 and BLB0/BLB1, fuse bytes |
| Package | 64-lead TQFP, 64 pins |
reading the ATmega2561 over the programming interface
The part is reached over the in-system serial programming interface driven by the reset, clock and data pins, and the same wires carry the read of the fuse and lock bytes. What fails under a set lock byte is the array read: a programmer asking for flash or EEPROM receives blank words while the part still runs its firmware normally and returns its configuration bytes cleanly. The practical routes are a clean read while the lock byte is open, a firmware-assisted dump where the boot lock bits allow it, or a chip erase the customer must approve in writing.
when a decrypt ATmega2561 protected dump file job needs an authorised erase
Read the fuse and lock bytes first, then decide, because that result settles whether any firmware can be recovered at all. An open lock byte means a clean read over the programming interface and the heximal can be pulled directly, while a part with LB1 and LB2 both programmed leaves only the destructive erase as a route to a blank device. The ATmega2561 is the 256 KB of flash device in a 64-lead TQFP body, so the capacity marking and the package settle the array size before anything is priced. The 64-pin body with the same large flash array is the identifying trait of this member. What survives the lock: the fuse and lock bytes themselves, the device signature and the calibration byte, the peripheral registers while the part runs, and the EEPROM if EESAVE was programmed before any erase.
identifying the ATmega2561 against its siblings
When a board arrives marked only with a partial code, the megaAVR family is the place to look, because its members share the same lock byte, the same fuse layout and the same erase coupling while differing in flash, SRAM, EEPROM, pin count and on-chip peripherals. Neighbouring members span 16 KB to 256 KB of flash with SRAM from 1 KB to 16 KB, and the low-voltage V grades trade clock speed for a wider supply range without changing the lock byte.
The same read-first routine appears in attack atmega165pv microcontroller flash memory, attack atmega32u2 mu microprocessor fuse bit, attack avr atmega64l program and attack chip atmega8a binary, with attack chip attiny2313 firmware showing how the larger array changes the pricing.
the deliverable for a decrypt ATmega2561 protected dump file request
For a board that arrived as a decrypt ATmega2561 protected dump file request, the deliverable is a confirmed capacity, a lock-byte state and a priced route agreed in writing before any destructive step, and our engineers read the fuse and lock bytes first.
Encrypted Programming Protects the Factory, Not the Product
A brand owner who sends a plaintext image to a contract manufacturer has given that manufacturer the product. Encrypting the file is the response, and it is a reasonable one, but it is important to be clear about what it achieves.
It does not make the image unreadable to the manufacturer, because the manufacturer has to program it. It makes the image unreadable to anyone who does not have the key, and it makes a leak attributable to whoever held the key. The second property is the one that matters commercially.
What the arrangement looks like
The brand owner encrypts the image and sends the ciphertext. The manufacturer’s programmer holds the key, decrypts in hardware, and burns the device. The plaintext exists inside the programmer for the duration of the operation.
| Party | Holds | Can produce the image |
|---|---|---|
| Brand owner | The plaintext and the key | Yes |
| Manufacturer | The ciphertext and the key | Yes, transiently |
| Manufacturer’s staff | The key, if the equipment allows | Depends on the implementation |
| Anyone else | The ciphertext | No |
The third row is where the control either works or does not. If the key is inside a sealed programmer that never exposes it, a technician cannot produce the image even with full access to the equipment. If the key is a file on the programming PC, the technician can.
Three implementations and their weaknesses
The security of the arrangement is entirely in how the key is held, and three implementations appear in practice.
The key embedded in the programmer’s firmware is the most common and the weakest. The programmer decrypts internally, so the key never appears on the PC, which is the point. The weakness is that the key is in a firmware image on a flash chip inside the unit, and that chip is readable.
| Implementation | Key location | Weakness |
|---|---|---|
| Embedded in the programmer firmware | Internal flash | Extractable by reading the unit |
| On a dongle | A separate USB device | Extractable, and clonable |
| Per-programmer key with a server | A server, released per job | Depends on the server’s security |
| In a secure element in the programmer | A protected die | Strongest; extraction requires silicon work |
The first row is defeated by the same technique as any other embedded device, and the work is described in the programmer as an asset. A programmer is a small embedded system with a flash chip and a plastic case, and it is not designed to resist someone who opens it.
The third row is the strongest practical design and it moves the problem to the network. A programmer that must obtain a key per job, over an authenticated connection, with a job count, is a programmer whose compromise is bounded by what it can request.
Why the cryptography is not the weak point
The cipher is fine. A standard block cipher in a standard mode is not going to be broken, and the choice of mode matters only for how much ciphertext an attacker can collect.
The weakness is that the plaintext must exist somewhere in the clear, and the place it exists is the place that programs the device. Any measure that puts the plaintext on the manufacturing floor is a measure whose security is physical.
| Layer | Strength | Where it fails |
|---|---|---|
| Cipher | Strong | Not the problem |
| Key storage | Varies | The actual weakness |
| Key release policy | Varies | The actual weakness |
| Physical control of the line | Varies | The actual weakness |
| Contractual terms | Strong, if enforced | Detection rather than prevention |
The fifth row is the one that gives the arrangement its real value. A manufacturer who leaks an image that was sent in ciphertext, under a contract that names the key holder, is a manufacturer who can be identified. That is worth more in practice than a marginal improvement in cryptographic strength.
What a customer should ask
Four questions establish whether the arrangement does what it is supposed to.
Does the manufacturer ever see the key in a form they can copy? This is the question that distinguishes a sealed programmer from a PC application with a key file.
| Question | Good answer | Bad answer |
|---|---|---|
| Is the key ever visible to staff? | No, sealed unit | Yes, a file on the PC |
| Can a unit be used after it is retired? | Keys revoked | Unit retains the key |
| Is each job authorised? | Per-job release | One key, unlimited use |
| Is the file bound to a product? | Product identifier in the header | Any file works |
The fourth row is the one that prevents a subtler problem. A programmer that accepts any correctly encrypted file will program a competitor’s image if one is supplied, and a manufacturer who is asked to run an extra batch has no way to know which product it belongs to.
Recovering an image from this arrangement
The recovery route follows from the three implementations.
Where the key is in the programmer’s firmware, the image is recoverable by reading the programmer: the key comes out with it, and the ciphertext is already in hand. That is not an attack on the cryptography; it is an attack on the storage.
| Implementation | Route to the image |
|---|---|
| Key in programmer firmware | Read the programmer, then decrypt |
| Key on a dongle | Read the dongle |
| Per-job key from a server | Capture the key at release, or attack the server |
| Key in a secure element | Silicon attack, or capture the plaintext |
The fourth row leads back to the manufacturing floor. If the key cannot be extracted, the plaintext still exists in the programmer’s memory during a job, and a probe on the right bus during a programming operation captures it — which is the same class of measurement as reading a memory bus.
What the review produces
The deliverable is a key-flow diagram with four annotations: where the key lives, who can obtain it, what a person with physical access would recover, and what a leak would be attributable to.
That last item is the one that justifies the arrangement. A diagram that shows the key inside a sealed unit, released per job, with a record of which job used it, describes a scheme where a leaked image can be traced to a specific batch and a specific operator. A diagram that shows a key file on a shared drive describes a scheme where a leak is untraceable, and untraceable leaks are the ones that turn into a competitor’s product.
| Finding | Recommendation |
|---|---|
| Key on a PC filesystem | A sealed programmer with per-job release |
| One key for all products | Per-product keys in the header |
| Units retain keys after retirement | A revocation and decommissioning process |
| No job record | A release log tied to the file hash |
The honest limitation
Encrypted programming does not make a product confidential on a manufacturing floor. It makes a leak attributable, and it raises the effort required for a casual one.
A customer who is told this and still chooses the arrangement has made an informed decision, and the arrangement is then worth having: it deters the opportunistic copy and it provides a path to recourse. A customer who believes the arrangement makes the image unreadable will not apply the other controls, and those controls are the ones that matter.
| Belief | Actual protection |
|---|---|
| Encrypted file means the factory cannot read it | It can, in the programmer |
| The key cannot be extracted | It can, from the equipment |
| The arrangement is sufficient alone | It is one layer of four |
The four layers — contract, process, equipment and silicon — are set out in supply chain leaks. The silicon layer that backstops them is the read protection in three protection layers, and its effectiveness on a device that has already been programmed is the question answered by the attack surface map.
What we deliver for this class of request is a review of the key handling: where the key lives, who can obtain it, and what a person with access to the equipment would recover. Where the finding is that the key is extractable, the practical recommendation is usually a sealed programmer with per-job authorisation rather than a stronger cipher.
Reverse ATtiny48V protected EEPROM program
A request to reverse ATtiny48V protected EEPROM program begins with the fact that ATtiny48V carries 4 KB of in-system programmable flash and 256 bytes of SRAM and runs at 8 MHz in a 32-lead TQFP body. The work starts with the lock byte and the fuse bytes, because a tinyAVR guards its small arrays with lock bits and reaches its debug port over the reset line.

how to reverse ATtiny48V protected EEPROM program without losing the array
A tinyAVR protects its memory with a lock-bit byte in the same AVR tradition, but on a smaller map and without the boot-section split of the larger parts. LB1 and LB2 are the memory lock bits: with both unprogrammed the flash, EEPROM and fuse bytes read freely over the serial programming interface, and programming both closes external read-back so a programmer receives blank words for the arrays. The fuse bytes carry CKSEL and SUT for the clock, CKDIV8 for the divider, CKOUT for the clock output, RSTDISBL for the reset pin, DWEN for the debug interface, SPIEN for serial programming, EESAVE for the EEPROM and BODLEVEL for the brown-out threshold. The lock and fuse bytes stay readable while the arrays do not, so the first bench move is a read of those bytes rather than an erase.
the ATtiny48V memory geometry and its protection cost
On the ATtiny48V the 4 KB program array is written a page at a time and erased as a whole, beside 256 bytes of SRAM and 64 bytes of data EEPROM. There is no separate boot block to negotiate with: the whole array is application space on this class of device, which is why the boot lock bits used on larger AVR parts have no counterpart here. A chip erase is the only operation that clears the lock bits, and it wipes the flash and, unless EESAVE is set, the EEPROM at the same moment. The 32-lead TQFP body with 32 pins changes none of that arithmetic, since the array size is fixed by the ordering code and the package letters only describe the lead frame.
| ATtiny48V recovery geometry | Value |
|---|---|
| Program flash | 4 KB, page-programmable, no boot block |
| Data EEPROM | 64 bytes, cleared by chip erase unless EESAVE |
| SRAM | 256 bytes |
| Core and clock | AVR RISC at 8 MHz, debugWIRE on the reset line |
| Protection | lock bits LB1/LB2, fuse bytes |
| Package | 32-lead TQFP, 32 pins |
reading the ATtiny48V over the programming interface
These parts are programmed over the serial interface using the reset, clock and data pins, and the same three wires return the fuse and lock bytes. The on-chip debug system is debugWIRE, a single-wire interface multiplexed onto the reset line and enabled by the DWEN fuse, rather than a multi-pin boundary-scan port. Under a set lock byte the array read fails while the device still executes its firmware and still answers a signature request. The routes are therefore a clean read with the lock byte open, a firmware-assisted dump where SELFPRGEN allows in-application writes, or an approved chip erase.
when a reverse ATtiny48V protected EEPROM program job needs an authorised erase
Read the fuse and lock bytes first and check DWEN and RSTDISBL, because the result settles both the recovery route and which programmer can reach the part. An open lock byte means a clean read and a direct heximal, while a fully locked part leaves only the destructive erase. The ATtiny48V is the 4 KB of flash device in a 32-lead TQFP body, so the capacity marking and the package settle the array size before anything is priced. The 28-pin and 32-pin bodies with the larger I/O count mark this member. What survives the lock: the fuse and lock bytes, the device signature, the calibration value, the peripheral registers while the chip runs, and the EEPROM if EESAVE was programmed before any erase.
identifying the ATtiny48V against its siblings
When a board carries only a partial marking, the tinyAVR family is the place to look, because its members share the lock byte, the debugWIRE port and the same erase coupling while differing in flash, SRAM, EEPROM, pin count and peripherals such as the universal serial interface and the high-speed timer. Neighbouring members span 2 KB to 8 KB of flash in 14-pin to 32-pin bodies, with the low-voltage V grades trading clock speed for a wider supply range while keeping the same lock byte and debugWIRE port. The package marking and the signature read over the programmer settle which member is present before any protection work begins.
The same read-first routine appears in break ic attiny48v firmware, break ic attiny84 heximal, break ic attiny85v software and break ic attiny88 heximal, with break locked atmega32u2 microprocessor flash showing how the larger array changes the pricing.
the deliverable for a reverse ATtiny48V protected EEPROM program request
For a board that arrived as a reverse ATtiny48V protected EEPROM program request, the deliverable is a confirmed capacity, a lock-byte state and a priced route agreed in writing before any destructive step, and our engineers read the fuse and lock bytes first.
Protocol Reverse Engineering: Captures, Fields, State Machines
A customer who asks for firmware reverse engineering usually wants to talk to a device, replace a device, or build something that interoperates with a device. In all three cases the useful output is a description of the interface, and in all three cases the description is built from three artefacts in a fixed order.
The order matters because each artefact is the input to the next, and because a mistake in one propagates.
Artefact one: the capture
Everything begins with recorded traffic. Without a capture there is nothing to analyse, and the quality of the capture determines the ceiling on everything that follows.
A capture needs three properties. It has to be complete, meaning it includes the framing and not just the payload. It has to be synchronised, meaning each message has a timestamp relative to a common clock. And it has to be annotated, meaning each capture is associated with the action that produced it.
| Capture property | Consequence if missing |
|---|---|
| Complete framing | Field boundaries cannot be found |
| Timestamps | Sequence and timeouts cannot be inferred |
| Annotated actions | The stimulus-response relationship is lost |
| Repeated runs | Transient behaviour is mistaken for protocol |
The fourth row is the one that distinguishes a professional capture from a log. A single capture of a session shows what happened once; five captures of the same session show what is stable, and only the stable parts are protocol.
Where to take the capture
The point of capture determines what can be seen, and the choice is usually made by convenience rather than by information.
A capture at the host side of a cable sees the protocol as the host implements it, including retries and error handling. A capture at the device side sees the same messages but with the device’s timing. A capture on the internal bus between a processor and its peripheral sees the raw register accesses, which is more information and harder to interpret.
| Capture point | Sees | Difficulty |
|---|---|---|
| Host serial port | The protocol, with host behaviour mixed in | Low |
| Device pins | The protocol, with device timing | Low |
| Internal SPI or I2C | Register-level operations | Medium |
| Memory bus | Everything, including code fetches | High |
The second row is usually the best choice, because it isolates the protocol from the host’s own retry logic. A host that retries three times and then reports a failure produces a capture with three identical requests, and an analyst who does not know about the retries will conclude that the protocol requires repetition.
Artefact two: the field map
With captures in hand, the second artefact is a description of the message format: where each field begins, how wide it is, and what it means.
The method is differential. Compare messages that differ in exactly one respect — a value changed, a length changed, a command changed — and the bytes that move are the field that carries it.
| Comparison | Reveals |
|---|---|
| Same command, different payload value | The value field and its width |
| Same command, different payload length | A length field, and whether it is a byte or a word |
| Different command, same structure | The command field’s position |
| Same command, different sequence number | The sequence field |
| Same command, different device | The address or identifier field |
The third row is the anchor for everything else, because the command field is the one field whose position is fixed by the protocol’s design. Once the command byte is known, messages can be grouped by it, and each group can be analysed separately.
| Field type | How to find it | Confidence signal |
|---|---|---|
| Command | Varies with the operation | Fixed position across sessions |
| Length | Correlates with the message size | Linear relationship |
| Address | Varies with the target | Matches a known address |
| Payload | The remainder | Fills the declared length |
| Checksum | At a fixed offset from the end | Recomputable |
The fifth row is the one that stops projects, and it deserves its own discussion.
The checksum problem
A checksum at the end of a message is easy to identify and hard to reproduce, because the algorithm is a choice rather than a standard.
The identification is straightforward: the last one, two or four bytes change whenever any other byte changes, and they do not change when the message is repeated unchanged. That pattern is conclusive.
Reproducing it requires the algorithm, and there are three ways to get it. The first is to guess from a shortlist: sum, XOR, CRC-8, CRC-16 with the common polynomials. The second is to derive it from enough samples by solving for the parameters, which works for CRCs because the polynomial, initial value and reflection are a small search space. The third is to read it out of the firmware, which is definitive and requires the image.
| Route | Requirement | Reliability |
|---|---|---|
| Guess from a shortlist | A few samples | High for common algorithms |
| Solve from samples | A few dozen samples | High, if it is a CRC |
| Read from firmware | The image | Definitive |
| Capture during a valid session and replay | Nothing | Only for replay |
The fourth row is worth noting because it is the shortcut that works when the checksum cannot be derived: if the goal is to send a limited set of messages, capture them from a real session and replay. That produces a working interface and no understanding, which is sometimes enough.
Artefact three: the state machine
The third artefact is the description of how the device moves between states, and it is the one that makes an implementation possible.
The method is stimulus-response: put the device in a known state, apply one input, observe the response and the new state. Repeat for every input from every state. The result is a directed graph.
| Transition type | How to detect |
|---|---|
| Accepted command | A response that differs from the idle response |
| Rejected command | An error response, or the same response as idle |
| Timeout | A state change with no input |
| Session end | A transition to the initial response pattern |
The third row is the one that captures have to be long enough to contain. A device that drops a session after five seconds of inactivity has a timeout transition, and a capture of a fast interactive session will not show it. Deliberately pausing mid-session is the way to find these, and it is the test most often omitted.
| Omitted test | What is missed |
|---|---|
| Pause mid-session | Timeouts and session expiry |
| Send commands out of order | Ordering enforcement |
| Send a malformed message | Error handling and recovery |
| Power cycle at each state | Whether the state is persisted |
| Two hosts at once | Contention behaviour |
What the deliverable looks like
A specification that another engineer can implement from, plus a conformance test that proves the implementation matches.
| Component | Content |
|---|---|
| Frame description | Field table with offsets, widths and meanings |
| Command set | Each command with its parameters and responses |
| State machine | States, transitions, guards, timeouts |
| Error behaviour | What the device does when a message is invalid |
| Conformance test | Vectors and expected responses |
The fifth component is what separates a specification from notes. A test suite that a second implementation can be run against converts “we think it works like this” into “we know it works like this”, and it is the only artefact that survives contact with a real product.
Where this fits
The protocol route is often the cheapest path to interoperability, and it does not require the firmware at all; the comparison is in attacking MCU firmware.
Where the checksum has to come from the firmware, the image is obtained by the routes in extracting MCU firmware, and the routine that computes it is found by the search in credential hunting in firmware. Where the device is undocumented to the point that identification is the first problem, the public record is the place to start, as set out in discovering firmware from public sources.
What we deliver is the specification and the conformance test, and what we do not deliver is a claim that the state machine is complete. A state machine derived from observation is complete with respect to the observations, and the report says which transitions were tested and which were not.
Reverse Engineering MCU LPC2131FBD64 Heximal: Thirty-Two Kilobytes of Room
Array size is usually treated as a purchasing decision. On the smallest member of this branch it is a design constraint that leaves fingerprints all over the firmware, and those fingerprints are useful when the code arrives without documentation.
Thirty-two kilobytes of flash and eight kilobytes of SRAM is enough for a serious product and not enough for a comfortable one. Everything the firmware wants to do has to fit, and what it chose to leave out describes the product as clearly as what it chose to include.
The ratio that shapes everything
The boot loader occupies a fixed region at the top of the array regardless of density, so its share of the total grows as the array shrinks. On the large parts it is a rounding error. Here it is a noticeable slice of a small budget, and the application has to be built and linked around a hole it cannot use.
The practical consequences appear in three places:
- the image is compressed or overlapped, because there was no room for padding
- error handling is minimal, because a full reporting path costs kilobytes
- the product has no field update mechanism of its own, because a second image will not fit
That third point is the most useful observation. A device in this density almost never carries a bootloader written by the customer, which means the only programming interface is the factory one, which means recovery work starts at the factory loader rather than in the application.
What a heximal of a small device looks like
Small files are easy to underestimate. A heximal from this part is a few tens of kilobytes, dense from the first byte to the last, with a short erased tail. There is no space wasted on alignment and no room for a font table unless the font is the product.
Reading it, the density has an effect on interpretation. Functions are packed with no padding between them, so a linear disassembly desynchronises less often and the boundaries are easier to find. On the other hand, the compiler has been aggressive: code is Thumb almost everywhere, tail calls are common, and functions share epilogues in ways that make call graphs harder to follow than on a part with room to spare.
| Property | Effect on reading the image |
|---|---|
| Thumb throughout | instruction boundaries every two bytes, dense and readable |
| no padding between functions | boundaries visible from branch targets only |
| shared epilogues | the call graph needs branch analysis, not linear scanning |
| compressed tables | lookups appear as data with a short decoder in front |
| minimal error paths | handlers are short, and often fall through to a reset |
The eight kilobyte SRAM problem
SRAM is the second constraint and the more interesting one. Eight kilobytes has to hold the stack, the working buffers, the protocol state and anything copied out of flash for speed. There is very little left over.
The consequence for recovery is direct. On a device with generous RAM, a recovered image can be run on a bench with a small monitor routine loaded into RAM alongside it. Here there is barely room for the monitor, and what room exists is exactly the memory the firmware is using for its stack. Any live analysis has to be incremental: halt, read, resume, rather than load and observe.
It also means the firmware rarely relocates code to RAM, because it cannot afford to. That is good news: on this part, what is in the flash is almost exactly what runs, and the duplication problem described in LPC2114FBD64 code reading is largely absent.
Recovery routes in this density
The options are the same as everywhere in the family, but their relative cost changes.
The factory loader is the first choice, and on a small part it is fast — a full read is seconds. The debug port is the second, and it works better here than on a larger device because there is less state to capture. Invasive work is the last, and it is worth noting that a small die is not automatically easier to open; the array is smaller but the surrounding logic is the same.
The protection states behave as documented in LPC2101FBD48 protection states, and the erase consequence is as absolute as it is on any other density, because sector 0 is still the sector that holds the vectors — see LPC2104FBD48 erase behaviour.
What the customer usually wants
Requests for a small device are rarely about the code. They are about three things: a replacement board for an obsolete product, the calibration values that a repair needs, or an understanding of a protocol that the documentation lost.
All three are achievable from a thirty-two kilobyte image, and the third is where the density actually helps. A protocol implementation that fits in this much space is compact enough to read end to end, and compact implementations are the ones that can be described completely in a report. Larger images hide their protocol inside layers of abstraction; this one cannot afford them.
One thing to check before delivering
Confirm the device density from the part identifier rather than from the file size. A heximal that is thirty-two kilobytes long could have come from this part or from the bottom of a larger one, and the boot region sits at a different address in each case. Getting that wrong produces a file that verifies and does not boot, for reasons that take an afternoon to find.
The related note on where the boot region begins, and why it must be excluded from anything written back, is in LPC2124FBD64 binary anatomy. When the array is large enough that partial recovery becomes possible, LPC2132FBD64 data recovery covers the arithmetic of missing sectors.
Small is not simple
The instinct is that a small device is a simple job. It is a faster job, and the analysis is often more complete, but the constraints that made the firmware small are exactly the constraints that make its behaviour tight and interlocked. A product that had to fit into thirty-two kilobytes is a product where every byte earned its place, and reading it is correspondingly dense work.
Encrypted Update Packages: The Key Sits in the Bootloader
An encrypted firmware update is a different thing from encrypted code, and the difference is not technical detail. Code encrypted at rest is decrypted by the fetch hardware and the key never moves. An update package is decrypted by software that is already on the device, and that software must hold the key in order to do its job.
One of these is designed to be irreversible. The other is designed to be reversible by the device, which means it is reversible by anyone who has the device.
What package encryption is for
The purpose of encrypting a distribution package is not to stop someone reading the firmware of the device they own. It is to stop three other things.
It stops a competitor from taking an update file and reading the code. It stops an attacker from building a modified image that the device would accept. And on some products it stops an unauthorised party from producing compatible hardware, because the update is the only thing that carries the proprietary parts.
| Threat | Mechanism that addresses it |
|---|---|
| Reading the code from a package | Encryption |
| Installing a modified image | Signature |
| Using the package on another product | Binding to a device identity |
| Extracting the key from a package | Key wrapping |
The second row is the one that matters most for product security, and note that it does not require encryption. A signed but unencrypted package cannot be modified, and anyone can read it. Many products choose encryption for commercial reasons and signature for security reasons, and they are separate decisions.
Three container structures
The structure of the package determines where the key is and how hard it is to get.
Signature only: the package contains the image in plaintext and a signature over it. There is nothing to decrypt. The work is to verify the signature or to bypass the verification, and the image is already readable.
Symmetric encryption plus signature: the image is encrypted with a key that the bootloader holds, and the ciphertext is signed. The key is in the bootloader, either as a constant or in a protected region, and finding it is a search of the bootloader rather than of the application.
| Structure | Image readable | Key location | Difficulty |
|---|---|---|---|
| Signature only | Yes | Not needed | None |
| Symmetric plus signature | No | Bootloader | Moderate |
| Hybrid: RSA-wrapped session key | No | Bootloader holds a private key | Moderate |
| Per-device key | No | Derived from device identity | High |
The third row is the common modern design and it is worth describing because it looks stronger than it is. Each package carries a random session key, encrypted with the device’s public key; the device decrypts the session key with its private key and then decrypts the image. The device’s private key is in the bootloader or in a protected area, and recovering it recovers every package that device would accept.
Why the bootloader is the target
The bootloader must decrypt, so it must hold or derive the key, and that fact is unavoidable for any design. The only variations are where the key is stored and how well that storage is protected.
| Storage | Extractable by | Effort |
|---|---|---|
| Constant in the bootloader code | Reading the bootloader | Low |
| In a separate flash page | Reading that page | Low |
| In OTP, read-protected | An attack on the protection | Moderate |
| Inside a secure element | Attacking the element | High |
| Derived from a PUF | Not extractable | Not possible |
The first two rows account for most real products. A key stored as a byte array in the bootloader is found by reading the bootloader and looking for a high-entropy constant; the search is the one described in credential hunting in firmware.
The fourth row is the case where the crypto operation happens inside a secure element that never releases the key, and only the plaintext comes out. That is a genuine improvement, and it moves the attack to the element, which is a different and usually harder target.
Reading the package without the key
There is a route that does not require the key, and it is worth knowing because it is often cheaper.
A device that accepts an update and then runs it can be made to reveal the decrypted image if the decryption happens before verification, or if the plaintext is briefly in memory. A debug session during an update, on a device whose debug port is available, captures the image as it is written to flash.
| Route | Requires | Yields |
|---|---|---|
| Extract the key | Read access to the bootloader | Every package |
| Capture during update | Debug access at update time | One package |
| Read the flash after update | Read access to the array | The installed image |
| Intercept the bus | Physical access | The package as received |
The third row is the simplest and is often overlooked. If the device has already installed an update, the plaintext is in its flash, and reading the flash gives the image without any decryption at all. The only situation where this fails is a device that keeps the image encrypted at rest, which is the case discussed in instruction-fetch decryption.
When the package is not encrypted at all
Before any key is sought, it is worth establishing that there is a key. A significant fraction of packages described as encrypted are compressed, and a compressed image looks like noise to a hex viewer.
The distinction is measurable. Compression produces high entropy with structure: a header that declares the uncompressed length, a stream with a repeating pattern at block boundaries, and a decompressor in the bootloader that a search for a known algorithm will find. Encryption produces high entropy without structure and without a declared length.
| Observation | Compression | Encryption |
|---|---|---|
| Header declares an output length | Usually | Rarely |
| Entropy uniform but block-aligned | Yes | No |
| A decompressor exists in the bootloader | Yes | No |
| Changing one byte breaks everything | No, varies | Yes |
| Tooling recognises the format | Often | No |
The fourth row is a cheap test. Flip a byte in the middle of a compressed stream and the tail of the output is usually corrupt while the head is fine. Flip a byte in an encrypted stream, in a mode with chaining, and everything after it is corrupt. The difference is visible in a single experiment.
The binding question
A package bound to a device identity is a package that only works on that device, and this changes the commercial picture.
If the binding is a check performed by the bootloader against the device’s identifier, capturing a package for device A does not give a package that device B will accept. If the binding is cryptographic — the package is encrypted to device A’s public key — then even a valid package is useless elsewhere, and the key for device A does not help with device B.
| Binding | Package usable on another device | What is needed |
|---|---|---|
| None | Yes | Nothing |
| Identifier checked in software | Yes, after patching the check | A patch |
| Encrypted to a per-device key | No | That device’s private key |
| Signed per device | No | The vendor’s signing key |
The second row is the one that appears most often in products that claim per-device binding, and it is defeated by a patch to the check rather than by any key recovery. That patch is the work in patching IC code.
What the service delivers
For a package decryption engagement we deliver the decrypted image, the container structure, the key location and how it was obtained, and a statement of whether the key is per-device or common across a product line. That last item determines whether the result generalises, and it is the first thing a customer asks.
| Finding | Implication |
|---|---|
| Key is a constant in the bootloader | Every package for this product is readable |
| Key is per-device | Only this device’s packages are readable |
| No encryption, signature only | The image was always readable |
| Key in a secure element | Not extractable; capture during update instead |
The work begins with the bootloader, which is a separate program in a separate region and is frequently left unprotected even when the application is not. Its layout and the reason it is a separate region are in extracting MCU firmware, and the verification it performs is the chain described in secure boot.
What we will not do is promise decryption of a package whose key is inside a secure element that does not export it. In that case the honest deliverable is a statement of the boundary and the alternative route, which is to capture the plaintext at the moment the device decrypts it.