Tutorial Hacking Homebrew How to create your own sigpatches.

impeeza

¡Kabito!
OP
Member
Joined
Apr 5, 2011
Messages
1,828
Trophies
1
Age
44
XP
3,097
Country
Colombia
****************************************************************************************
@mrdude is working on new set of programs running in Windows and will not need Python at all, keep an eye on his thread, the first test is one to generate Atmosphère loader patches, KUDOS MrDude!!!!!
The program is available on post #237 of the IPS's Patches thread: https://gbatemp.net/threads/info-on-sha-256-hashes-on-fs-patches.581550/post-9898161
****************************************************************************************

Hello there, with all the fuss created by the DCMA plea of the N to iTotalJustice, I think this little compendium will help somebody.

For now the sigpatches for all firmware up to 14.1.2 and Atmosphère 1.03.2 still can be downloaded from Sigpatches for Atmosphere (Hekate, fss0, fusee & package3) thread here on GBATemp :D

This steps help you to build a new version of sigpatches if new firmware or Atmosphère is released or if you compile Atmosphère from source and make changes like add a new bootlogo @binkinator explain us how to do that on https://gbatemp.net/threads/custom-boot-logo-for-switch.569031/post-9839714

First at all thank you very much to @mrdude for his hard work, really to him belong all the credit.

On the thread Info on SHA-256 hashes on FS patches mrdude explain how the patches are created and share with all of us his work and his scripts to create new sigpatches.

For that scripts works you need Python, first step get python:

Download and install Python, for Windows you can use https://www.python.org/downloads/, but be sure of select the option «Add Python 3.XX to PATH».
1659196452425.png

After you have a Python environment working, open a command line (CMD.EXE) and execute the next commands, in order to get the prerequisites of the scripts:

Code:
python.exe -m pip install --upgrade pip
pip install bitstring

Download the latest version of the scripts on the thread (https://gbatemp.net/threads/info-on-sha-256-hashes-on-fs-patches.581550/post-9783677) for now they are on the post # 205.

Uncompress the file «AutoIPS-Patcher.zip» on a local folder, for example, «C:\AUTOIPS», must look like:
1659196724938.png


Then copy your prod.keys file to the folder «c:\AutoIPS\scripts\» and rename it «keys.dat» IMPORTANT IF YOU USE EXPLORER BE SURE THE EXTENSIONS AREN'T HIDDEN, SO YOU DON'T END WITH keys.dat.keys file instead o keys.dat

Tip from @User154 ,
you can get your prod.keys files using the guide: https://nh-server.github.io/switch-guide/user_guide/emummc/making_emummc/

Get the files for the firmware you want to create, darthsternie it's you pal, or you can use NXDumpTool, TegraExplorer or GoldLeaf to dump the current firmware to the SD Card on your console. Extract all files to a local path, by example, «C:\FW1412», your folder must look like:
1659197200014.png

Download the latest Atmosphère files from https://github.com/Atmosphere-NX/Atmosphere/releases , and extract «atmosphere\package3» to a local path, by example: «C:\ATM132».

On a command line go to the folder where you extract AutoIPS and execute the command «Python MENU.PY»:

Bash:
C:\AutoIPS>python menu.py
=========================================================================
Make sure you have keys.dat in the scripts folder. Menu/Scripts by MrDude
=========================================================================
1.Make Atmosphere-NX Loader Patch
2.Make ES Patch and FS Patches
3.Make ES Patch
4.Make Alt Beta ES Patch
5.Make ES NFIM Patch
6.Make FS Patches
7.Toggle Debug info
8.NCA info
9.Exit/Quit

What would you like to do?

I recommend to select the option «7» in order to enable information on screen.

Then you can select the option «1» to generate sigpatches for Atmosphère, when asked for the «fusee-secondary.bin or package3» files, write down the path where Atmosphère was extracted, on this example: «c:\ATM132\package3».

You can use the option «2» to generate sigpatches for the firmware, when asked for the firmware path, use the one where you extract firmware files, on this example: «C:\FW1412».

Tip from @masagrator, also you can drag from a File Explorer window the folder of firmware and the package3 file to the command line window, then the full path is written for you on the command line, avoiding typos.
record_1.png

For Windows 10 and Windows 11 this ONLY works if you start the CMD as normal user, if your CMD.EXE was started as Administrator, do not work because explorer ALWAYS run as standard user and a standard user window can not send data to a Administrator one.

Tip from @subcon959 : if you put package3 in the scripts folder and then put the firmware files in a folder called firmware and put that in the scripts folder too, then you can just press enter when the menu asks for them instead of dragging or typing anything.
W09lAnk.jpg
TESTED AND WORKS LIKE A CHARM!


The next examples shows the result of the executions:
1659197808475.png



1659197914104.png


If everything goes well you end with the folder «c:\AutoIPS\scripts\output» inside that folder should be a folder named «Atmosphere» that folder should be copied to the root of your SD card; and a file called «patches.ini» which goes to the «SD:/BOOTLOADER» path of your SD Card.

Its possible to see a bunch of Warnings «[WARN]» about to match key, some like:
1659317316418.png

are WARNINGS and you need no to worry about that, it's just you have more keys on the Keys.dat file than needed so ignore them.

If you get errors, verify the location of the «KEYS.DAT» file and the path you give for the Atmosphère files and firmware folder. DO NOT ADD EMPTY SPACES AT END OF THE PATHS.

-Edit 1:-
Correcting a typo and adding suggestions from other users; the great of this community!
And trying to be sure the credit goes to @mrdude him is the one what make the hard work and investigation.

-Edit 2-
add a video of dragging names and UAC restriction. and the good news from MrDude.
 
Last edited by impeeza,

masagrator

The patches guy
Member
Joined
Oct 14, 2018
Messages
5,143
Trophies
2
XP
9,157
Country
Poland
Protip: instead of writing down you can drag&drop folder/file on cmd window, this way you are getting automatically full path with quotes if any folder has spaces, fixing potential issues with wrong path detection.

Issue is this method has some issues on first official release of W11 (if explorer is not focused on before dragging file/folder, cmd will refuse to accept it). It was completely fixed in Insider release, so with next big update it should be not a problem anymore.
 

binkinator

Garfield’s Fitness Coach
Member
GBAtemp Patron
Joined
Mar 29, 2021
Messages
2,992
Trophies
2
XP
2,173
Country
United States
Hello there, with all the fuss created by the DCMA plea of the N to iTotalJustice, I think this little compendium will help somebody.

First at all thank you very much to @mrdude for his hard work.

On the thread Info on SHA-256 hashes on FS patches mrdude explain how the patches are created and share with all of us his work and his scripts to create new sigpatches.

For that scripts works you need Python, first step get python:

Download and install Python, for Windows you can use https://www.python.org/downloads/, but be sure of select the option «Add Python 3.XX to PATH».
View attachment 320395

After you have a Python environment working, open a command line (CMD.EXE) and execute the next commands, in order to get the prerequisites of the scripts:

Code:
python.exe -m pip install --upgrade pip
pip install bitstring

Download the latest version of the scripts on the thread (https://gbatemp.net/threads/info-on-sha-256-hashes-on-fs-patches.581550/post-9783677) for now they are on the post # 205.

Uncompress the file «AutoIPS-Patcher.zip» on a local folder, for example, «C:\AUTOIPS», must look like:
View attachment 320396

Then copy your prod.keys file to the folder «c:\AutoIPS\scripts\» and rename it «keys.dat» IMPORTANT IF YOU USE EXPLORER BE SURE THE EXTENSIONS AREN'T HIDDEN, SO YOU DON'T END WITH keys.dat.keys file instead o keys.dat

Get the files for the firmware you want to create, darthsternie it's you pal, or you can use NXDumpTool or GoldLeaf to dump the current firmware to the SD Card on your console. Extract all files to a local path, by example, «C:\FW1412», your folder must look like:
View attachment 320397
Download the latest Atmosphère files from https://github.com/Atmosphere-NX/Atmosphere/releases , and extract «atmosphere\package3» to a local path, by example: «C:\ATM132».

On a command line go to the folder where you extract AutoIPS and execute the command «Python MENU.PY»:

Bash:
C:\AutoIPS>python menu.py
=========================================================================
Make sure you have keys.dat in the scripts folder. Menu/Scripts by MrDude
=========================================================================
1.Make Atmosphere-NX Loader Patch
2.Make ES Patch and FS Patches
3.Make ES Patch
4.Make Alt Beta ES Patch
5.Make ES NFIM Patch
6.Make FS Patches
7.Toggle Debug info
8.NCA info
9.Exit/Quit

What would you like to do?

I recommend to select the option «7» in order to enable information on screen.

Then you can select the option «1» to generate sigpatches for Atmosphère, when asked for the «fusee-secondary.bin or package3» files, write down the path where Atmosphère was extracted, on this example: «c:\ATM132\package3».

You can use the option «2» to generate sigpatches for the firmware, when asked for the firmware path, use the one where you extract firmware files, on this example: «C:\FW1412».

The next examples shows the result of the executions:
View attachment 320400


View attachment 320402

If everything goes well you end with the folder «c:\AutoIPS\scripts\output» inside that folder should be a folder named «Atmosphere» that folder should be copied to the root of your SD card; and a file called «patches.ini» which goes to the «SD:/BOOTLOADER» path of your SD Card.

If you get errors, verify the location of the «KEYS.DAT» file and the path you give for the Atmosphère files and firmware folder. DO NOT ADD EMPTY SPACES AT END OF THE PATHS.
This is friggin AWEsome man! Thanks for putting it together step-by-step!

🥳
 
  • Love
  • Like
Reactions: peteruk and impeeza

HalfScoper

Well-Known Member
Member
Joined
Apr 16, 2021
Messages
264
Trophies
0
Age
82
XP
682
Country
Germany
This is python, so this should also work with Linux and macOS, right?

I got no proper experience with any of those two but I assume no, since the scripts call for hactool.exe.
You could use Bootcamp for macOS to emulate Windows, or somehow use idk a Linux library of some sort that enables you to run/emulate .exe files.
 
  • Like
Reactions: impeeza

masagrator

The patches guy
Member
Joined
Oct 14, 2018
Messages
5,143
Trophies
2
XP
9,157
Country
Poland
I got no proper experience with any of those two but I assume no, since the scripts call for hactool.exe.
You could use Bootcamp for macOS to emulate Windows, or somehow use idk a Linux library of some sort that enables you to run/emulate .exe files.
Hactool is compiled for all 3 systems natively.
You need only to adjust python script to detect system and provide correct calls.
 

HalfScoper

Well-Known Member
Member
Joined
Apr 16, 2021
Messages
264
Trophies
0
Age
82
XP
682
Country
Germany
Are those patch for atmo only or they will work with atmo + hakate ?
*hekate
Don't get me wrong, but I sense difficulties if you miss the part where it says it will generate a patches.ini (which is required for hekate)
If everything goes well you end with the folder «c:\AutoIPS\scripts\output» inside that folder should be a folder named «Atmosphere» that folder should be copied to the root of your SD card; and a file called «patches.ini» which goes to the «SD:/BOOTLOADER» path of your SD Card.
 

SleepyDomino

Well-Known Member
Member
Joined
Sep 21, 2009
Messages
290
Trophies
0
Age
39
XP
1,821
Country
United States
If I'm reading stuff correctly, apparently I need to get prod.keys from the Switch while it's on the latest firmware? Because either my computer hates me or my severely outdated file is what's causing errors.

If the latter, hoo boy, this will be a problem since I've opted not to use emunand.
 

binkinator

Garfield’s Fitness Coach
Member
GBAtemp Patron
Joined
Mar 29, 2021
Messages
2,992
Trophies
2
XP
2,173
Country
United States
If I'm reading stuff correctly, apparently I need to get prod.keys from the Switch while it's on the latest firmware? Because either my computer hates me or my severely outdated file is what's causing errors.

If the latter, hoo boy, this will be a problem since I've opted not to use emunand.

You may be able to find elsewhere. I’ve never looked for nintendo switch prod.keys myself though.

Use Lockpick_RCM
 
Last edited by binkinator,
  • Like
Reactions: impeeza
General chit-chat
Help Users
    Veho @ Veho: Everyone should eat a cookie.