From 8c4f0b7e4255e49845d6735a5ef063df52d925bf Mon Sep 17 00:00:00 2001 From: Alex Barney Date: Tue, 31 Jan 2023 23:13:36 -0700 Subject: [PATCH] hactoolnet: Load personalized tickets if possible --- src/hactoolnet/ProcessAppFs.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/hactoolnet/ProcessAppFs.cs b/src/hactoolnet/ProcessAppFs.cs index 2af95faa..9976c17e 100644 --- a/src/hactoolnet/ProcessAppFs.cs +++ b/src/hactoolnet/ProcessAppFs.cs @@ -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(ticket.RightsId); - var accessKey = SpanHelpers.AsStruct(ticket.TitleKeyBlock); + var accessKey = SpanHelpers.AsStruct(key); ctx.KeySet.ExternalKeySet.Add(rightsId, accessKey).ThrowIfFailure(); }