PS5NorModifier
PS5NorModifier copied to clipboard
offsetTwo bug?
Going through and refactoring code I noticed an odd thing with the extract ps5 version code. (Line 412 form1.cs)
#region Extract PS5 Version
try
{
BinaryReader reader = new BinaryReader(new FileStream(fileDialogBox.FileName, FileMode.Open));
//Set the position of the reader
reader.BaseStream.Position = offsetOne;
//Read the offset
offsetOneValue = BitConverter.ToString(reader.ReadBytes(12)).Replace("-", null);
reader.Close();
}
catch
{
// Obviously this value is invalid, so null the value and move on
offsetOneValue = null;
}
try
{
BinaryReader reader = new BinaryReader(new FileStream(fileDialogBox.FileName, FileMode.Open));
//Set the position of the reader
reader.BaseStream.Position = offsetOne; // Shouldn't this be offsetTwo???
//Read the offset
offsetTwoValue = BitConverter.ToString(reader.ReadBytes(12)).Replace("-", null);
reader.Close();
}
catch
{
// Obviously this value is invalid, so null the value and move on
offsetTwoValue = null;
}
if(offsetOneValue?.Contains("22020101")??false)
{
modelInfo.Text = "Disc Edition";
}
else
{
if(offsetTwoValue?.Contains("22030101") ?? false)
{
modelInfo.Text = "Digital Edition";
}
else
{
modelInfo.Text = "Unknown";
}
}
#endregion
If im reading this correctly you intended to use offsetTwo for line 412 not offsetOne unless this was used for testing?