Break Secured STM32G474VCT6 Source Code: LQFP100 256 KB Recovery
The STM32G474VCT6 is the 100-lead G4 part in a 14×14 mm LQFP100, carrying 256 KB of dual-bank flash with the HRTIM high-resolution timer and enough pins to wire the full digital-power periphery. When the project archive is lost but the board still runs, the aim is not just a binary but working source. To break secured STM32G474VCT6 source code you recover the image and then reconstruct compilable source around the regions the part itself marks as off-limits.
The 100-lead part and its memory
The LQFP100 gives the STM32G474VCT6 the pin room for the FSMC, Quad-SPI and the full set of timers alongside the HRTIM, while keeping 256 KB of ECC-protected dual-bank flash.
Where PCROP changes the picture
The STM32G474VCT6 supports PCROP, a proprietary code readout protection that seals individual flash regions so even a successful image pull cannot expose their contents in plaintext.
Reading the application image
With readout protection at level 1, the SWD and bootloader doors are closed, but the 256 KB array plus the 1 KB OTP and the option bytes are recoverable once the security check is bypassed. The recovery is read twice and checksummed, and the securable memory area is mapped so the source tree reflects the real layout. The same discipline appears in our flash recovery workflow and in the sibling STM32G474QCT6 software clone.
The physical route that opens the array depends on what the option bytes say and on how the sample behaves. A part sealed with a single level of protection usually yields to a glitch injected at the boot-time security check, because the comparison window is narrow and the clock can be stretched around it. Our power glitch notes and clock glitch material set out the timing basis. Samples that resist a supply or clock perturbation are opened physically instead, and the die is then addressed directly.
The decap fallback for a sealed part
When a level-two seal is suspected, the LQFP100 is chemically decapsulated while the die stays electrically live, then the image is restored by optical fault injection at boot or by microprobing. The route is documented on our silicon package decapsulation page, and the STM32G474VET6 binary clone in this batch uses the same opening for the larger 512 KB part.
Working on a 14×14 mm body is straightforward because the die sits centrally with a wide margin of compound around it, so the etch can be taken back to the silicon without reaching the lead frame. The part stays soldered during the work and keeps executing, which is what allows the fault to be aimed at a live boot rather than at a static image. After the capture the open package is returned in a sealed carrier, because a G4 die left exposed will collect moisture faster than most customers expect.
| Region | Recoverable | In source tree | Status |
|---|---|---|---|
| App flash 256 KB | yes | yes | rebuilt |
| OTP 1 KB | yes | constants | included |
| PCROP blocks | no | linked | third-party |
| Option bytes | yes | config | recorded |
Rebuilding compilable source
The disassembled image is lifted into a source tree that compiles against the recovered constants, with the HRTIM and analog setup restored from the captured tables. The PCROP regions are left as sealed links so the build matches the original behaviour without claiming ownership of code that was never yours to read. The approach mirrors the STM32G473VCT6 binary work already in our list.
Getting the tree to compile is the part that separates a reconstruction from a dump. The vector table is rebuilt first so the reset and interrupt entry points are correct, then each function is separated using the call graph, the literal pools and the Cortex-M4 push and pop patterns, because a locked image carries no symbol table. Peripheral registers sit at fixed addresses, so a routine that touches the high-resolution timer is identified by its register footprint rather than by any name in the binary. Timing constants precomputed for the digital-power loop are recovered as literals and expressed as named constants, which is what makes the difference between code that runs and code that merely resembles the original.
What the client receives
The client receives the STM32G474VCT6 binary image, the option bytes and OTP, a disassembly-based source reconstruction that compiles around the PCROP blocks, and a verification report. The decapped part is returned in a sealed carrier so the open die is protected in transit.