public Memory(Offsets offs, int pId) { try { offsets = offs; Process = Process.GetProcessById(pId); AddressOfProcess = Process.MainModule.BaseAddress.ToInt64(); procHandle = WinApi.OpenProcess(Process, ProcessAccessFlags.All); modules = new Dictionary <string, int>(); } catch (Win32Exception ex) { throw new Exception("You should run program as an administrator", ex); } }
private void Open() { procHandle = WinApi.OpenProcess(Process, ProcessAccessFlags.All); }