LoadDatabase() public method

public LoadDatabase ( string fileNameToLoad ) : void
fileNameToLoad string
return void
        private void LoadSqlite(string mbdbLocation)
        {
            if (mbdbLocation.Length == 0)
            {
                return; // cannot be 0
            }

            string whatsAppSqliteLocation = "";
            List <WhatForensics.mbdb.MBFileRecord> mbdbRecords = WhatForensics.mbdb.ReadMBDB(mbdbLocation);

            foreach (WhatForensics.mbdb.MBFileRecord mbdbRecord in mbdbRecords)
            {
                if (mbdbRecord.Domain == "AppDomain-net.whatsapp.WhatsApp")
                {
                    if (mbdbRecord.Path == "Documents/ChatStorage.sqlite")
                    {
                        whatsAppSqliteLocation = mbdbLocation + "\\" + mbdbRecord.key;
                    }
                }
            }

            if (whatsAppSqliteLocation.Length == 0)
            {
                MessageBox.Show("WhatsApp was not found on this backup file", "WhatsApp not found", MessageBoxButtons.OK);
            }

            ownerPointer.LoadDatabase(whatsAppSqliteLocation);
        }
Example #2
0
        private void btnAcquire_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Warning: This mode of acquisition may not be forensically safe as it uses utilities (AFC) only available on jailbroken devices. This means that the derived data may not be accepted in court. Are you sure you want to continue?", "Warning", MessageBoxButtons.OKCancel) == System.Windows.Forms.DialogResult.Cancel)
            {
                return;
            }

            string waSandboxedPath = "";

            string[] paths = testDevice.GetDirectories("/var/mobile/Applications/");
            pbAcquisition.Maximum = paths.Length;
            int progress = 0;

            foreach (string appSandboxFolders in paths)
            {
                progress++;
                pbAcquisition.Value = progress;
                Application.DoEvents();

                string[] subfolders = testDevice.GetDirectories("/var/mobile/Applications/" + appSandboxFolders + "/");
                foreach (string appFolders in subfolders)
                {
                    if (appFolders == "WhatsApp.app")
                    {
                        waSandboxedPath = "/var/mobile/Applications/" + appSandboxFolders + "/Documents/ChatStorage.sqlite";
                    }
                }
            }


            //bool success = testDevice.Exists(waSandboxedPath);
            //MessageBox.Show(waSandboxedPath);
            string copyDestination = Application.StartupPath + "\\AcquiredChatStorage.sqlite";

            if (System.IO.File.Exists(copyDestination))
            {
                System.IO.File.Delete(copyDestination);
            }
            bool success = testDevice.CopyFileFromPhone(testDevice, waSandboxedPath, Application.StartupPath, "AcquiredChatStorage.sqlite");

            //MessageBox.Show(copyDestination);

            ownerPointer.LoadDatabase(copyDestination);

            MessageBox.Show("Acquisition Complete");
            this.Close();
            //MessageBox.Show(success.ToString());
        }