public void closeProcess() { Mem.CloseHandle(Mem.pHandle); }
private UIntPtr getCode(string name, string path, int size = 4) { string text = this.LoadCode(name, path); bool flag = text == ""; UIntPtr result; if (flag) { result = UIntPtr.Zero; } else { string text2 = text; bool flag2 = text.Contains("+"); if (flag2) { text2 = text.Substring(text.IndexOf('+') + 1); } byte[] array = new byte[size]; bool flag3 = text2.Contains(','); if (flag3) { List <int> list = new List <int>(); string[] array2 = text2.Split(new char[] { ',' }); string[] array3 = array2; for (int i = 0; i < array3.Length; i++) { string value = array3[i]; list.Add(Convert.ToInt32(value, 16)); } int[] array4 = list.ToArray(); bool flag4 = text.Contains("base") || text.Contains("main"); if (flag4) { Mem.ReadProcessMemory(Mem.pHandle, (UIntPtr)((ulong)((long)((int)this.mainModule.BaseAddress + array4[0]))), array, (UIntPtr)((ulong)((long)size)), IntPtr.Zero); } else { bool flag5 = !text.Contains("base") && !text.Contains("main") && text.Contains("+"); if (flag5) { string[] array5 = text.Split(new char[] { '+' }); IntPtr value2 = this.modules[array5[0]]; Mem.ReadProcessMemory(Mem.pHandle, (UIntPtr)((ulong)((long)((int)value2 + array4[0]))), array, (UIntPtr)((ulong)((long)size)), IntPtr.Zero); } else { Mem.ReadProcessMemory(Mem.pHandle, (UIntPtr)((ulong)((long)array4[0])), array, (UIntPtr)((ulong)((long)size)), IntPtr.Zero); } } uint num = BitConverter.ToUInt32(array, 0); UIntPtr uIntPtr = (UIntPtr)0uL; for (int j = 1; j < array4.Length; j++) { uIntPtr = new UIntPtr(num + Convert.ToUInt32(array4[j])); Mem.ReadProcessMemory(Mem.pHandle, uIntPtr, array, (UIntPtr)((ulong)((long)size)), IntPtr.Zero); num = BitConverter.ToUInt32(array, 0); } result = uIntPtr; } else { int num2 = Convert.ToInt32(text2, 16); bool flag6 = text.Contains("base") || text.Contains("main"); if (flag6) { Mem.ReadProcessMemory(Mem.pHandle, (UIntPtr)((ulong)((long)((int)this.mainModule.BaseAddress + num2))), array, (UIntPtr)((ulong)((long)size)), IntPtr.Zero); } else { bool flag7 = !text.Contains("base") && !text.Contains("main") && text.Contains("+"); if (flag7) { string[] array6 = text.Split(new char[] { '+' }); IntPtr value3 = this.modules[array6[0]]; Mem.ReadProcessMemory(Mem.pHandle, (UIntPtr)((ulong)((long)((int)value3 + num2))), array, (UIntPtr)((ulong)((long)size)), IntPtr.Zero); } else { Mem.ReadProcessMemory(Mem.pHandle, (UIntPtr)((ulong)((long)num2)), array, (UIntPtr)((ulong)((long)size)), IntPtr.Zero); } } uint value4 = BitConverter.ToUInt32(array, 0); UIntPtr uIntPtr2 = new UIntPtr(value4); value4 = BitConverter.ToUInt32(array, 0); result = uIntPtr2; } } return(result); }