Okay, STM32. RDP1 protected, means I have access to the BootROM in a limited fashion and I could potentially glitch the flash content out of it as usual by triggering a flash memory read in the boot ROM via UART, CAN or whatever other interface I want to use and glitch the RDP check.
The problem is, you only get 256 bytes per glitch back from the ROM, so you need to land a lot of glitches to extract the whole flash.
The STM32s have the nasty tendency to flip even more protection bits or trigger a full chip erase when you don't land a glitch perfectly which turns hitting a lot of glitches until you extracted the flash into a pretty exciting process.
I just dumped a ROM from an F7 and threw it into IDA. While reverse engineering, I got another idea: There is a write memory command. This not only allows writing to flash, but also to SRAM in case the chip is unlocked.
There is also a Go command which sets SP and jumps to code you point it at. Also only if you are unprotected.
Why did nobody glitch these two commands yet? First try to get some payload into SRAM using the memory write cmd, then once this succeeded, glitch the Go command until your payload is executed. Your payload then just dumps the flash to UART. I can squeeze that into 256 bytes, so there are only TWO glitches I need to land.
Am I missing something why this wouldn't work? Code running from SRAM can access flash even when RDP1 is set, right? RDP1 just causes the flash to be locked after a JTAG probe attach. So that should work.
I also have multiple tries when doing this. I would glitch it continuously without resetting it (as long as it survives the glitches) when hitting the read command, so that is not a problem eiter: Just get the payload into the chip, then hammer the Go command with glitches until it jumps.
Why did nobody document this approach yet?
/cc @stacksmashing any thoughts?