Files
NDecrypt/3DSDecrypt/Headers/SystemControlInfo.cs
Matt Nadareski 4d9001f74c Mostly working implementation
It's very strange but there are some files that don't decrypt/re-encrypt properly at this point. It could be a key issue, but it's unknown for now.
2019-04-06 21:58:08 -07:00

50 lines
1.6 KiB
C#

using System.IO;
namespace ThreeDS.Headers
{
public class SystemControlInfo
{
public char[] ApplicationTitle = new char[8];
public byte[] Reserved1 = new byte[5];
public byte Flag;
public byte[] RemasterVersion = new byte[2];
public CodeSetInfo TextCodesetInfo;
public uint StackSize;
public CodeSetInfo ReadOnlyCodeSetInfo;
public byte[] Reserved2 = new byte[4];
public CodeSetInfo DataCodeSetInfo;
public uint BSSSize;
public byte[][] DependencyModuleList = new byte[48][];
public SystemInfo SystemInfo;
public static SystemControlInfo Read(BinaryReader reader)
{
SystemControlInfo sci = new SystemControlInfo();
try
{
sci.ApplicationTitle = reader.ReadChars(8);
sci.Reserved1 = reader.ReadBytes(5);
sci.Flag = reader.ReadByte();
sci.RemasterVersion = reader.ReadBytes(2);
sci.TextCodesetInfo = CodeSetInfo.Read(reader);
sci.StackSize = reader.ReadUInt32();
sci.ReadOnlyCodeSetInfo = CodeSetInfo.Read(reader);
sci.Reserved2 = reader.ReadBytes(4);
sci.DataCodeSetInfo = CodeSetInfo.Read(reader);
sci.BSSSize = reader.ReadUInt32();
for (int i = 0; i < 48; i++)
sci.DependencyModuleList[i] = reader.ReadBytes(8);
sci.SystemInfo = SystemInfo.Read(reader);
return sci;
}
catch
{
return null;
}
}
}
}