Esempio n. 1
0
        public CreateDetails GetDetails()
        {
            CreateDetails details = null;

            if (ShowDialog() == DialogResult.OK)
            {
                ProcessStartInfo info = new ProcessStartInfo(filenameBox.Text, argsBox.Text);
                info.WorkingDirectory = startInBox.Text;

                details = new CreateDetails(info);
            }

            return details;
        }
Esempio n. 2
0
        public CreateDetails GetDetails()
        {
            CreateDetails details = null;

            if (ShowDialog() == DialogResult.OK)
            {
                ProcessStartInfo info = new ProcessStartInfo(filenameBox.Text, argsBox.Text);
                info.WorkingDirectory = startInBox.Text;

                details = new CreateDetails(info);
            }

            return(details);
        }
Esempio n. 3
0
        private int DoCreation(CreateDetails createDetails)
        {
            progress.ProgressUpdate("Creating process and injecting logging agent", 100);

            ProcessStartInfo psi = createDetails.Info;
            int processId;

            RemoteHooking.CreateAndInject(psi.FileName,
                                          (psi.Arguments != String.Empty) ? psi.Arguments : null,
                                          (psi.WorkingDirectory != String.Empty) ? psi.WorkingDirectory : null,
                                          0, AGENT_DLL, AGENT_DLL, out processId,
                                          serverChannelName, details.SoftwallRules);

            return(processId);
        }
Esempio n. 4
0
        private void DoStartCapture()
        {
            try
            {
                PrepareCapture();

                int[] processIds;

                if (details is CreateDetails)
                {
                    CreateDetails createDetails = details as CreateDetails;
                    int           processId     = DoCreation(createDetails);
                    processIds = new int[1] {
                        processId
                    };
                }
                else if (details is AttachDetails)
                {
                    AttachDetails attachDetails = details as AttachDetails;
                    DoInjection(attachDetails);
                    processIds = attachDetails.ProcessIds;
                }
                else
                {
                    throw new NotImplementedException();
                }

                if (WaitForAllClientsToPingUs(processIds))
                {
                    progress.OperationComplete();
                }
                else
                {
                    progress.OperationFailed("Capture aborted.");
                }
            }
            catch (Exception e)
            {
                progress.OperationFailed(e.Message);
                UnprepareCapture(false);
            }

            progress          = null;
            startWorkerThread = null;
        }
Esempio n. 5
0
        private int DoCreation(CreateDetails createDetails)
        {
            progress.ProgressUpdate("Creating process and injecting logging agent", 100);

            ProcessStartInfo psi = createDetails.Info;
            int processId;
            RemoteHooking.CreateAndInject(psi.FileName,
                (psi.Arguments != String.Empty) ? psi.Arguments : null,
                (psi.WorkingDirectory != String.Empty) ? psi.WorkingDirectory : null,
                0, AGENT_DLL, AGENT_DLL, out processId,
                serverChannelName, details.SoftwallRules);

            return processId;
        }