mirror of
https://github.com/Thealexbarney/LibHac.git
synced 2024-11-14 10:49:41 +01:00
Fix key printing
This commit is contained in:
parent
db00267ef4
commit
47a3eda0ed
2 changed files with 4 additions and 5 deletions
|
@ -396,6 +396,8 @@ namespace LibHac
|
|||
|
||||
public static string PrintKeys(Keyset keyset, Dictionary<string, KeyValue> 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<byte[], byte[]> 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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue