Beispiel #1
0
        private void bgwMain_DoWork(object sender, DoWorkEventArgs e)
        {
            object[] args = (object[])e.Argument;
            string filePath = (string)args[0];
            bool resolveChain = (bool)args[1];

            DataTable dt = new DataTable();
            dt.Columns.Add("Item");
            dt.Columns.Add("Value");

            dt.Rows.Add("Source", filePath);

            try
            {
                if (resolveChain)
                {
                    using (Disk disk = new Disk(filePath))
                    {
                        DumpHeader((DiscUtils.Ewf.Section.Header2)disk.GetSection("header"), dt);
                        DumpVolume((DiscUtils.Ewf.Section.Volume)disk.GetSection("volume"), dt);
                        dt.Rows.Add("Segments", disk.Files.Count);
                    }
                }
                else
                {
                    EWFInfo ewfInfo = new EWFInfo(filePath);
                    DumpHeader(ewfInfo.HeaderSection, dt);
                    DumpVolume(ewfInfo.VolumeSection, dt);
                }
            }
            //catch (Exception ex)
            catch(Exception ex)
            {
                dt.Rows.Add("Error", ex.Message);
                if (ex.InnerException != null)
                    dt.Rows.Add("More Info", ex.InnerException.Message);
            }

            e.Result = dt;
        }
Beispiel #2
0
 private void bgwMD5_DoWork(object sender, DoWorkEventArgs e)
 {
     string fileName = (string)e.Argument;
     using (DiscUtils.Ewf.Disk disk = new DiscUtils.Ewf.Disk(fileName))
     {
         MD5CryptoServiceProvider md5Provider = new MD5CryptoServiceProvider();
         byte[] md5Bytes = md5Provider.ComputeHash(disk.Content);
         e.Result = Utils.ByteArrayToByteString(md5Bytes, 0, md5Bytes.Length);
     }
 }