Ejemplo n.º 1
0
        public void openAPI(String fileName, String workingDirectoryPath)
        {
            useAPI         = true;
            recoveryRecord = false;
            parseRecord    = false;
            carveRecord    = false;
            edbParserManager.colse();
            HexReader hexReader;

            try
            {
                hexReader = new HexReader(fileName);
            }
            catch
            {
                MessageBox.Show("This file is currently in use", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            long signature = hexReader.readLong(4);

            if (signature != 6736818458095L)
            {
                MessageBox.Show("Please open the correct file", "This file is not ESE database", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            int status = hexReader.readInt(0x34);

            if (status == 2)
            {
                MessageBox.Show("Error : Use Open(parsing)", "This file is Dirty status", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            pageSize = hexReader.readInt(236);
            hexReader.close();

            FormInputUTCTime formInputUTCTime = new FormInputUTCTime();
            DialogResult     dialogResut      = formInputUTCTime.ShowDialog();

            if (dialogResut == DialogResult.OK)
            {
                // Read the contents of testDialog's TextBox.
                UTCTime = formInputUTCTime.getUTCTime();
            }

            formInputUTCTime.Dispose();



            try
            {
                FastCopy(fileName, workingDirectoryPath);
            }
            catch
            {
                MessageBox.Show("This file is currently in use", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            fileName = workingDirectoryPath;
            try
            {
                if (!esentManager.Initialize(fileName, pageSize))
                {
                    MessageBox.Show("This file is not WebCacheV01.dat(Internet Explorer DB)", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }

                String[] Time = UTCTime.Replace("UTC-", "").Replace("UTC+", "").Split(':');
                this.UTCAddHour   = "0";
                this.UTCAddMinute = "0";
                if (Time.Length == 1)
                {
                    UTCAddHour = Time[0];
                }
                else if (Time.Length == 2)
                {
                    UTCAddHour   = Time[0];
                    UTCAddMinute = Time[1];
                }
                esentManager.setUTCTime(UTCAddHour, UTCAddMinute);
                dockTableList.clearList();
                openFileUsingAPI();

                return;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }