コード例 #1
0
ファイル: FormMain.cs プロジェクト: domeops/hookme-wsasendto
        private void attachToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FormSelectProgram fSelecProgram = new FormSelectProgram();

            fSelecProgram.StartPosition = FormStartPosition.CenterParent;
            fSelecProgram.ShowDialog();

            if (fSelecProgram.returnedValue == null)
            {
                return;
            }

            NktProcess process          = fSelecProgram.returnedValue;
            bool       hookedSuccessful = Program.hook.HookProcess(process);

            if (hookedSuccessful)
            {
                FormInfo fInfo = new FormInfo("Hook successful", 0, FormInfo.IconType.OK);
                fInfo.StartPosition = FormStartPosition.CenterParent;
                fInfo.Show(Program.formMain);

                Program.LogThis("Core", "Process " + process.Name + " hooked successfully");
            }
            else
            {
                FormInfo fInfo = new FormInfo("Error hooking", 0, FormInfo.IconType.Error);
                fInfo.StartPosition = FormStartPosition.CenterParent;
                fInfo.Show(Program.formMain);

                Program.LogThis("Core", "Error hooking " + process.Name);
            }
        }
コード例 #2
0
ファイル: FormMain.cs プロジェクト: CaineQT/hookme
        private void attachToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FormSelectProgram fSelecProgram = new FormSelectProgram();
            fSelecProgram.StartPosition = FormStartPosition.CenterParent;
            fSelecProgram.ShowDialog();

            if (fSelecProgram.returnedValue == null)
                return;

            NktProcess process = fSelecProgram.returnedValue;
            bool hookedSuccessful = Program.hook.HookProcess(process);

            if (hookedSuccessful)
            {
                FormInfo fInfo = new FormInfo("Hook successful", 0, FormInfo.IconType.OK);
                fInfo.StartPosition = FormStartPosition.CenterParent;
                fInfo.Show(Program.formMain);

                Program.LogThis("Core", "Process " + process.Name + " hooked successfully");
            }
            else
            {
                FormInfo fInfo = new FormInfo("Error hooking", 0, FormInfo.IconType.Error);
                fInfo.StartPosition = FormStartPosition.CenterParent;
                fInfo.Show(Program.formMain);

                Program.LogThis("Core", "Error hooking " + process.Name );
            }
        }