public static T Read <T>(int Address) { var Size = Marshal.SizeOf <T>(); var Buffer = new byte[Size]; bool Result = NativeImport.ReadProcessMemory(Process.GetProcessesByName("League of Legends").FirstOrDefault().Handle, (IntPtr)Address, Buffer, Size, out var lpRead); var Ptr = Marshal.AllocHGlobal(Size); Marshal.Copy(Buffer, 0, Ptr, Size); var Struct = Marshal.PtrToStructure <T>(Ptr); Marshal.FreeHGlobal(Ptr); return(Struct); }
public static bool IsKeyPressed(uint keys) { return(0 != (NativeImport.GetAsyncKeyState((int)keys) & 0x8000)); }
public static bool IsKeyPressed(System.Windows.Forms.Keys keys) { return(0 != (NativeImport.GetAsyncKeyState((int)keys) & 0x8000)); }
public static bool IsGameOnDisplay() { //TODO: HWND Locking up on League's HWND return(NativeImport.GetActiveWindowTitle() == "League of Legends (TM) Client"); }