This commit is contained in:
Alex Barney 2018-08-02 16:37:42 -05:00
parent ff05327846
commit 04fabb8948
4 changed files with 18 additions and 13 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();
return;
var titles = GetTitleIds("titles.txt");
foreach (var title in titles)
{
var control = net.GetControl(title, 0);
}
}
private static void OpenKeyset(Context ctx)

View File

@ -20,6 +20,8 @@ namespace libhac
public TitleVersion MinimumSystemVersion { get; }
public TitleVersion MinimumApplicationVersion { get; }
public Cnmt() { }
public Cnmt(Stream file)
{
using (var reader = new BinaryReader(file))
@ -76,6 +78,8 @@ namespace libhac
public long Size { get; set; }
public CnmtContentType Type { get; set; }
public CnmtContentEntry() { }
public CnmtContentEntry(BinaryReader reader)
{
Hash = reader.ReadBytes(0x20);
@ -93,6 +97,7 @@ namespace libhac
public TitleVersion Version { get; }
public CnmtContentType Type { get; }
public CnmtMetaEntry() { }
public CnmtMetaEntry(BinaryReader reader)
{