Update Calibration

This commit is contained in:
Xpl0itR 2020-05-25 18:25:38 +01:00 committed by Alex Barney
parent 99f6a0054b
commit 2171f2ae21

View file

@ -5,13 +5,16 @@ namespace LibHac
{
public class Calibration
{
public const string ExpectedMagic = "CAL0";
public string Magic;
public uint Field4;
public int Version;
public int CalibDataSize;
public short Version;
public short Model;
public short Revision;
public byte[] CalibDataSha256;
public string ConfigId1;
public byte[] Reserved;
public int WlanCountryCodesNum;
public int WlanCountryCodesLastIdx;
public string[] WlanCountryCodes;
@ -60,21 +63,53 @@ namespace LibHac
public byte[] SslExtKey;
public byte[] GamecardExtKey;
public int LcdVendorId;
public byte[] ExtendedRsa2048DeviceKey;
public byte[] Rsa2048DeviceCertificate;
public byte[] UsbTypeCPowerSourceCircuitVersion;
public int HomeMenuSchemeSubColor;
public int HomeMenuSchemeBezelColor;
public int HomeMenuSchemeMainColor1;
public int HomeMenuSchemeMainColor2;
public int HomeMenuSchemeMainColor3;
public byte[] AnalogStickModuleTypeL;
public byte[] AnalogStickModelParameterL;
public byte[] AnalogStickFactoryCalibrationL;
public byte[] AnalogStickModuleTypeR;
public byte[] AnalogStickModelParameterR;
public byte[] AnalogStickFactoryCalibrationR;
public byte[] ConsoleSixAxisSensorModuleType;
public byte[] ConsoleSixAxisSensorHorizontalOffset;
public byte[] BatteryVersion;
public int HomeMenuSchemeModel;
public byte[] ConsoleSixAxisSensorMountType;
public Calibration(Stream stream)
{
var reader = new BinaryReader(stream, Encoding.Default, true);
using BinaryReader reader = new BinaryReader(stream, Encoding.Default, true);
stream.Position = 0;
Magic = reader.ReadUtf8(4);
Field4 = reader.ReadUInt32();
stream.Position = 0x0;
Magic = reader.ReadUtf8(0x4);
stream.Position = 0x4;
Version = reader.ReadInt32();
stream.Position = 0x8;
CalibDataSize = reader.ReadInt32();
Version = reader.ReadInt16();
stream.Position = 0xC;
Model = reader.ReadInt16();
stream.Position = 0xE;
Revision = reader.ReadInt16();
stream.Position = 0x20;
CalibDataSha256 = reader.ReadBytes(0x20);
ConfigId1 = reader.ReadUtf8Z();
stream.Position = 0x40;
ConfigId1 = reader.ReadUtf8Z(0x1E);
stream.Position = 0x60;
Reserved = reader.ReadBytes(0x20);
stream.Position = 0x80;
WlanCountryCodesNum = reader.ReadInt32();
@ -85,22 +120,22 @@ namespace LibHac
stream.Position = 0x88 + i * 4;
WlanCountryCodes[i] = reader.ReadUtf8Z();
}
stream.Position = 0x210;
WlanMacAddr = reader.ReadBytes(6);
WlanMacAddr = reader.ReadBytes(0x6);
stream.Position = 0x220;
BdAddr = reader.ReadBytes(6);
BdAddr = reader.ReadBytes(0x6);
stream.Position = 0x230;
AccelerometerOffset = reader.ReadBytes(6);
AccelerometerOffset = reader.ReadBytes(0x6);
stream.Position = 0x238;
AccelerometerScale = reader.ReadBytes(6);
AccelerometerScale = reader.ReadBytes(0x6);
stream.Position = 0x240;
GyroscopeOffset = reader.ReadBytes(6);
GyroscopeOffset = reader.ReadBytes(0x6);
stream.Position = 0x248;
GyroscopeScale = reader.ReadBytes(6);
GyroscopeScale = reader.ReadBytes(0x6);
stream.Position = 0x250;
SerialNumber = reader.ReadUtf8Z();
SerialNumber = reader.ReadUtf8Z(0x18);
stream.Position = 0x270;
DeviceKeyEccP256 = reader.ReadBytes(0x30);
@ -146,7 +181,7 @@ namespace LibHac
EticketCertRsa = reader.ReadBytes(0x240);
stream.Position = 0x2CE0;
BatteryLot = reader.ReadUtf8Z();
BatteryLot = reader.ReadUtf8Z(0x18);
stream.Position = 0x2D00;
SpeakerCalibValue = reader.ReadBytes(0x800);
@ -189,6 +224,52 @@ namespace LibHac
stream.Position = 0x3D60;
LcdVendorId = reader.ReadInt32();
stream.Position = 0x3D70;
ExtendedRsa2048DeviceKey = reader.ReadBytes(0x240);
stream.Position = 0x3FC0;
Rsa2048DeviceCertificate = reader.ReadBytes(0x240);
stream.Position = 0x4210;
UsbTypeCPowerSourceCircuitVersion = reader.ReadBytes(0x1);
stream.Position = 0x4220;
HomeMenuSchemeSubColor = reader.ReadInt32();
stream.Position = 0x4230;
HomeMenuSchemeBezelColor = reader.ReadInt32();
stream.Position = 0x4240;
HomeMenuSchemeMainColor1 = reader.ReadInt32();
stream.Position = 0x4250;
HomeMenuSchemeMainColor2 = reader.ReadInt32();
stream.Position = 0x4260;
HomeMenuSchemeMainColor3 = reader.ReadInt32();
stream.Position = 0x4270;
AnalogStickModuleTypeL = reader.ReadBytes(0x1);
stream.Position = 0x4280;
AnalogStickModelParameterL = reader.ReadBytes(0x12);
stream.Position = 0x42A0;
AnalogStickFactoryCalibrationL = reader.ReadBytes(0x9);
stream.Position = 0x42B0;
AnalogStickModuleTypeR = reader.ReadBytes(0x1);
stream.Position = 0x42C0;
AnalogStickModelParameterR = reader.ReadBytes(0x12);
stream.Position = 0x42E0;
AnalogStickFactoryCalibrationR = reader.ReadBytes(0x9);
stream.Position = 0x42F0;
ConsoleSixAxisSensorModuleType = reader.ReadBytes(0x1);
stream.Position = 0x4300;
ConsoleSixAxisSensorHorizontalOffset = reader.ReadBytes(0x6);
stream.Position = 0x4310;
BatteryVersion = reader.ReadBytes(0x1);
stream.Position = 0x4330;
HomeMenuSchemeModel = reader.ReadInt32();
stream.Position = 0x4340;
ConsoleSixAxisSensorMountType = reader.ReadBytes(0x1);
}
}
}
}