# $ver 01
# $uuid 34
-# TODO - Make dynamic. Not that hard, but some
-# fixes need more context bytes than on Steveice10's
-# pastebin
-
-# Relative to twl_firm (0)
+# TODO - Use proper section
rel twl
###########################################
-# New3ds
# Disable main signature checks (1)
-seek 00165D64
-test C117491C31D0
-jmpne 20
-set 00204EB070BD
+find C117491C31D0
+set 00204EB070BD
+rewind
-# Patch RSA function to not report invalid signatures (5)
-seek 0017474A
+# Patch RSA function to not report invalid signatures (4)
+# TODO - Check O3DS
+find 18ee0020
+fwd 02
set 0120
+rewind
-# Disable header Nintendo logo check (not generally needed) (7)
-seek 0017553E
+# Disable header Nintendo logo check (not generally needed) (8)
+# TODO - Check O3DS
+find c03006f0
+fwd 02
set 00200000
+rewind
-# Disable whitelist check (9)
-seek 001756A0
+# Disable whitelist check (12)
+find FFF7B6FB
set 00200000
+rewind
-# Disable cartridge blacklist check (mostly, if not entirely, demo carts) (11)
-seek 00175A8E
+# Disable cartridge blacklist check (mostly, if not entirely, demo carts) (15)
+# TODO - Check O3DS
+find 012520000ef0
+fwd 04
set 01200000
+rewind
-# Disable save type check (13)
-seek 00175A9A
-set 01200000
-
-# Disable DSi cartridge save exploit check (15)
-seek 00175AA6
-set 01200000
-
-# Stub function commonly used to compare SHA hashes to always succeed (17)
-seek 00175B92
+# Stub function commonly used to compare SHA hashes to always succeed (19)
+find 10B51422
set 01207047
+rewind
-jmp 36
-
-###########################################
-# Old3ds
-
-# Disable main signature checks (20)
-seek 001650C0
-set 00204EB070BD
+##################################### (22)
-# Patch RSA function to not report invalid signatures (22)
-seek 00173A0E
-set 0120
+# There's not enough context for the patterns below to patch both o3ds and n3ds, so
+# we have to split them up.
-# Disable header Nintendo logo check (not generally needed) (24)
-seek 00174802
-set 00200000
+n3ds
+jmpeq 25
+jmp 32
-# Disable whitelist check (26)
-seek 00174964
-set 00200000
+# new: (25)
-# Disable cartridge blacklist check (mostly, if not entirely, demo carts) (28)
-seek 00174D52
+# Disable save type check
+find FCF745FE
set 01200000
+rewind
-# Disable save type check (30)
-seek 00174D5E
+# Disable DSi cartridge save exploit check (28)
+find FCF765FD
set 01200000
+rewind
-# Disable DSi cartridge save exploit check (32)
-seek 00174D6A
-set 01200000
+jmp 38
-# Stub function commonly used to compare SHA hashes to always succeed (34)
-seek 00174E56
-set 01207047
+# old: (32)
+
+# Disable save type check
+find FCF771FE
+set 01200000
+rewind
-# end (36)
+# Disable DSi cartridge save exploit check (35)
+find FCF791FD
+set 01200000
+rewind
+# end (38)