Line 73:
Line 73:
--[[User:InvoxiPlayGames|InvoxiPlayGames]] ([[User talk:InvoxiPlayGames|talk]]) 13:56, 29 July 2022 (CEST)
--[[User:InvoxiPlayGames|InvoxiPlayGames]] ([[User talk:InvoxiPlayGames|talk]]) 13:56, 29 July 2022 (CEST)
+
+
Vouch, I discovered this myself yesterday while reversing boot0. The code that does this is a little weird. The main loop condition intentionally over-counts by 2, this is done because after page n is read from flash, page n-1 is decrypted, then page n-2 is hashed. There are checks to make sure the extra 2 pages are not read from flash and to make sure there are no out of bounds reads/writes or negative integer overflow. Interestingly, the debug port output is not protected by this check, so the debug port outputs from 0x0 - 0x30.
+
+
I've also emulator verified this.
+
+
[[User:AndrewPiroli|AndrewPiroli]] ([[User talk:AndrewPiroli|talk]]) 15:16, 29 July 2022 (CEST)