示例#1
0
        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);
        }
示例#2
0
 public static bool IsKeyPressed(uint keys)
 {
     return(0 != (NativeImport.GetAsyncKeyState((int)keys) & 0x8000));
 }
示例#3
0
 public static bool IsKeyPressed(System.Windows.Forms.Keys keys)
 {
     return(0 != (NativeImport.GetAsyncKeyState((int)keys) & 0x8000));
 }
示例#4
0
 public static bool IsGameOnDisplay()
 {
     //TODO: HWND Locking up on League's HWND
     return(NativeImport.GetActiveWindowTitle() == "League of Legends (TM) Client");
 }