nstool icon indicating copy to clipboard operation
nstool copied to clipboard

Problem loading key file using "-k"

Open Teamspeak5 opened this issue 1 year ago • 1 comments

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

Teamspeak5 avatar May 05 '24 10:05 Teamspeak5

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 avatar May 14 '24 20:05 thonkinator

@thonkinator is correct.

jakcron avatar Aug 04 '24 04:08 jakcron

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 image can you help me out? if it's needed i'll open a new issue

Teamspeak5 avatar Aug 13 '24 18:08 Teamspeak5

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.

jakcron avatar Aug 14 '24 16:08 jakcron

The -x argument is to indicate to NSTool where you'd like to extract the NSP to.

jakcron avatar Aug 14 '24 16:08 jakcron

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

Teamspeak5 avatar Aug 14 '24 17:08 Teamspeak5

my aim was to decrypt and re encrypt the nsp with a different pair of key

Teamspeak5 avatar Aug 14 '24 17:08 Teamspeak5

Sadly NSTool doesn't support re-packing. Only unpack 😃

jakcron avatar Aug 14 '24 20:08 jakcron