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)
|
public static string PrintKeys(Keyset keyset, Dictionary<string, KeyValue> dict)
|
||||||
{
|
{
|
||||||
|
if(dict.Count == 0) return string.Empty;
|
||||||
|
|
||||||
var sb = new StringBuilder();
|
var sb = new StringBuilder();
|
||||||
int maxNameLength = dict.Values.Max(x => x.Name.Length);
|
int maxNameLength = dict.Values.Max(x => x.Name.Length);
|
||||||
|
|
||||||
|
@ -429,13 +431,10 @@ namespace LibHac
|
||||||
public static string PrintTitleKeys(Keyset keyset)
|
public static string PrintTitleKeys(Keyset keyset)
|
||||||
{
|
{
|
||||||
var sb = new StringBuilder();
|
var sb = new StringBuilder();
|
||||||
int maxNameLength = keyset.TitleKeys.Values.Max(x => x.Length);
|
|
||||||
|
|
||||||
foreach (KeyValuePair<byte[], byte[]> kv in keyset.TitleKeys)
|
foreach (KeyValuePair<byte[], byte[]> kv in keyset.TitleKeys)
|
||||||
{
|
{
|
||||||
byte[] key = kv.Key;
|
string line = $"{kv.Key.ToHexString()} = {kv.Value.ToHexString()}";
|
||||||
byte[] value = kv.Value;
|
|
||||||
string line = $"{key.ToHexString().PadRight(maxNameLength)} = {value.ToHexString()}";
|
|
||||||
sb.AppendLine(line);
|
sb.AppendLine(line);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -100,7 +100,7 @@ namespace hactoolnet
|
||||||
ctx.Keyset.SetSdSeed(ctx.Options.SdSeed.ToBytes());
|
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;
|
string dir = ctx.Options.OutDir;
|
||||||
Directory.CreateDirectory(dir);
|
Directory.CreateDirectory(dir);
|
||||||
|
|
Loading…
Reference in a new issue