Example #1
0
        /// <summary>
        /// Allows interfacing with an external process (memory manipulation, thread manipulation, etc.)
        /// </summary>
        public ProcessEdit()
        {
            mData = new List <PatternDataEntry>();
#if FASM_MANAGED
            Asm = new FasmManaged.ManagedFasm();
            if (mProcessOpen && mProcess != IntPtr.Zero)
            {
                Asm.SetProcessHandle(mProcess);
            }
#endif
        }
Example #2
0
        /// <summary>
        /// Opens a process and its main thread for interaction.
        /// </summary>
        /// <param name="ProcessId">Process Id of process with which we wish to interact.</param>
        /// <returns>Returns true on success, false on failure.</returns>
        public bool Open(int ProcessId)
        {
            if (ProcessId == 0)
            {
                return(false);
            }

            if (ProcessId == mProcessId)
            {
                return(true);
            }

            if (mProcessOpen)
            {
                this.CloseProcess();
            }

            if (SetDebugPrivileges)
            {
                System.Diagnostics.Process.EnterDebugMode();
            }

            mProcessOpen = (mProcess = ProcessHelper.OpenProcess(ProcessId)) != IntPtr.Zero;
            if (mProcessOpen)
            {
                mProcessId = ProcessId;
                mWnd       = WindowHelper.FindWindowByProcessId(ProcessId);

                mModules    = Process.GetProcessById(mProcessId).Modules;
                mMainModule = mModules[0];
#if FASM_MANAGED
                if (Asm == null)
                {
                    Asm = new FasmManaged.ManagedFasm(mProcess);
                }
                else
                {
                    Asm.SetProcessHandle(mProcess);
                }
#endif
            }

            return(mProcessOpen);
        }
Example #3
0
		/// <summary>
		/// Opens a process and its main thread for interaction.
		/// </summary>
		/// <param name="ProcessId">Process Id of process with which we wish to interact.</param>
		/// <returns>Returns true on success, false on failure.</returns>
		public bool Open(int ProcessId) {
			if (ProcessId == 0)
				return false;

			if (ProcessId == mProcessId)
				return true;

			if (mProcessOpen)
				this.CloseProcess();

			if (SetDebugPrivileges)
				System.Diagnostics.Process.EnterDebugMode();

			mProcessOpen = (mProcess = ProcessHelper.OpenProcess(ProcessId)) != IntPtr.Zero;
			if (mProcessOpen) {
				mProcessId = ProcessId;
				mWnd = WindowHelper.FindWindowByProcessId(ProcessId);

				mModules = Process.GetProcessById(mProcessId).Modules;
				mMainModule = mModules[0];
#if FASM_MANAGED
				if (Asm == null)
					Asm = new FasmManaged.ManagedFasm(mProcess);
				else
					Asm.SetProcessHandle(mProcess);
#endif
			}

			return mProcessOpen;
		}
Example #4
0
		/// <summary>
		/// Allows interfacing with an external process (memory manipulation, thread manipulation, etc.)
		/// </summary>
		public ProcessEdit() {
			mData = new List<PatternDataEntry>();
#if FASM_MANAGED
			Asm = new FasmManaged.ManagedFasm();
			if (mProcessOpen && mProcess != IntPtr.Zero)
				Asm.SetProcessHandle(mProcess);
#endif
		}