diff --git a/LibHac/Keyset.cs b/LibHac/Keyset.cs index 1d709495..10d7174e 100644 --- a/LibHac/Keyset.cs +++ b/LibHac/Keyset.cs @@ -396,6 +396,8 @@ namespace LibHac public static string PrintKeys(Keyset keyset, Dictionary dict) { + if(dict.Count == 0) return string.Empty; + var sb = new StringBuilder(); int maxNameLength = dict.Values.Max(x => x.Name.Length); @@ -429,13 +431,10 @@ namespace LibHac public static string PrintTitleKeys(Keyset keyset) { var sb = new StringBuilder(); - int maxNameLength = keyset.TitleKeys.Values.Max(x => x.Length); foreach (KeyValuePair kv in keyset.TitleKeys) { - byte[] key = kv.Key; - byte[] value = kv.Value; - string line = $"{key.ToHexString().PadRight(maxNameLength)} = {value.ToHexString()}"; + string line = $"{kv.Key.ToHexString()} = {kv.Value.ToHexString()}"; sb.AppendLine(line); } diff --git a/hactoolnet/Program.cs b/hactoolnet/Program.cs index 6cc18d21..3476f4e4 100644 --- a/hactoolnet/Program.cs +++ b/hactoolnet/Program.cs @@ -100,7 +100,7 @@ namespace hactoolnet ctx.Keyset.SetSdSeed(ctx.Options.SdSeed.ToBytes()); } - if (ctx.Options.OutDir != null) + if (ctx.Options.InFileType == FileType.Keygen && ctx.Options.OutDir != null) { string dir = ctx.Options.OutDir; Directory.CreateDirectory(dir);