-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cart dump fails verification if it contains a title key encrypted partition yet contains a tik file. #178
Comments
Something else I tried was pulling the latest repo as of this issue and added titlekeys.txt inside the nsz folder (also tried the root folder |
nsz never reads def getTitleKeyBlock(self):
self.seekStart(0x40)
self.titleKeyBlock = self.readInt(0x10, 'big')
return self.titleKeyBlock
def titleKey(self):
return format(self.getTitleKeyBlock(), 'X').zfill(32) The file format of the ticket file is documented on https://switchbrew.org/wiki/Ticket. The fact that booth NXFileViewer and NSZ fail to optain the titlekey from the ticket seems to indicate that something causes the titlekey extraction to fail. Are you sure you have dumped and copied the latest prod.keys to %userprofile/.switch? Other missing keys could cause titlekey decription to fail which would explain who two independently developed tools experience the same issue. |
It only failing verification seams interesting. Are you just using NSZ to verify your dump or are you compressing your dump which is sucessful but it then fails the post-compression verification? The ticket file is copied over during compression/decompression as is so this causing the ticket to soehow get corrupted seems quite strange. |
Are you experience this issue just for this specific game or are other affected as well? The file name kind of confuses me. As far I’m aware the game cartages usually only contain the base game but this one seems to be the base game but with update v196608 included. I need to check my dumps again but I thought they were all v0. Maybe there is an option in nxdumptool to include updates or maybe you used a tool to later merge the cartage dump with an update dump. In any case I have the feeling XCI with updates included might not well-tested. |
I am going to try and answer these the best I can in order. Just now tried compressing Shadows Over Loating with NSCB and it started up just fine! This is weird.
Also to note, this is a cart dump with nxdumptool with default settings or settings I have been using. |
Also looking at tickets.py padding seems to be set at 0x40 and nothing for signature types of padding 0x3C. Line 41 in 921590a
per https://switchbrew.org/wiki/Ticket Could that be something to do with it? |
Your signature is at 0x3C?
Yes that could be the issue if you have a signature that isn't of type ECDSA. RSA signatures have a padding of 0x3D but I don't remember ever seeing them in an official ticket. What's the ticket signature type of your dump? Try just hardcoding 0x3C instead of 0x40 and see if that fixes your issue. If it does, I will make sure to implement support for the other signature types as this would indicate that someone actually started using them. |
Ticket is of type 010004, RSA-2048 PKCS#1 v1.5 with SHA-256 |
If you don't care about a proper fix, you can likely just hardcode the result of the |
This cart dump does contain a titlekey for its update. Within the tik, is the title key.
Below is the log output from nsz:
I have also attached some screenshots of the same cart dump from NXFileViewer which also can't find the titlekey (AccessKey) in the tik file. Which according to switchbrew docs, is where it should be?
Adding this title key to the title key database manually allows NXFileViewer to decrypt the partition as intended, but also still does not parse the titlekey from the tik inside the dump.
The text was updated successfully, but these errors were encountered: