Problem loading key file using "-k"
INTRUCUTION
I just downloaded the latest release of the tool for Windows, and I'm having issues even when trying to read the prod keys.
OUTPUT
POWERSHELL
PS I:\LAB\proto\MK8> .\nstool.exe .\8252eafa139596b99ba4b1f4e958a52a.nca
[WARNING] Failed to load "prod.keys" keyfile.Maybe specify it with "-k <path>"?
[WARNING] Failed to load "title.keys" keyfile.
[WARNING] Failed to load NCA Header Key.
[nstool::SettingsInitializer ERROR] Input file type was undetermined.
PS I:\LAB\proto\MK8> .\nstool.exe -k .\prod.keys
[ERROR] Option "-k" requires a parameter.
PS I:\LAB\proto\MK8>
CMD
I:\LAB\proto\MK8>nstool.exe prod.keys
[WARNING] Failed to load "prod.keys" keyfile.Maybe specify it with "-k <path>"?
[WARNING] Failed to load "title.keys" keyfile.
[WARNING] Failed to load NCA Header Key.
[nstool::SettingsInitializer ERROR] Input file type was undetermined.
I:\LAB\proto\MK8>nstool.exe -k prod.keys
[ERROR] Option "-k" requires a parameter.
I:\LAB\proto\MK8>nstool.exe -k "prod.keys"
[ERROR] Option "-k" requires a parameter.
I:\LAB\proto\MK8>nstool.exe -k "I:\LAB\proto\MK8\prod.keys"
[ERROR] Option "-k" requires a parameter.
I:\LAB\proto\MK8>nstool.exe -k I:\LAB\proto\MK8\prod.keys
[ERROR] Option "-k" requires a parameter.
The key file is correct and has been dumped from my own OLED switch using lockpick Here is more information: FW version : 18.0.1 AMS : 1.7.0
Please let me know if there is anything else I could provide to provide you with the information required for the analysis.
Kind regards, Rei
The -k option needs to be specified when you try to read or extract a file. Simply adding the -k flag with the path and nothing else does not work because nstool assumes the last argument is the path to the file you are trying to read/extract, and that's not what you're trying to do with the prod.keys file. You need to specify it along with the command to read/extract, like .\nstool.exe -k prod.keys .\8252eafa139596b99ba4b1f4e958a52a.nca.
@thonkinator is correct.
hi @jakcron and @thonkinator,
i tried your solution and slightly changed the situation but did not worked as intended again, with both prod and non prod keys
can you help me out? if it's needed i'll open a new issue
The final argument to NSTool is always the input file, as in the file being processed. The final argument in your screenshot is GARG_NX2.nsp, and it doesn't exist in the directory so it's expected that NSTool shows an error of not being able to open the file.
The -x argument is to indicate to NSTool where you'd like to extract the NSP to.
hi @jakcron, i tried it again and it worked! thank you! (nstool.exe -d -k dev.keys -x I:\LAB\proto GARG_NX.nsp)
is it possible to do the opposit? so recompress it into a single NSP and encrypt it with another key? like a retail key
my aim was to decrypt and re encrypt the nsp with a different pair of key
Sadly NSTool doesn't support re-packing. Only unpack 😃