Beispiel #1
0
        private void openInHexeditorToolStripMenuItem_Click(object sender, EventArgs e)
        {
            string tmpStr = "";

            if (this.txtPath.Text.EndsWith("/"))
            {
                tmpStr = this.txtPath.Text + Convert.ToString(this.lstFile.SelectedItem);
            }
            else
            {
                tmpStr = this.txtPath.Text + "/" + Convert.ToString(this.lstFile.SelectedItem);
            }

            if (File.Exists("ninja.tmp"))
            {
                File.Delete("ninja.tmp");
            }

            GetFile(tmpStr, "ninja.tmp");

            FileStream fs = new FileStream("ninja.tmp", FileMode.Open, FileAccess.Read);

            byte[] fileContent = new byte[fs.Length];
            fs.Read(fileContent, 0, fileContent.Length);
            fs.Close();
            File.Delete("ninja.tmp");

            frmDump DUMPForm = new frmDump();

            DUMPForm.Filename = tmpStr;
            DUMPForm.Data     = fileContent;
            DUMPForm.LineOff  = 0;
            DUMPForm.ShowDialog();
        }
Beispiel #2
0
        private void ReadDataComplete(object sender, RunWorkerCompletedEventArgs e)
        {
            frmDump FRMDump = new frmDump();

            FRMDump.Data     = this.Data;
            FRMDump.LineOff  = (ulong)this.SelectedStart;
            FRMDump.Text     = this.Text + " - DUMP - " + string.Format("0x{0:X} - 0x{1:X}", this.SelectedStart, this.SelectedStart + this.SelectedSize);
            FRMDump.Filename = string.Format("0x{0:X}_0x{1:X}.bin", this.SelectedStart, this.SelectedStart + this.SelectedSize);
            FRMDump.ShowDialog();

            this.prgBar.Value = 0;
        }