This commit is contained in:
Alex Barney 2018-08-02 16:37:42 -05:00
parent 6f693ee500
commit aa0512d0bb
3 changed files with 12 additions and 12 deletions

View file

@ -52,13 +52,13 @@ namespace Net
titleDb.MaxVersion = title.version;
int maxVersionShort = title.version >> 16;
for(int i = 0; i <= maxVersionShort; i++)
for (int i = 0; i <= maxVersionShort; i++)
{
var version = i << 16;
if (!titleDb.Versions.TryGetValue(version, out TitleVersion versionDb))
{
versionDb = new TitleVersion {Version = version};
versionDb = new TitleVersion { Version = version };
titleDb.Versions.Add(version, versionDb);
}
}
@ -70,6 +70,7 @@ namespace Net
{
public long Id { get; set; }
public long UpdateId { get; set; }
public List<long> AocIds { get; set; } = new List<long>();
public int MaxVersion { get; set; }
public Dictionary<int, TitleVersion> Versions { get; set; } = new Dictionary<int, TitleVersion>();

View file

@ -106,6 +106,8 @@ namespace Net
if (controlEntry == null) return null;
var controlNca = GetNcaFile(titleId, version, controlEntry.NcaId.ToHexString());
if (controlNca == null) return null;
var nca = new Nca(ToolCtx.Keyset, controlNca, true);
var romfs = new Romfs(nca.OpenSection(0, false));
var controlNacp = romfs.GetFile("/control.nacp");

View file

@ -80,26 +80,23 @@ namespace Net
var control = net.GetControl((ulong)titleId, version.Version);
version.Control = control;
if (control == null) version.Exists = false;
Cnmt meta = net.GetCnmt((ulong)titleId, version.Version);
version.ContentMetadata = meta;
if (meta == null) version.Exists = false;
logger?.LogMessage($"{titleId}v{version.Version}");
//Thread.Sleep(300);
}
catch (Exception ex)
{
Console.WriteLine($"Failed getting {titleId}v{version.Version}\n{ex.Message}");
logger?.LogMessage($"Failed getting {titleId}v{version.Version}\n{ex.Message}");
}
}
// net.Save();
// net.Save();
}
net.Save();
return;
var titles = GetTitleIds("titles.txt");
foreach (var title in titles)
{
var control = net.GetControl(title, 0);
}
}
private static void OpenKeyset(Context ctx)