예제 #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");
 }