Hacking Discussion Info on SHA-256 hashes on FS patches

mrdude

Developer
Developer
Joined
Dec 11, 2015
Messages
3,071
Trophies
1
Age
56
XP
8,227
FYI, I added an alt way of patching ES files - this is basically the same as the original python ES scripts where it patches in 3 places, this is different to the other way - so if that one fails to generated the correct patches, try this instead!

For the eagle eye'd - this only supports firmware 10.0.2 and above (same as the python scripts), I added a check to this routine and will no doubt do the same to the other routines when I get around to it.

Also for the super eagle eyed - info on 10.0.2 patches:
Code:
50 41 54 43 48 02 DC 30 00 04 09 00 00 14 02 E9 F8 00 04 1F 20 03 D5 02 DC 64 00 04 09 00 00 14 45 4F 46 *** pc app (new patch)
50 41 54 43 48 02 DC 30 00 04 09 00 00 14 02 E9 F8 00 04 1F 20 03 D5 02 DC 64 00 04 1F 20 03 D5 45 4F 46 *** python script (10.2.0)

The old python patch, nopped patch 3 address, new patch branches instead

Notice patch 3 is a branch instead of a NOP, this is fine and is how new patches are made, so don't worry about the difference when you compare to other patches.

8O2EAQK.png
 
Last edited by mrdude,

impeeza

¡Kabito!
Member
Joined
Apr 5, 2011
Messages
6,343
Trophies
3
Age
46
Location
At my chair.
XP
18,654
Country
Colombia
FYI, I added an alt way of patching ES files - this is basically the same as the original python ES scripts where it patches in 3 places, this is different to the other way - so if that one fails to generated the correct patches, try this instead!

For the eagle eye'd - this only supports firmware 10.0.2 and above (same as the python scripts), I added a check to this routine and will no doubt do the same to the other routines when I get around to it.

Also for the super eagle eyed - info on 10.0.2 patches:
Code:
50 41 54 43 48 02 DC 30 00 04 09 00 00 14 02 E9 F8 00 04 1F 20 03 D5 02 DC 64 00 04 09 00 00 14 45 4F 46 *** pc app (new patch)
50 41 54 43 48 02 DC 30 00 04 09 00 00 14 02 E9 F8 00 04 1F 20 03 D5 02 DC 64 00 04 1F 20 03 D5 45 4F 46 *** python script (10.2.0)

The old python patch, nopped patch 3 address, new patch branches instead

Notice patch 3 is a branch instead of a NOP, this is fine and is how new patches are made, so don't worry about the difference when you compare to other patches.

8O2EAQK.png
Excellent, Work great, Tested on firmwares
  • FW10.1.0
  • FW10.2.0
  • FW11.0.0
  • FW11.0.1
  • FW11.0.1-11.0.1.1000
  • FW12.0.0
  • FW12.0.1
  • FW12.0.2
  • FW12.0.3
  • FW12.1.0
  • FW13.0.0
  • FW13.1.0
  • FW13.2.0
  • FW13.2.1
  • FW14.0.0
  • FW14.1.0
  • FW14.1.1
  • FW14.1.2
  • FW14.1.2-Rebootless
and the only difference are the patches for Firmware 10.1.0 and 10.2.0 what are the same:
1660449061577.png


here at left the Python script generated and right the Windows App ones.
patches fro firmware 11 and up (inclusive) are the same.
 

mrdude

Developer
Developer
Joined
Dec 11, 2015
Messages
3,071
Trophies
1
Age
56
XP
8,227
FYI, here you go fellas. Added a key page where you can edit your keys easily + if keys.dat is not found, it will ask you if it wan'ts to generate a keys.dat template for you to fill in. Also added some copy, and copy+paste context menu's so you can copy the output from the text box's. Some minor changes to FS/ES patch location routines was added + some minor bug fixes and GUI changes were also done. let me know if you have any issues.
 

dogcsty

Well-Known Member
Newcomer
Joined
Dec 2, 2021
Messages
47
Trophies
0
XP
227
Country
United States
I've been working today on the homebrew app and I've been able to port the es alt autoIPS algorithm from python, didn't face any issue.
You can test it with the attached file, you need to put the keys.dat file in the sigpatch-generator folder and just copy the whole folder in the switch folder. It will generate an atmosphere output folder in the same directory with the ips file (it will not overwrite your current ips files, I want to make sure everything is okay before doing that). I've only tested the algorithm with the current firmware (I didn't have the time to install every supported firmware on my switch) but I suppose it works with the current supported firmware versions with the python algorithm (but it needs to be tested)

I haven't finished treating every exception but the algorithm itself seems to work.
If you find any bug or you have suggestions feel free to tell me.
I'll keep working on the other ips patches in the meantime.
 
Last edited by dogcsty,

mrdude

Developer
Developer
Joined
Dec 11, 2015
Messages
3,071
Trophies
1
Age
56
XP
8,227
I've been working today on the homebrew app and I've been able to port the es alt autoIPS algorithm from python, didn't face any issue.
You can test it with the attached file, you need to put the keys.dat file in the sigpatch-generator folder and just copy the whole folder in the switch folder. It will generate an atmosphere output folder in the same directory with the ips file (it will not overwrite your current ips files, I want to make sure everything is okay before doing that). I've only tested the algorithm with the current firmware (I didn't have the time to install every supported firmware on my switch) but I suppose it works with the current supported firmware versions with the python algorithm (but it needs to be tested)

I haven't finished treating every exception but the algorithm itself seems to work.
If you find any bug or you have suggestions feel free to tell me.
I'll keep working on the other ips patches in the meantime.
I'll upload my current c# code to github later today and post a link so you can see how I changed some of the way the patches are done now. The scripts are OK but the pc app improves them and fxes some bugs. Also thanks for your homebrew, hopefully once that is done it will make the python scripts obsolete.

Here you go:
https://github.com/mrdude2478/Sigpatch-IPS-Creator
 
Last edited by mrdude,

dogcsty

Well-Known Member
Newcomer
Joined
Dec 2, 2021
Messages
47
Trophies
0
XP
227
Country
United States
I'll upload my current c# code to github later today and post a link so you can see how I changed some of the way the patches are done now. The scripts are OK but the pc app improves them and fxes some bugs. Also thanks for your homebrew, hopefully once that is done it will make the python scripts obsolete.

Here you go:
https://github.com/mrdude2478/Sigpatch-IPS-Creator
Thank you I'll update the algorithm

Edit:
I think you made a mistake with your sdkversion check I believe that '&'s are missing
Code:
                if (SDKVersion >= 7300 & SDKVersion < 9300 || SDKVersion == 82990)
                {
                    pattern = new byte[] { 0x00, 0x94, 0x60, 0x7E, 0x40, 0x92, 0xFD, 0x7B,
                                           0x46, 0xA9, 0xF4, 0x4F, 0x45, 0xA9, 0xFF, 0xC3,
                                           0x01, 0x91, 0xC0, 0x03, 0x5F, 0xD6, 0x00, 0x00,
                                           0x00, 0x00 };
                    toggle = 0;
                }

                else if (SDKVersion > 9300 & SDKVersion < 10400)
                {
                    pattern = new byte[] { 0xFF, 0x97, 0xE0, 0x03, 0x13, 0xAA, 0xFD, 0x7B,
                                           0x48, 0xA9, 0xF4, 0x4F, 0x47, 0xA9, 0xFF, 0x43,
                                           0x02, 0x91, 0xC0, 0x03, 0x5F, 0xD6, 0x00, 0x00,
                                           0x00, 0x00 };

                    toggle = 0;
                }

                else if (SDKVersion == 10400)
                {
                    if (BuildID == "03E4EB5556B98B327D1353E8AA2C7ADF2C544470") //id for firmware 10.0.4
                    {
                        pattern = new byte[] { 0xFF, 0x97, 0xE0, 0x03, 0x13, 0xAA, 0xFD, 0x7B,
                                               0x48, 0xA9, 0xF4, 0x4F, 0x47, 0xA9, 0xFF, 0x43,
                                               0x02, 0x91, 0xC0, 0x03, 0x5F, 0xD6, 0x00, 0x00,
                                               0x00, 0x00 };

                        toggle = 0;
                    }

                    else
                    {
                        //wildcard patterns start here - always convert to lower case or regex won't work.
                        find = ("FF97.......A9........FFC3").ToLower();
                        toggle = 1;
                    }
                }

                else if (SDKVersion > 10400 & SDKVersion < 14300) //#start from fw 10.2.0 to 13.1.0
                {
                    find = ("FF97.......A9........FFC3").ToLower();
                    toggle = 1;
                }

Edit here is the updated version:
 
Last edited by dogcsty,

mrdude

Developer
Developer
Joined
Dec 11, 2015
Messages
3,071
Trophies
1
Age
56
XP
8,227
Thank you I'll update the algorithm

Edit:
I think you made a mistake with your sdkversion check I believe that '&'s are missing
Code:
                if (SDKVersion >= 7300 & SDKVersion < 9300 || SDKVersion == 82990)
                {
                    pattern = new byte[] { 0x00, 0x94, 0x60, 0x7E, 0x40, 0x92, 0xFD, 0x7B,
                                           0x46, 0xA9, 0xF4, 0x4F, 0x45, 0xA9, 0xFF, 0xC3,
                                           0x01, 0x91, 0xC0, 0x03, 0x5F, 0xD6, 0x00, 0x00,
                                           0x00, 0x00 };
                    toggle = 0;
                }

                else if (SDKVersion > 9300 & SDKVersion < 10400)
                {
                    pattern = new byte[] { 0xFF, 0x97, 0xE0, 0x03, 0x13, 0xAA, 0xFD, 0x7B,
                                           0x48, 0xA9, 0xF4, 0x4F, 0x47, 0xA9, 0xFF, 0x43,
                                           0x02, 0x91, 0xC0, 0x03, 0x5F, 0xD6, 0x00, 0x00,
                                           0x00, 0x00 };

                    toggle = 0;
                }

                else if (SDKVersion == 10400)
                {
                    if (BuildID == "03E4EB5556B98B327D1353E8AA2C7ADF2C544470") //id for firmware 10.0.4
                    {
                        pattern = new byte[] { 0xFF, 0x97, 0xE0, 0x03, 0x13, 0xAA, 0xFD, 0x7B,
                                               0x48, 0xA9, 0xF4, 0x4F, 0x47, 0xA9, 0xFF, 0x43,
                                               0x02, 0x91, 0xC0, 0x03, 0x5F, 0xD6, 0x00, 0x00,
                                               0x00, 0x00 };

                        toggle = 0;
                    }

                    else
                    {
                        //wildcard patterns start here - always convert to lower case or regex won't work.
                        find = ("FF97.......A9........FFC3").ToLower();
                        toggle = 1;
                    }
                }

                else if (SDKVersion > 10400 & SDKVersion < 14300) //#start from fw 10.2.0 to 13.1.0
                {
                    find = ("FF97.......A9........FFC3").ToLower();
                    toggle = 1;
                }

Edit here is the updated version:
What do you mean - do you mean to put && or &, because I tried both and it works with just a single &. See here for info on && and & in C#

https://www.c-sharpcorner.com/code/...th are “AND,condition and perform some action.
 
  • Love
  • Like
Reactions: dogcsty and impeeza

dogcsty

Well-Known Member
Newcomer
Joined
Dec 2, 2021
Messages
47
Trophies
0
XP
227
Country
United States
What do you mean - do you mean to put && or &, because I tried both and it works with just a single &. See here for info on && and & in C#

https://www.c-sharpcorner.com/code/71/difference-between-and-in#:~:text=& and && both are “AND,condition and perform some action.
My mistake in my line of work we do a lot of AND mask (and sometimes directly in if's) so it is important to make the distinction but I didn't know it was a thing in C#. Now I know.

Edit: it makes sense that there's no distinction in C# since boolean is a thing
 
  • Like
Reactions: mrdude

mrdude

Developer
Developer
Joined
Dec 11, 2015
Messages
3,071
Trophies
1
Age
56
XP
8,227
FYI for those that have been testing the IPS program I am making, I removed older test versions from this thread now as most stuff is done, I've added a base64 decode/encode tab now so you can encode and decode base64 strings (Which will become evident later). Also added - text in the text box should change to red if there was an issue generating the patches (so you don't inadvertently end up putting a bad patch in the switch). I will probably start on the database stuff next if there's no issues with this version. Also I renamed the exe from Loader to Sigpatch-IPS-Creator,so make sure and delete that from your computer if you already have it.

Here you go if you want to test:
EDIT - file removed as bug found in FS extraction when not using drag drop method - I've fixed and will upload the fixed file later.
 
Last edited by mrdude,

hippy dave

BBMB
Member
Joined
Apr 30, 2012
Messages
9,866
Trophies
2
XP
29,016
Country
United Kingdom
I've been working today on the homebrew app and I've been able to port the es alt autoIPS algorithm from python, didn't face any issue.
You can test it with the attached file, you need to put the keys.dat file in the sigpatch-generator folder and just copy the whole folder in the switch folder. It will generate an atmosphere output folder in the same directory with the ips file (it will not overwrite your current ips files, I want to make sure everything is okay before doing that). I've only tested the algorithm with the current firmware (I didn't have the time to install every supported firmware on my switch) but I suppose it works with the current supported firmware versions with the python algorithm (but it needs to be tested)

I haven't finished treating every exception but the algorithm itself seems to work.
If you find any bug or you have suggestions feel free to tell me.
I'll keep working on the other ips patches in the meantime.
Haven't tested yet (don't have an actual need until next firmware releases) but this is great to see, thanks. A suggestion if you haven't thought of it - seeing as you're reading firmware from files rather than from memory anyway, it would be nice to have the option to use not-yet-installed firmware files on the SD card, eg those dumped by Tegra Explorer. That way we could generate the full set of patches for a new firmware version before updating to it, and be good to go.
 
  • Like
Reactions: alba93 and impeeza

ShadowOne333

QVID PRO QVO
Editorial Team
Joined
Jan 17, 2013
Messages
12,177
Trophies
2
XP
33,601
Country
Mexico
Excellent, Work great, Tested on firmwares
  • FW10.1.0
  • FW10.2.0
  • FW11.0.0
  • FW11.0.1
  • FW11.0.1-11.0.1.1000
  • FW12.0.0
  • FW12.0.1
  • FW12.0.2
  • FW12.0.3
  • FW12.1.0
  • FW13.0.0
  • FW13.1.0
  • FW13.2.0
  • FW13.2.1
  • FW14.0.0
  • FW14.1.0
  • FW14.1.1
  • FW14.1.2
  • FW14.1.2-Rebootless
and the only difference are the patches for Firmware 10.1.0 and 10.2.0 what are the same:
View attachment 322476

here at left the Python script generated and right the Windows App ones.
patches fro firmware 11 and up (inclusive) are the same.

Curious, what program are you using the check the differences between files?
I use HxD comparison for hex data values, but I think that gives a much better visual output which would be of great help for romhacking projects.

I've been working today on the homebrew app and I've been able to port the es alt autoIPS algorithm from python, didn't face any issue.
You can test it with the attached file, you need to put the keys.dat file in the sigpatch-generator folder and just copy the whole folder in the switch folder. It will generate an atmosphere output folder in the same directory with the ips file (it will not overwrite your current ips files, I want to make sure everything is okay before doing that). I've only tested the algorithm with the current firmware (I didn't have the time to install every supported firmware on my switch) but I suppose it works with the current supported firmware versions with the python algorithm (but it needs to be tested)

I haven't finished treating every exception but the algorithm itself seems to work.
If you find any bug or you have suggestions feel free to tell me.
I'll keep working on the other ips patches in the meantime.
I'll upload my current c# code to github later today and post a link so you can see how I changed some of the way the patches are done now. The scripts are OK but the pc app improves them and fxes some bugs. Also thanks for your homebrew, hopefully once that is done it will make the python scripts obsolete.

Here you go:
https://github.com/mrdude2478/Sigpatch-IPS-Creator

You guys are awesome, now not only can we create sigpatches by drag&drop, but also directly from inside the Switch with a homebrew app.
Boy did Nintendo fuck themselves hard with their DMCA shit lol

Thank you for all your incredible works, guys!
 

impeeza

¡Kabito!
Member
Joined
Apr 5, 2011
Messages
6,343
Trophies
3
Age
46
Location
At my chair.
XP
18,654
Country
Colombia
Curious, what program are you using the check the differences between files?
I use HxD comparison for hex data values, but I think that gives a much better visual output which would be of great help for romhacking projects.
Hi, for all file managing needs I do use Total Commander by Ghisler is a very easy two windows side by side file manager, have lots and lots of features including file comparison (binary and text) folder synchronization, compressed files as folders, and really a lot of other functions.
Is not freeware but the low cost payed himself several years ago.
 

binkinator

Garfield’s Fitness Coach
Member
GBAtemp Patron
Joined
Mar 29, 2021
Messages
6,511
Trophies
2
XP
6,155
Country
United States
Boy did Nintendo fuck themselves hard with their DMCA shit lol
Was just thinking a similar though.

They tried to stomp out a mud puddle!
Now it’s distributed all over the place and more robust than ever!
Hi, for all file managing needs I do use Total Commander by Ghisler is a very easy two windows side by side file manager, have lots and lots of features including file comparison (binary and text) folder synchronization, compressed files as folders, and really a lot of other functions.
Is not freeware but the low cost payed himself several years ago.
Would have never thought it was TC!

I use np++ w/ plugins but it‘s a bit wonky at times.
how to use 'Hex Editor' 'Compare Files'.

Open two files
2nd file right click tab and choose 'Move to other view'
click first file
ctrlA - select All
click 2nd file
ctrlA - select All
Plugins | Hex-Editor | Compare Hex
Going to try TC and see if it‘s better.
 

impeeza

¡Kabito!
Member
Joined
Apr 5, 2011
Messages
6,343
Trophies
3
Age
46
Location
At my chair.
XP
18,654
Country
Colombia
Was just thinking this. They tried to stomp out a mud puddle! Now it’s distributed all over the place and more robust than ever!

Would have never thought it was TC!

I use np++ w/ plugins but it‘s a bit wonky at times.

Going to try TC and see if it‘s better.
yep:
1660583117954.png

first a window each side with each set of sigpatches, then synchronize directories function, and inside synchronize the file compare contents one. all you need on an program.

And the Best all can be via Keyboard, compare files is by example is CTRL + F3 :P
 

alba93

Well-Known Member
Newcomer
Joined
Feb 2, 2019
Messages
77
Trophies
0
Age
45
XP
885
Country
France
I've been working today on the homebrew app and I've been able to port the es alt autoIPS algorithm from python, didn't face any issue.
You can test it with the attached file, you need to put the keys.dat file in the sigpatch-generator folder and just copy the whole folder in the switch folder. It will generate an atmosphere output folder in the same directory with the ips file (it will not overwrite your current ips files, I want to make sure everything is okay before doing that). I've only tested the algorithm with the current firmware (I didn't have the time to install every supported firmware on my switch) but I suppose it works with the current supported firmware versions with the python algorithm (but it needs to be tested)

I haven't finished treating every exception but the algorithm itself seems to work.
If you find any bug or you have suggestions feel free to tell me.
I'll keep working on the other ips patches in the meantime.
thanks a lot for this homebrew app
I tried it and the ips file is well generated into the new atmosphere folder and it matches the one I already have
I tested without any keys.dat file and atmosphere crashed.
You may have not implemented any file check yet
 

binkinator

Garfield’s Fitness Coach
Member
GBAtemp Patron
Joined
Mar 29, 2021
Messages
6,511
Trophies
2
XP
6,155
Country
United States
Thank you I'll update the algorithm

Edit:
I think you made a mistake with your sdkversion check I believe that '&'s are missing
Code:
                if (SDKVersion >= 7300 & SDKVersion < 9300 || SDKVersion == 82990)
                {
                    pattern = new byte[] { 0x00, 0x94, 0x60, 0x7E, 0x40, 0x92, 0xFD, 0x7B,
                                           0x46, 0xA9, 0xF4, 0x4F, 0x45, 0xA9, 0xFF, 0xC3,
                                           0x01, 0x91, 0xC0, 0x03, 0x5F, 0xD6, 0x00, 0x00,
                                           0x00, 0x00 };
                    toggle = 0;
                }

                else if (SDKVersion > 9300 & SDKVersion < 10400)
                {
                    pattern = new byte[] { 0xFF, 0x97, 0xE0, 0x03, 0x13, 0xAA, 0xFD, 0x7B,
                                           0x48, 0xA9, 0xF4, 0x4F, 0x47, 0xA9, 0xFF, 0x43,
                                           0x02, 0x91, 0xC0, 0x03, 0x5F, 0xD6, 0x00, 0x00,
                                           0x00, 0x00 };

                    toggle = 0;
                }

                else if (SDKVersion == 10400)
                {
                    if (BuildID == "03E4EB5556B98B327D1353E8AA2C7ADF2C544470") //id for firmware 10.0.4
                    {
                        pattern = new byte[] { 0xFF, 0x97, 0xE0, 0x03, 0x13, 0xAA, 0xFD, 0x7B,
                                               0x48, 0xA9, 0xF4, 0x4F, 0x47, 0xA9, 0xFF, 0x43,
                                               0x02, 0x91, 0xC0, 0x03, 0x5F, 0xD6, 0x00, 0x00,
                                               0x00, 0x00 };

                        toggle = 0;
                    }

                    else
                    {
                        //wildcard patterns start here - always convert to lower case or regex won't work.
                        find = ("FF97.......A9........FFC3").ToLower();
                        toggle = 1;
                    }
                }

                else if (SDKVersion > 10400 & SDKVersion < 14300) //#start from fw 10.2.0 to 13.1.0
                {
                    find = ("FF97.......A9........FFC3").ToLower();
                    toggle = 1;
                }

Edit here is the updated version:


Bruh!

This was kinda hidden by the comment…

I didn’t realize this was a beta release of an actual .nro!11!!!


1E8E85F0-D76D-4FD4-B7EB-B42E557FB82A.jpeg


Nice!
 
  • Haha
Reactions: impeeza

dogcsty

Well-Known Member
Newcomer
Joined
Dec 2, 2021
Messages
47
Trophies
0
XP
227
Country
United States
thanks a lot for this homebrew app
I tried it and the ips file is well generated into the new atmosphere folder and it matches the one I already have
I tested without any keys.dat file and atmosphere crashed.
You may have not implemented any file check yet
Thank you for the feedback I have implemented this exception now.

I've done the nifm patch and I'm almost done with the fs patch. I'll release a new version soon.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • BakerMan @ BakerMan:
    for real
  • BakerMan @ BakerMan:
    at least with them, it was because of the DDOS attacks, ubisoft was just scummy
  • BakerMan @ BakerMan:
    fuck ubisoft, and fuck activision
    +1
  • realtimesave @ realtimesave:
    Nintendo needs to release a new console, switch is getting such shitty little games lately lol it's pathetic
  • Purple_Heart @ Purple_Heart:
    Lmao a new flashcart... The Unlock Switch... I knew it's not fake xD
    +1
  • NinStar @ NinStar:
    A new consoles won't solve that problem
  • NinStar @ NinStar:
    It will actually make it worse
  • The Real Jdbye @ The Real Jdbye:
    well actually
    a new console won't do anything right now, because the games are still in development, that's why there are few games being released
  • The Real Jdbye @ The Real Jdbye:
    it won't make the games finish any faster
  • Veho @ Veho:
    2/3rds of launch titles for the Switch 2 will just be lazy ports of Switch games anyway.
  • The Real Jdbye @ The Real Jdbye:
    probably
  • The Real Jdbye @ The Real Jdbye:
    maybe mario kart 9 will be a launch title
  • The Real Jdbye @ The Real Jdbye:
    i really want a new mario kart
  • Veho @ Veho:
    What, you mean the endless stream of DLCs doesn't count?
  • Veho @ Veho:
    Why develop a new game when you can just sell season passes forever?
  • Veho @ Veho:
    I'm still on MKDS so I'm not bothered :tpi:
  • The Real Jdbye @ The Real Jdbye:
    i like the dlc tbh, i'd like a new game more
  • ZeroT21 @ ZeroT21:
    but the current version is still selling fine at full price
  • SylverReZ @ SylverReZ:
    Hello
  • ZeroT21 @ ZeroT21:
    sup
    +1
  • SylverReZ @ SylverReZ:
    @realtimesave, You seen the Unlock Switch flashcart yet?
  • K3Nv2 @ K3Nv2:
    I'll see the 19.0 update that blocks use ability to it
    +1
  • K3Nv2 @ K3Nv2:
    Lol newegg+
    Screenshot-20240423-053504-Gmail.jpg
  • S @ salazarcosplay:
    does update 19 really block it
    S @ salazarcosplay: does update 19 really block it