OpenProcess() private method

private OpenProcess ( UInt32 dwDesiredAccess, Int32 bInheritHandle, Int32 dwProcessId ) : IntPtr
dwDesiredAccess System.UInt32
bInheritHandle System.Int32
dwProcessId System.Int32
return System.IntPtr
        public bool OpenGameProcess(int procID)
        {
            bool flag = procID != 0;
            bool result;

            if (flag)
            {
                this.procs = Process.GetProcessById(procID);
                bool flag2 = !this.procs.Responding;
                if (flag2)
                {
                    result = false;
                }
                else
                {
                    Mem.pHandle     = Mem.OpenProcess(2035711u, 1, procID);
                    this.mainModule = this.procs.MainModule;
                    this.getModules();
                    result = true;
                }
            }
            else
            {
                result = false;
            }
            return(result);
        }
Beispiel #2
0
        private void setButton_Click(object sender, EventArgs e)
        {
            string address     = addressTextBox.Text;
            string value       = valueTextBox.Text;
            string valuetype   = typeTextBox.Text;
            string processname = processNameTextBox.Text;

            memory.OpenProcess(Process.GetProcessesByName(processname).FirstOrDefault().Id);
            memory.WriteMemory(address, valuetype, value);
        }