Exemplo n.º 1
0
        // Token: 0x0600009C RID: 156 RVA: 0x00029BAC File Offset: 0x00027DAC
        public static void ConnectToHID(ref Form targetForm)
        {
            int fwinHandle = targetForm.Handle.ToInt32();

            HIDDLLInterface.FWinHandle = fwinHandle;
            fwinHandle = ((((HIDDLLInterface.hidConnect(HIDDLLInterface.FWinHandle) == true) ? true : false)) ? 0 : 1);
            HIDDLLInterface.FPrevWinProc = HIDDLLInterface.DelegateSetWindowLong(HIDDLLInterface.FWinHandle, -4, HIDDLLInterface.Ref_WinProc);
            HIDDLLInterface.HostForm     = targetForm;
        }
Exemplo n.º 2
0
 public void Press(KeyBotEnum key)
 {
     if (this.CONNECTED)
     {
         ElapsedTimeAction(() =>
         {
             _bufferOut[2] = Convert.ToByte((int)key);
             HIDDLLInterface.hidWriteEx(5638, 6536, ref _bufferOut[0]);
         });
     }
 }
Exemplo n.º 3
0
 public void ReleaseAll()
 {
     if (this.CONNECTED)
     {
         ElapsedTimeAction(() =>
         {
             _bufferOut[3] = 0;
             _bufferOut[2] = Convert.ToByte((int)KeyBotEnum.NULL);
             HIDDLLInterface.hidWriteEx(5638, 6536, ref _bufferOut[0]);
         });
     }
 }
Exemplo n.º 4
0
 public void PressAndRelease(KeyBotEnum key1, KeyBotEnum key2, KeyBotEnum key3)
 {
     if (this.CONNECTED)
     {
         ElapsedTimeAction(() =>
         {
             _bufferOut[3] = 0;
             _bufferOut[2] = Convert.ToByte((int)key1);
             HIDDLLInterface.hidWriteEx(5638, 6536, ref _bufferOut[0]);
             _bufferOut[2] = Convert.ToByte((int)key2);
             HIDDLLInterface.hidWriteEx(5638, 6536, ref _bufferOut[0]);
             _bufferOut[2] = Convert.ToByte((int)key3);
             HIDDLLInterface.hidWriteEx(5638, 6536, ref _bufferOut[0]);
             _bufferOut[2] = Convert.ToByte(KeyBotEnum.NULL);
             HIDDLLInterface.hidWriteEx(5638, 6536, ref _bufferOut[0]);
         });
     }
 }
Exemplo n.º 5
0
        public void Press(KeyBotEnum key, int repeat)
        {
            if (this.CONNECTED)
            {
                ElapsedTimeAction(() =>
                {
                    if (repeat > Byte.MaxValue)
                    {
                        repeat = Byte.MaxValue - 1;
                    }

                    _bufferOut[3] = Convert.ToByte(repeat);

                    _bufferOut[2] = Convert.ToByte((int)key);
                    HIDDLLInterface.hidWriteEx(5638, 6536, ref _bufferOut[0]);
                });
            }
        }
Exemplo n.º 6
0
        // Token: 0x0600009E RID: 158 RVA: 0x00029C1C File Offset: 0x00027E1C
        private static int WinProc(int pHWnd, int pMsg, int wParam, int lParam)
        {
            if (decimal.Compare(new decimal(pMsg), 32968m) == 0)
            {
                switch (wParam)
                {
                case 1:
                {
                    object   hostForm   = HIDDLLInterface.HostForm;
                    Type     type       = null;
                    string   memberName = "OnPlugged";
                    object[] array      = new object[]
                    {
                        lParam
                    };
                    object[] arguments     = array;
                    string[] argumentNames = null;
                    Type[]   typeArguments = null;
                    bool[]   array2        = new bool[]
                    {
                        true
                    };
                    NewLateBinding.LateCall(hostForm, type, memberName, arguments, argumentNames, typeArguments, array2, true);
                    if (array2[0])
                    {
                        lParam = (int)Conversions.ChangeType(RuntimeHelpers.GetObjectValue(array[0]), typeof(int));
                    }
                    break;
                }

                case 2:
                {
                    object   hostForm2   = HIDDLLInterface.HostForm;
                    Type     type2       = null;
                    string   memberName2 = "OnUnplugged";
                    object[] array3      = new object[]
                    {
                        lParam
                    };
                    object[] arguments2     = array3;
                    string[] argumentNames2 = null;
                    Type[]   typeArguments2 = null;
                    bool[]   array2         = new bool[]
                    {
                        true
                    };
                    NewLateBinding.LateCall(hostForm2, type2, memberName2, arguments2, argumentNames2, typeArguments2, array2, true);
                    if (array2[0])
                    {
                        lParam = (int)Conversions.ChangeType(RuntimeHelpers.GetObjectValue(array3[0]), typeof(int));
                    }
                    break;
                }

                case 3:
                    NewLateBinding.LateCall(HIDDLLInterface.HostForm, null, "OnChanged", new object[0], null, null, null, true);
                    break;

                case 4:
                {
                    object   hostForm3   = HIDDLLInterface.HostForm;
                    Type     type3       = null;
                    string   memberName3 = "OnRead";
                    object[] array3      = new object[]
                    {
                        lParam
                    };
                    object[] arguments3     = array3;
                    string[] argumentNames3 = null;
                    Type[]   typeArguments3 = null;
                    bool[]   array2         = new bool[]
                    {
                        true
                    };
                    NewLateBinding.LateCall(hostForm3, type3, memberName3, arguments3, argumentNames3, typeArguments3, array2, true);
                    if (array2[0])
                    {
                        lParam = (int)Conversions.ChangeType(RuntimeHelpers.GetObjectValue(array3[0]), typeof(int));
                    }
                    break;
                }
                }
            }
            return(HIDDLLInterface.CallWindowProc(HIDDLLInterface.FPrevWinProc, pHWnd, pMsg, wParam, lParam));
        }
Exemplo n.º 7
0
 // Token: 0x0600009D RID: 157 RVA: 0x00029BFC File Offset: 0x00027DFC
 public static bool DisconnectFromHID()
 {
     HIDDLLInterface.SetWindowLong(HIDDLLInterface.FWinHandle, -4, HIDDLLInterface.FPrevWinProc);
     return(true);
 }