mirror of
https://github.com/SabreTools/NDecrypt.git
synced 2026-09-22 14:55:03 +00:00
Read ContentIndex data, just in case
This commit is contained in:
@@ -49,7 +49,7 @@ namespace NDecrypt.N3DS.Headers
|
||||
/// <summary>
|
||||
/// Content Index
|
||||
/// </summary>
|
||||
public int ContentIndex { get; private set; }
|
||||
public byte[] ContentIndex { get; private set; }
|
||||
|
||||
#region Content Index
|
||||
|
||||
@@ -102,8 +102,7 @@ namespace NDecrypt.N3DS.Headers
|
||||
header.TMDFileSize = reader.ReadInt32();
|
||||
header.MetaSize = reader.ReadInt32();
|
||||
header.ContentSize = reader.ReadInt64();
|
||||
header.ContentIndex = reader.ReadInt32();
|
||||
reader.ReadBytes(0x2000); // TODO: Not sure what's in the Content Index area
|
||||
header.ContentIndex = reader.ReadBytes(0x2000);
|
||||
if (reader.BaseStream.Position % 64 != 0)
|
||||
reader.BaseStream.Seek(64 - (reader.BaseStream.Position % 64), SeekOrigin.Current);
|
||||
|
||||
|
||||
@@ -176,6 +176,11 @@ namespace NDecrypt.N3DS.Headers
|
||||
/// </summary>
|
||||
public int ContentIndexSize { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Content Index
|
||||
/// </summary>
|
||||
public byte[] ContentIndex { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Certificate chain
|
||||
/// </summary>
|
||||
@@ -252,7 +257,7 @@ namespace NDecrypt.N3DS.Headers
|
||||
reader.ReadBytes(4); // Seek to size in Content Index
|
||||
tk.ContentIndexSize = BitConverter.ToInt32(reader.ReadBytes(4).Reverse().ToArray(), 0);
|
||||
reader.BaseStream.Seek(-8, SeekOrigin.Current);
|
||||
reader.ReadBytes(tk.ContentIndexSize); // TODO: Not sure what's in the Content Index area
|
||||
tk.ContentIndex = reader.ReadBytes(tk.ContentIndexSize);
|
||||
if (reader.BaseStream.Position % 64 != 0)
|
||||
reader.BaseStream.Seek(64 - (reader.BaseStream.Position % 64), SeekOrigin.Current);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user