Esempio n. 1
0
        private void btnWork_Click(object sender, EventArgs e)
        {
            if (!File.Exists(txtInput.Text))
            {
                MessageBox.Show("Input file doesn't exists!", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            if (txtInput.Text == txtOutput.Text)
            {
                MessageBox.Show("Output file must be different from input file!", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            string exeName = "de4dot.exe";

            if (rbt64Bit.Checked)
            {
                exeName = "de4dot-x64.exe";
            }

            if (!File.Exists(exeName))
            {
                MessageBox.Show(exeName + " not found! de4dot must be in the same directory of this program.", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            string arguments = String.Format("-f \"{0}\" -o \"{1}\" {2}", txtInput.Text, txtOutput.Text, txtAdditional.Text);

// ReSharper disable InconsistentNaming
            Process de4dot = new Process
// ReSharper restore InconsistentNaming
            {
                StartInfo = new ProcessStartInfo
                {
                    FileName               = exeName,
                    Arguments              = arguments,
                    UseShellExecute        = false,
                    RedirectStandardOutput = true,
                    CreateNoWindow         = true
                }
            };

            try
            {
                txtOut.AppendText(String.Format("=== START NEW DEOBFUSCATION ==={0}{0}Command: {1}{0}Output:{0}", "\r\n", String.Format("{0} {1}", exeName, arguments)));
                de4dot.Start();
                while (!de4dot.StandardOutput.EndOfStream)
                {
                    txtOut.AppendText(String.Format("{0}{1}", de4dot.StandardOutput.ReadLine(), "\r\n"));
                }
            }
            catch (System.ComponentModel.Win32Exception)
            {
                MessageBox.Show("This program must be in the same folder of de4dot", "Err0r!", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {
                txtOut.AppendText(String.Format("{0}{0}=== END OF DEOBFUSCATION ==={0}{0}", "\r\n"));
            }
        }
Esempio n. 2
0
        private void btnWork_Click(object sender, EventArgs e)
        {
            if (!File.Exists(txtInput.Text))
            {
                MessageBox.Show("Input file doesn't exists!", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            if (txtInput.Text == txtOutput.Text)
            {
                MessageBox.Show("Output file must be different from input file!", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            string exeName = "de4dot.exe";
            if (rbt64Bit.Checked)
                exeName = "de4dot-x64.exe";

            if (!File.Exists(exeName))
            {
                MessageBox.Show(exeName + " not found! de4dot must be in the same directory of this program.", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            string arguments = String.Format("-f \"{0}\" -o \"{1}\" {2}", txtInput.Text, txtOutput.Text, txtAdditional.Text);

            // ReSharper disable InconsistentNaming
            Process de4dot = new Process
            // ReSharper restore InconsistentNaming
            {
                StartInfo = new ProcessStartInfo
                {
                    FileName = exeName,
                    Arguments = arguments,
                    UseShellExecute = false,
                    RedirectStandardOutput = true,
                    CreateNoWindow = true
                }
            };

            try
            {
                txtOut.AppendText(String.Format("=== START NEW DEOBFUSCATION ==={0}{0}Command: {1}{0}Output:{0}", "\r\n", String.Format("{0} {1}", exeName, arguments)));
                de4dot.Start();
                while (!de4dot.StandardOutput.EndOfStream)
                    txtOut.AppendText(String.Format("{0}{1}", de4dot.StandardOutput.ReadLine(), "\r\n"));
            }
            catch (System.ComponentModel.Win32Exception)
            {
                MessageBox.Show("This program must be in the same folder of de4dot", "Err0r!", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {
                txtOut.AppendText(String.Format("{0}{0}=== END OF DEOBFUSCATION ==={0}{0}", "\r\n"));
            }
        }