From d2cf1ecb1febb51758352b37530b437cce91f511 Mon Sep 17 00:00:00 2001 From: roblabla Date: Thu, 17 Oct 2019 19:56:29 +0000 Subject: [PATCH] hactoolnet: Add Title Name to NCA output When displaying an NCA containing an NPDM in the code partition, display the title name. --- src/hactoolnet/ProcessNca.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/hactoolnet/ProcessNca.cs b/src/hactoolnet/ProcessNca.cs index f6125e29..9a078e85 100644 --- a/src/hactoolnet/ProcessNca.cs +++ b/src/hactoolnet/ProcessNca.cs @@ -232,6 +232,15 @@ namespace hactoolnet PrintItem(sb, colLen, $"NPDM Signature{nca.VerifySignature2().GetValidityString()}:", nca.Header.Signature2.ToArray()); PrintItem(sb, colLen, "Content Size:", $"0x{nca.Header.NcaSize:x12}"); PrintItem(sb, colLen, "TitleID:", $"{nca.Header.TitleId:X16}"); + if (nca.CanOpenSection(NcaSectionType.Code)) { + IFileSystem fs = nca.OpenFileSystem(NcaSectionType.Code, IntegrityCheckLevel.None); + Result r = fs.OpenFile(out var file, "/main.npdm", OpenMode.Read); + if (r.IsSuccess()) { + NpdmBinary npdm = new NpdmBinary(file.AsStream(), null); + PrintItem(sb, colLen, "Title Name:", npdm.TitleName); + } + } + PrintItem(sb, colLen, "SDK Version:", nca.Header.SdkVersion); PrintItem(sb, colLen, "Distribution type:", nca.Header.DistributionType); PrintItem(sb, colLen, "Content Type:", nca.Header.ContentType);