mirror of
https://github.com/Thealexbarney/LibHac.git
synced 2024-11-14 10:49:41 +01:00
hactoolnet: Load personalized tickets if possible
This commit is contained in:
parent
754df0dcd9
commit
8c4f0b7e42
1 changed files with 5 additions and 4 deletions
|
@ -23,14 +23,15 @@ internal static class ProcessAppFs
|
|||
|
||||
var ticket = new Ticket(tikFile.Get.AsStream());
|
||||
|
||||
if (ticket.TitleKeyType != TitleKeyType.Common)
|
||||
continue;
|
||||
|
||||
if (ticket.RightsId.IsZeros())
|
||||
continue;
|
||||
|
||||
byte[] key = ticket.GetTitleKey(ctx.KeySet);
|
||||
if (key is null)
|
||||
continue;
|
||||
|
||||
var rightsId = SpanHelpers.AsStruct<RightsId>(ticket.RightsId);
|
||||
var accessKey = SpanHelpers.AsStruct<AccessKey>(ticket.TitleKeyBlock);
|
||||
var accessKey = SpanHelpers.AsStruct<AccessKey>(key);
|
||||
|
||||
ctx.KeySet.ExternalKeySet.Add(rightsId, accessKey).ThrowIfFailure();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue