예제 #1
0
        private void Load3Dump()
        {
            if (Settings.Default.UseDefaultKeys)
            {
                ODD.LoadDefaultKeys();
                ShowKeys(true);
                has3DumpLoaded = true;
            }
            else
            {
                string EID4Str = Settings.Default.EID4Str;
                string KEStr   = Settings.Default.KEStr;
                string IEStr   = Settings.Default.IEStr;

                theAppState    = AppStates.DETECTING;
                has3DumpLoaded = EID4Str.Length != 0 && EID4Str.Length != 0 && EID4Str.Length != 0;
                if (!has3DumpLoaded)
                {
                    AddEvent("No key data, please load your 3Dump.bin", ReportType.Warning);
                    return;
                }

                EID4 = EID4Str.AsByteArray();
                KE   = KEStr.AsByteArray();
                IE   = IEStr.AsByteArray();
                ODD.LoadKeys(EID4, KE, IE);
                ShowKeys(false);
            }
        }
예제 #2
0
        /*************************************************************
        *************************************************************/
        private async void AuthenticateDrive()
        {
            if (theODD == null)
            {
                return;
            }

            if (!has3DumpLoaded)
            {
                return;
            }

            if (Settings.Default.UseDefaultKeys)
            {
                ODD.LoadDefaultKeys();
                if (!theODD.AuthenticateDrive())
                {
                    bool writeKeys = await formsInteraction.UIExecute(() => MessageBox.Show(
                                                                          Resources.UseDefaultKeys,
                                                                          Resources.DefaultKeysCaption, MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) ==
                                                                      DialogResult.Yes);

                    if (writeKeys)
                    {
                        // Authentication failed,
                        if (!theODD.WritePBlock())
                        {
                            Interaction.Instance.ReportMessage("Couldn't load P Block - Drive Authentication Failed", ReportType.Fail);
                            return;
                        }
                    }
                }
            }

            bool theResult = theODD.AuthenticateDrive();

            if (!theResult)
            {
                Interaction.Instance.ReportMessage("Drive Authentication Failed", ReportType.Fail);
                StateMachine(AppStims.DRIVE_AUTH_FAILED);
                await formsInteraction.UIExecute(() => { btnLoadKeys.Enabled = true; });
            }
            else
            {
                Interaction.Instance.ReportMessage("Drive Authenticated OK", ReportType.Success);
                StateMachine(AppStims.DRIVE_AUTH_PASSED);
                await formsInteraction.UIExecute(() => { btnLoadKeys.Enabled = false; });

                StateMachine(AppStims.DISK_PRESENT);
                await formsInteraction.UIExecute(() => DiskTypeDetectionWorker.RunWorkerAsync());
            }
        }