private void buttonOpen_Click(object sender, EventArgs e) { if (openPS4DMP.ShowDialog() == DialogResult.OK) { textOpen.Text = openPS4DMP.FileName; directoryName = Path.GetDirectoryName(textOpen.Text); if (PS4Nor.CheckHeader(textOpen.Text) == true) { if (PS4Nor.CheckSize(textOpen.Text) == true) { checkBox1.Enabled = true; checkBox2.Enabled = true; } else { MessageBox.Show("PS4 Dump is corrupted"); } } else { MessageBox.Show("Invalid file"); } } }
private void buttonOpen_Click(object sender, EventArgs e) { if (openPS4DMP.ShowDialog() == DialogResult.OK) { textOpen.Text = openPS4DMP.FileName; if (PS4Nor.CheckHeader(textOpen.Text) == true) { if (PS4Nor.CheckSize(textOpen.Text) == true) { SHA1 sha = new SHA1CryptoServiceProvider(); ASCIIEncoding encode = new ASCIIEncoding(); bufferB = new byte[20]; Tool.readBuffer = null; Tool.ReadWriteData(textOpen.Text, null, "r"); bufferB = sha.ComputeHash(Tool.readBuffer); textSHA1.Text = BitConverter.ToString(bufferB).Replace("-", ""); #region GetCID //Checking MAC Address and Display it in the GUI bufferA = PS4Nor.GetMAC(textOpen.Text); if (bufferA != null && bufferA != PS4Nor.ffMAC) { textMAC.Text = BitConverter.ToString(bufferA).Replace("-", ":"); Logger.WriteLine(l, "Console MAC Address is: " + textMAC.Text); } else { Logger.WriteLine(l, "Console MAC Address is only Null or FF Bytes!"); } bufferA = null; // Checking Console Serial and Display it in the GUI bufferA = PS4Nor.GetCID(textOpen.Text); if (bufferA != null && bufferA != PS4Nor.ffCSerial) { bufferString = encode.GetString(bufferA); textCID.Text = bufferString.Insert(10, "-"); Logger.WriteLine(l, "Console Serial is:" + textCID.Text); } else { Logger.WriteLine(l, "Console Serial is only Null or FF Bytes!"); } bufferA = null; // Checking SKU Version and Display it in the GUI bufferA = PS4Nor.GetSKU(textOpen.Text); if (bufferA != null && bufferA != PS4Nor.ffSKU) { textSKU.Text = encode.GetString(bufferA); Logger.WriteLine(l, "Console SKU Version is: " + textSKU.Text); } else { Logger.WriteLine(l, "Console SKU Version is only Null or FF Bytes!"); } bufferA = null; // Checking FirmWare Version and Display it in the GUI bufferA = PS4Nor.GetFWV(textOpen.Text); if (bufferA != null && bufferA != PS4Nor.ffMAC) { bufferString = BitConverter.ToString(bufferA).Replace("-", ""); textFWV.Text = bufferString.Insert(2, ".").Replace("01.", "1.").Replace("02.", "2.").Replace("03.", "3.").Replace("04.", "4.").Replace("05.", "5.").Replace("06.", "6.").Replace("07.", "7.").Replace("08.", "8.").Replace("09.", "9.").Insert(4, "."); Logger.WriteLine(l, "Console FirmWare Version is: " + textFWV.Text); } else { Logger.WriteLine(l, "Console FirmWare Version is only Null or FF Bytes!"); } bufferA = null; #endregion CheckingCID buttonExtractNow.Enabled = true; } else { MessageBox.Show("PS4 NOR Dump is corrupted\nSize miss match\n\n"); Logger.WriteLine(l, "PS4 NOR Dump is corrupted\nSize miss match\n\n"); textOpen.Text = "Select PS4 NOR Dump 2 Extract..."; } } else { MessageBox.Show("This is NOT a valide PS4 NOR Dump file\nHeader miss match\n\n"); Logger.WriteLine(l, "This is NOT a valide PS4 NOR Dump file\nHeader miss match\n\n"); textOpen.Text = "Select PS4 NOR Dump 2 Extract..."; } } }