mirror of
https://github.com/LNH-team/pico-loader.git
synced 2026-06-02 01:06:50 +02:00
Update documentation for Last Window AP patch (#179)
This commit is contained in:
@@ -11,14 +11,15 @@
|
|||||||
/// So the CRC is sensitive not only to code modifications, but also to which encrypted functions
|
/// So the CRC is sensitive not only to code modifications, but also to which encrypted functions
|
||||||
/// were run, and how many times they were run.
|
/// were run, and how many times they were run.
|
||||||
///
|
///
|
||||||
/// The current DS Protect patch modifies NotA1, causes one of its subfunction to run twice, and
|
/// The current DS Protect patch modifies NotA1, causes one of its subfunctions to run twice, and
|
||||||
/// the other subfunction to not be run, which obviously breaks the CRC.
|
/// the other subfunction to not be run, which obviously breaks the CRC.
|
||||||
///
|
///
|
||||||
/// Another region is also CRCed, from 0202DB34 to 02030334. What resides here is unknown, it does not
|
/// Another region is also CRCed, from 0202DB34 to 02030334. What resides here is the game functions
|
||||||
/// contain any commonly modified functions such as AP or card reading.
|
/// that are supplied to DS Protect as callbacks. These are left unmodified, but to be sure, the CRC
|
||||||
|
/// for them is patched anyway.
|
||||||
///
|
///
|
||||||
/// To make things more annoying, the memory location of the correct CRC is randomized, and the code
|
/// To make things more annoying, the memory locations of the correct CRCs are randomized, and the code
|
||||||
/// that checks the CRC resides in a compressed overlay which is loaded into ITCM. This same function
|
/// that checks the CRCs resides in a compressed overlay which is loaded into ITCM. This same function
|
||||||
/// also receives several dummy checks that are expected to fail, and so cannot be patched to always
|
/// also receives several dummy checks that are expected to fail, and so cannot be patched to always
|
||||||
/// report the CRC matches.
|
/// report the CRC matches.
|
||||||
///
|
///
|
||||||
|
|||||||
@@ -11,9 +11,9 @@ patch_lastwindowcrc_entry:
|
|||||||
cmp r1, r3
|
cmp r1, r3
|
||||||
beq crc_dsprotect
|
beq crc_dsprotect
|
||||||
|
|
||||||
ldr r3, =0x0202DB34 // CRC of other code region (unknown)
|
ldr r3, =0x0202DB34 // CRC of DS Protect callbacks
|
||||||
cmp r1, r3
|
cmp r1, r3
|
||||||
beq crc_unk
|
beq crc_callback
|
||||||
|
|
||||||
swi #0xE // Normal CRC if address does not match (never hit?)
|
swi #0xE // Normal CRC if address does not match (never hit?)
|
||||||
bx lr
|
bx lr
|
||||||
@@ -22,7 +22,7 @@ crc_dsprotect:
|
|||||||
ldr r0, =0x67D7
|
ldr r0, =0x67D7
|
||||||
bx lr
|
bx lr
|
||||||
|
|
||||||
crc_unk:
|
crc_callback:
|
||||||
ldr r0, =0x0D1E
|
ldr r0, =0x0D1E
|
||||||
bx lr
|
bx lr
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user