diff --git a/rxmode/twl_firm/Makefile b/rxmode/twl_firm/Makefile index b68186de..b807f43f 100644 --- a/rxmode/twl_firm/Makefile +++ b/rxmode/twl_firm/Makefile @@ -39,7 +39,7 @@ $(BUILD): %_unstrip.elf: %_linked.elf $(call Q,LINK,$@)$(LD) -i -Tscript.ld $< -o $@ -$(BUILD)/$(TARGET)_linked.elf: $(BUILD)/p9_signatures_spoof.o +$(BUILD)/$(TARGET)_linked.elf: $(BUILD)/p9_signatures_spoof.o $(BUILD)/p9_sha_compare_stub.o $(BUILD)/p9_whitelist_check_disable.o $(BUILD)/p9_cartridge_save_type_check_disable.o $(BUILD)/p9_dsi_cartridge_save_exploit_check_disable.o $(BUILD)/p9_ninlogo_check_disable.o $(BUILD)/p9_blacklist_check_disable.o $(call Q,LINK,$@)$(LD) -Tscript.ld $^ -o $@ $(BUILD)/%.o: $(SOURCE)/%.s $(BUILD) diff --git a/rxmode/twl_firm/script.ld b/rxmode/twl_firm/script.ld index 8b6a5ef8..6ad8617b 100644 --- a/rxmode/twl_firm/script.ld +++ b/rxmode/twl_firm/script.ld @@ -1,5 +1,25 @@ +twl_p9 = 0x8014A00; + SECTIONS { - . = 0x080182C0; + . = twl_p9 + 0x38C0; .patch.p9.sig : { *(.patch.p9.sig) } + + . = twl_p9 + 0x13656; + .patch.p9.sha_compare_stub : { *(.patch.p9.sha_compare_stub) } + + . = twl_p9 + 0x13164; + .patch.p9.whitelist_check_disable : { *(.patch.p9.whitelist_check_disable) } + + . = twl_p9 + 0x1355E; + .patch.p9.cartridge_save_type_check_disable : { *(.patch.p9.cartridge_save_type_check_disable) } + + . = twl_p9 + 0x1356A; + .patch.p9.dsi_cartridge_save_exploit_check_disable : { *(.patch.p9.dsi_cartridge_save_exploit_check_disable) } + + . = twl_p9 + 0x13002; + .patch.p9.ninlogo_check_disable : { *(.patch.p9.ninlogo_check_disable) } + + . = twl_p9 + 0x13552; + .patch.p9.blacklist_check_disable : { *(.patch.p9.blacklist_check_disable) } } diff --git a/rxmode/twl_firm/source/p9_blacklist_check_disable.s b/rxmode/twl_firm/source/p9_blacklist_check_disable.s new file mode 100644 index 00000000..abbb9021 --- /dev/null +++ b/rxmode/twl_firm/source/p9_blacklist_check_disable.s @@ -0,0 +1,8 @@ +@ Blacklist check patch found by TuxSH (see https://gist.github.com/Steveice10/8a6965c59192ac970832). +@ Disables the cartridge blacklist check (mostly, if not entirely, demo carts). This check was introduced in firmware 4.4.0-10. + +.section .patch.p9.blacklist_check_disable, "a" +.thumb + mov r0, #1 + nop +.pool diff --git a/rxmode/twl_firm/source/p9_cartridge_save_type_check_disable.s b/rxmode/twl_firm/source/p9_cartridge_save_type_check_disable.s new file mode 100644 index 00000000..b8fa4c23 --- /dev/null +++ b/rxmode/twl_firm/source/p9_cartridge_save_type_check_disable.s @@ -0,0 +1,8 @@ +@ Cartridge save type check patch found by TuxSH (see https://gist.github.com/Steveice10/8a6965c59192ac970832). +@ This check was introduced firmware 4.4.0-10, and blocked most DSi-compatible flashcarts as a result. + +.section .patch.p9.cartridge_save_type_check_disable, "a" +.thumb + mov r0, #1 + nop +.pool diff --git a/rxmode/twl_firm/source/p9_dsi_cartridge_save_exploit_check_disable.s b/rxmode/twl_firm/source/p9_dsi_cartridge_save_exploit_check_disable.s new file mode 100644 index 00000000..83940625 --- /dev/null +++ b/rxmode/twl_firm/source/p9_dsi_cartridge_save_exploit_check_disable.s @@ -0,0 +1,8 @@ +@ DSi cartridge save file exploit check patch found by Steveice10 (see https://gist.github.com/Steveice10/8a6965c59192ac970832). +@ This check was blocking, for instance, the "Classic Word Games" and "Cooking Coach" DSi-mode exploits. + +.section .patch.p9.dsi_cartridge_save_exploit_check_disable, "a" +.thumb + mov r0, #1 + nop +.pool diff --git a/rxmode/twl_firm/source/p9_ninlogo_check_disable.s b/rxmode/twl_firm/source/p9_ninlogo_check_disable.s new file mode 100644 index 00000000..70b914a8 --- /dev/null +++ b/rxmode/twl_firm/source/p9_ninlogo_check_disable.s @@ -0,0 +1,8 @@ +@ Nintendo logo check patch found by Steveice10 (see https://gist.github.com/Steveice10/8a6965c59192ac970832) +@ It isn't generally needed + +.section .patch.p9.ninlogo_check_disable, "a" +.thumb + mov r0, #0 + nop +.pool diff --git a/rxmode/twl_firm/source/p9_sha_compare_stub.s b/rxmode/twl_firm/source/p9_sha_compare_stub.s new file mode 100644 index 00000000..68ab62aa --- /dev/null +++ b/rxmode/twl_firm/source/p9_sha_compare_stub.s @@ -0,0 +1,8 @@ +@ Signature/hash patch found by Steveice10, see https://gist.github.com/Steveice10/8a6965c59192ac970832 +@ This stubs the function commonly used to compare SHA hashes to always succeed. It's at least used to check SRL (DSi titles) signatures and SHA hashes in general. + +.section .patch.p9.sha_compare_stub, "a" +.thumb + mov r0, #1 + bx lr +.pool diff --git a/rxmode/twl_firm/source/p9_whitelist_check_disable.s b/rxmode/twl_firm/source/p9_whitelist_check_disable.s new file mode 100644 index 00000000..aa1bf672 --- /dev/null +++ b/rxmode/twl_firm/source/p9_whitelist_check_disable.s @@ -0,0 +1,7 @@ +@ Whitelist check patch found by Steveice10, see https://gist.github.com/Steveice10/8a6965c59192ac970832 + +.section .patch.p9.whitelist_check_disable, "a" +.thumb + mov r0, #0 + nop +.pool