Ejemplo n.º 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);
            }
        }
Ejemplo n.º 2
0
        /*************************************************************
        *************************************************************/
        private void btnLoadKeys_Click(object sender, EventArgs e)
        {
            if (open3DumpFileDialog.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            byte[] eid4 = new byte[0x20];
            byte[] cmac = new byte[0x10];
            byte[] ke   = new byte[0x20];
            byte[] ie   = new byte[0x10];

            try
            {
                using (FileStream the3DumpFile = new FileStream(open3DumpFileDialog.FileName, FileMode.Open,
                                                                FileAccess.Read))
                {
                    using (BinaryReader br = new BinaryReader(the3DumpFile))
                    {
                        br.Read(eid4, 0, 0x20);
                        br.Read(cmac, 0, 0x10);
                        br.Read(ke, 0, 0x20);
                        br.Read(ie, 0, 0x10);
                    }
                }
            }
            catch (Exception ee)
            {
                string fail = ee.Message;
                AddEvent(fail, ReportType.Fail);
                return;
            }

            string hex = BitConverter.ToString(eid4);

            hex = hex.Replace("-", "");
            Settings.Default.EID4Str = hex;

            hex = BitConverter.ToString(cmac);
            hex = hex.Replace("-", "");
            Settings.Default.CMACStr = hex;

            hex = BitConverter.ToString(ke);
            hex = hex.Replace("-", "");
            Settings.Default.KEStr = hex;

            hex = BitConverter.ToString(ie);
            hex = hex.Replace("-", "");
            Settings.Default.IEStr = hex;

            Settings.Default.Save();

            has3DumpLoaded = true;

            ODD.LoadKeys(eid4, ke, ie);
            ShowKeys(false);

            AuthenticateDrive();
        }