Ejemplo n.º 1
0
        private void button2_Click(object sender, EventArgs e)
        {
            if (tbDllPath.Text == string.Empty)
                return;
            if(!File.Exists(tbDllPath.Text))
            {
                MessageBox.Show("Invalid File");
                return;
            }

            using (formLoadProcess proc = new formLoadProcess(false))
            {
                if(proc.ShowDialog() == DialogResult.OK)
                {
                    string message = string.Empty;
                    bool success = false;

                    IntPtr handle = DllInjector.Inject(proc.SelectedProcessID, tbDllPath.Text, out success, cbWaitForHandle.Checked);

                    if(success)
                    {
                        message = "Injected Successfully.";
                        if (handle != IntPtr.Zero)
                            message += string.Format("{0}Dll Handle: 0x{1:x2}", Environment.NewLine, handle.ToInt32());
                    }
                    else
                    {
                        message = "Failed to inejct dll.";
                    }

                    MessageBox.Show(message);
                    this.DialogResult = DialogResult.OK;
                }
            }
        }
Ejemplo n.º 2
0
 private void processToolStripMenuItem1_Click(object sender, EventArgs e)
 {
     using (formLoadProcess procLoadForm = new formLoadProcess())
     {
         if (procLoadForm.ShowDialog() == DialogResult.OK)
         {
             LoadedPE              = PELoader.Load(procLoadForm.SelectedProcessID, procLoadForm.SelectedModule);
             LoadedPE.PESource     = string.Format("Process: {0}", procLoadForm.ProcessName);
             lbCurrentSection.Text = "Overview";
             PopulateInfo(LoadedPE.Overview, false);
         }
     }
 }
Ejemplo n.º 3
0
        private void button1_Click(object sender, EventArgs e)
        {
            lbProcessList.Items.Clear();
            lvFileList.Items.Clear();
            ProcessModule moduleToScan = null;
            int           pid          = 0;

            using (formLoadProcess procLoadForm = new formLoadProcess())
            {
                if (procLoadForm.ShowDialog() != DialogResult.OK)
                {
                    return;
                }
                this.Text    = string.Format("{0} ({1})", WindowText, procLoadForm.ProcessName);
                moduleToScan = procLoadForm.SelectedModule;
                pid          = procLoadForm.SelectedProcessID;
            }

            string       modulePath     = moduleToScan.FileName;
            PEInfomation procPE         = PELoader.Load(pid, moduleToScan);
            PEInfomation filePE         = PELoader.Load(modulePath);
            int          unmachedValues = 0;

            unmachedValues += ScanType <IMAGE_FILE_HEADER>(procPE.FileHeader, filePE.FileHeader, "File Header");
            unmachedValues += ScanType <IMAGE_OPTIONAL_HEADER32>(procPE.OptionalHeader32, filePE.OptionalHeader32, "Optional Header", "ImageBase");
            int sectionAmmount = Math.Min(Convert.ToInt32(procPE.Overview.NumberOfSections), Convert.ToInt32(filePE.Overview.NumberOfSections));

            for (int i = 0; i < sectionAmmount; i++)
            {
                unmachedValues += ScanType <IMAGE_SECTION_HEADER>(procPE.Sections[i], filePE.Sections[i], string.Format("Section {0}", i + 1));
            }

            Color  tColor      = Color.Green;
            string warningText = "No RunPE Found (0 Unmached values)";

            if (unmachedValues >= 1)
            {
                tColor      = Color.DarkTurquoise;
                warningText = string.Format("Possable RunPe ({0} Unmaching values)", unmachedValues);
            }

            if (unmachedValues > 4)
            {
                tColor      = Color.Red;
                warningText = string.Format("RunPe Found ({0} Unmaching values)", unmachedValues);
            }

            lbRunpeStatus.Text      = warningText;
            lbRunpeStatus.ForeColor = tColor;
        }
Ejemplo n.º 4
0
 private void unloadToolStripMenuItem_Click(object sender, EventArgs e)
 {
     using (formLoadProcess procLoadForm = new formLoadProcess(false))
     {
         if (procLoadForm.ShowDialog() == DialogResult.OK)
         {
             using (formModuleView dlls = new formModuleView(procLoadForm.SelectedProcessID, procLoadForm.ProcessName))
             {
                 if (dlls.ShowDialog() == DialogResult.Yes)
                 {
                     LoadedPE              = dlls.LoadInfomation;
                     LoadedPE.PESource     = string.Format("Process: {0}", procLoadForm.ProcessName);
                     lbCurrentSection.Text = "Overview";
                     PopulateInfo(LoadedPE.Overview, false);
                 }
             }
         }
     }
 }
Ejemplo n.º 5
0
        private void button2_Click(object sender, EventArgs e)
        {
            if (tbDllPath.Text == string.Empty)
            {
                return;
            }
            if (!File.Exists(tbDllPath.Text))
            {
                MessageBox.Show("Invalid File");
                return;
            }

            using (formLoadProcess proc = new formLoadProcess(false))
            {
                if (proc.ShowDialog() == DialogResult.OK)
                {
                    string message = string.Empty;
                    bool   success = false;

                    IntPtr handle = DllInjector.Inject(proc.SelectedProcessID, tbDllPath.Text, out success, cbWaitForHandle.Checked);

                    if (success)
                    {
                        message = "Injected Successfully.";
                        if (handle != IntPtr.Zero)
                        {
                            message += string.Format("{0}Dll Handle: 0x{1:x2}", Environment.NewLine, handle.ToInt32());
                        }
                    }
                    else
                    {
                        message = "Failed to inejct dll.";
                    }

                    MessageBox.Show(message);
                    this.DialogResult = DialogResult.OK;
                }
            }
        }