Closed ghost closed 9 years ago
These are two of my commits, so I will fix this issue. I may already have an idea what happens here, but could you possibly give some more information? Is the bug in Decrypt9 or is it in the Python scripts? Is it already broken in the first commit you named? You may compare the output from a working version with a broken one.
Also is it confirmed broken for more titlekeys than the two you named?
UPDATE: I think I already fixed it. Could you try this and tell me if it works? https://github.com/d0k3/Decrypt9/tree/patch-4 I will only do the PR once you tell me it works.
The bug is with all certainty in Decrypt9, not the Python scripts. 4ab3491 left the Python scripts alone to begin with.
I compared the decTitleKeys.bin of 1cb661e and 4ab3491 for the same ticket.db -- all titlekeys mismatched, irrelevant of their type (eShop app, system title, demo, ...). It seems they do not mismatch in a simple way, such as simply being written out in reverse.
Yes, the Python scripts was a wild guess before I even took a look at the commits. Could you try my fix found here and tell me if it works? https://github.com/d0k3/Decrypt9/tree/patch-4
I'd test it myself, but I can't at the moment (don't have my laptop or even my 3DS here). The fix will almost certainly work, though. Also, thanks a ton for pointing this out. It must have been quite a bit of work to pinpoint the exact commits responsible for this.
Your fix works. Now I feel like an idiot, unable to see through a one-line change.
I am at fault. I had to change a lot of stuff in the crypto routines for TWLN decryption to work, and I simply forgot that little change for titlekey decryption. Anyways, thank you again!
By the way, if you want to know why this fix works... The old crypto routines only allowed big endian and normal order. For TWLN decryption to work, I had to change this to default to little endian / reversed order. And I forgot to set the titlekey decryption parameters back to big endian / normal order.
Fixed by #43.
Decryption of titlekeys broke between git commits 1cb661e and 4ab34916. I have tried to pinpoint the issue but have failed so far. This happens at least with the titlekeys for title IDs 0004013800000002 and 0004000000165800.