示例#1
0
        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
        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 );
            }
        }