Posts Tagged ‘break mcu protected data’
Attack Encrypted NRF52833-QDAA-R Flash: QFN40 512 KB Recovery
The NRF52833-QDAA-R is the smallest package in the nRF52833 family, a QFN40 body of 5 x 5 mm with 18 GPIO that still carries the full Bluetooth 5.1 radio, the USB 2.0 full-speed controller and the direction-finding hardware. When the image is sealed and the board is the only copy, the work is to attack encrypted NRF52833-QDAA-R flash and bring the contents out intact. The catch on this part is that the die is packed close under the compound, so the physical route has to be controlled rather than brute forced.
The densest logic in the smallest footprint
Fitting a complete radio SoC into 5 x 5 mm is the reason this variant exists, and it is also where the difficulty concentrates. The part carries 512 KB of flash and 128 KB of RAM behind a Cortex-M4 with FPU at 64 MHz, scoring 217 EEMBC CoreMark from flash at 52 uA/MHz, or 38 uA/MHz from RAM. The radio reaches +8 dBm with transmit power adjustable from -20 dBm in 4 dB steps, holds sensitivity of -96 dBm at 1 Mbps and -103 dBm in 125 kbps long-range mode, and reports RSSI at 1 dB resolution. Recovering an image from a die that small leaves less physical margin to work with at every stage.
Where the protection actually lives
The nRF52 does not use the STM32-style three-level readout protection, so tools built for that model find nothing familiar here. The lock sits in the User Information Configuration Registers as APPROTECT, alongside a control access port, CTRL-AP, that stays available. Writing Enabled, 0x00, to UICR.APPROTECT closes the debug access port in hardware, and the hardware fetches that value at reset, so the state survives a power cycle with no firmware cooperation. Around it sit a flash access control list, secure boot readiness and the debug control and configuration blocks. Reading the UICR is therefore part of understanding the part, not a formality at the end of the job.
The two-step lock and the revision window
Nordic splits the lock into a hardware step and a firmware step, and the gap between them is where the openings are. Firmware is expected to write APPROTECT.FORCEPROTECT as Force, 0x00, at startup, and if that firmware step is skipped the device can look locked without being fully protected, which is often the first thing a careful read of the configuration area reveals. Silicon revisions with the improved two-step APPROTECT, among them nRF52833 revision 2 under build codes Bx0, tightened that check, and on those parts a precisely timed voltage glitch on the supply during boot can slip past it without triggering the erase. The unlock path runs the other way: a CTRL-AP ERASEALL wipes flash, UICR and RAM, code compiled without ENABLE_APPROTECT writes HwDisabled, 0x5A, and after a reset the firmware writes APPROTECT.DISABLE to open the port.
Both APPROTECT.DISABLE and FORCEPROTECT are reset by a pin reset, a power or brownout reset, a watchdog reset, or a wake from System OFF, so any such window has to be caught in a single pass rather than held open.
Ranking the attack surfaces
Against a locked NRF52833-QDAA-R the practical surfaces rank by effort and by what they preserve. The cheapest route that still keeps the image is the one worth trying first.
| Surface | Preserves image | Effort | When used |
|---|---|---|---|
| Supply glitch during boot | yes | medium | revision 2, build codes Bx0 |
| Targeted fault at reset | yes | medium | partly protected units |
| Etch-back and direct die read | yes | high | fully locked, no register route |
| CTRL-AP ERASEALL and reload | no | high | only when loss is acceptable |
Etching back to the silicon
When the register-level routes are closed, the answer is the physical one. The QFN40 body leaves little compound margin, so the mould has to come away in controlled passes while the board keeps running, and the etch has to stop on the die surface without cutting into the pad frame or the exposed thermal pad. Once the silicon is exposed and still live, the array can be addressed directly on the die rather than through the debug port, which sidesteps the access port lock entirely and is the surest way to attack encrypted NRF52833-QDAA-R flash when the register doors are welded shut. Our notes on package decapsulation and on supply glitching describe the technique in detail.
What you get back
You receive the flash binary image of the NRF52833-QDAA-R with the UICR region and the protection state documented, a disassembly-based source reconstruction built from the vector table and the peripheral register map, and a verification report recording how the image was obtained and how it was checked. Where the aim is a working replacement rather than an analysis, the same verified read supports a protected flash duplication and the matching QDAA-R7 source rebuild. The same bench also handles the QIAA-R hex image copy and the locked STM32G474 program.
Break MCU PIC18F442 Software
Break MCU PIC18F442 and extract embedded code from microcontroller pic18f442, the encrypted flash memory heximal of microprocessor pic18f442 will be unlocked;

The top of the stack is breakable and writable. Three register locations, TOSU, TOSH and TOSL hold the contents of the stack location pointed to by the STKPTR register. This allows users to implement a software stack if necessary.
After a CALL, RCALL or interrupt, the software can break the pushed value by breaking the TOSU, TOSH and TOSL registers. These values can be placed on a user defined software stack when Break pic16f88 Mcu data.
At return time, the software can replace the TOSU, TOSH and TOSL and do a return. The user must disable the global interrupt enable bits during this time to prevent inadvertent stack operations.
The STKPTR register contains the stack pointer value, the STKFUL (stack full) status bit, and the STKUNF (stack underflow) status bits. Register 4-1 shows the STKPTR register. The value of the stack pointer can be 0 through 31. The stack pointer increments when values are pushed onto the stack and decrements when values are popped off the stack. At RESET, the stack pointer value will be used to Breaking pic12ce518 Mcu.
The user may break and write the stack pointer value. This feature can be used by a Real Time Operating System for return stack maintenance. After the PC is pushed onto the stack 31 times (without popping any values off the stack), the STKFUL bit is set. The STKFUL bit can only be cleared in software or by a POR.
The action that takes place when the stack becomes full depends on the state of the STVREN (Stack Over-flow Reset Enable) configuration bit. Refer to Section 20.0 for a description of the device configuration bits.
If STVREN is set (default), the 31st push will push the (PC + 2) value onto the stack, set the STKFUL bit, and reset the device. The STKFUL bit will remain set and the stack pointer will be set to ‘0’.
If STVREN is cleared, the STKFUL bit will be set on the 31st push and the stack pointer will increment to 31. Any additional pushes will not overwrite the 31st push, and STKPTR will remain at 31.
Since the Top-of-Stack (TOS) is breakable and writable, the ability to push values onto the stack and pull values off the stack without disturbing normal program execution is a desirable option. To push the current PC value onto the stack, a PUSH instruction can be executed.
This will increment the stack pointer and load the current PC value onto the stack. TOSU, TOSH and TOSL can then be modified to place a return address on the stack.
The ability to pull the TOS value off of the stack and replace it with the value that was previously pushed onto the stack, without disturbing normal execution, is achieved by using the POP instruction. ThePOP instruction discards the current TOS by decrementing the stack pointer.
The previous value pushed onto the stack then becomes the TOS value. These resets are enabled by programming the STVREN configuration bit. When the STVREN bit is disabled, a full or underflow condition will set the appropriate STKFUL or STKUNF bit, but not cause a device RESET.
When the STVREN bit is enabled, a full or underflow will set the appropriate STKFUL or STKUNF bit and then cause a device RESET. The STKFUL or STKUNF bits are only cleared by the user software or a POR Reset.