Page 1 of 2 12 LastLast
Results 1 to 15 of 21
  1. #1
    HackManster's Avatar
    Join Date
    Sep 2009
    Gender
    female
    Location
    Wherever there's a computer....
    Posts
    22
    Reputation
    10
    Thanks
    0
    My Mood
    Brooding

    Question Send Key/Mouse to crossfire?

    It was suggested on another thread that you guys could help me with a little problem... please see

    https://www.mpgh.net/forum/175-crossf...crossfire.html

  2. #2
    Zoom's Avatar
    Join Date
    May 2009
    Gender
    male
    Location
    Your going on my 24/7 DDoS hit list.
    Posts
    8,552
    Reputation
    127
    Thanks
    5,970
    My Mood
    Happy
    Are you using sendkeys.send?

    There are some diffrent ways you can do it

    I think crossfire have blocked sendkeys.send like nexon did on combat arms!

    If you want to do it the easy way ask WPS(warpathsin)
    -Rest in peace leechers-

    Your PM box is 100% full.

  3. #3
    NextGen1's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Not sure really.
    Posts
    6,312
    Reputation
    382
    Thanks
    3,019
    My Mood
    Amazed
    Are you actually using API....

    Crossfire may be one of those applications that block keystrokes

    If it is, Then you are in for a long road and lots of rewriting

    Which Includes Bytes , and user32 Keyb Events, Not a "easy task. "


     


     


     



    The Most complete application MPGH will ever offer - 68%




  4. #4
    HackManster's Avatar
    Join Date
    Sep 2009
    Gender
    female
    Location
    Wherever there's a computer....
    Posts
    22
    Reputation
    10
    Thanks
    0
    My Mood
    Brooding
    I found something promising in the SendInput API, which apparently will dump the input directly into the input stream.... Any of you guys heard anything about it?

  5. #5
    Lolland's Avatar
    Join Date
    Feb 2009
    Gender
    male
    Location
    Lolland!
    Posts
    3,156
    Reputation
    49
    Thanks
    868
    My Mood
    Inspired
    Quote Originally Posted by hejsan1 View Post
    If you want to do it the easy way ask WPS(warpathsin)
    He uses AutoIt, not VB, which is slightly easier to use than VB (IMO), but the GUI is hard to make.

    In AutoIt the basic send function is Send("Key to send in string").

    There are more complicated ways though, but I'd rather not release that code

  6. #6
    guza44_44's Avatar
    Join Date
    Oct 2008
    Gender
    male
    Posts
    433
    Reputation
    16
    Thanks
    310
    yes they have completely stopped allowing sending keys on there, So here is your answer:

    You Cannot do this, try a different game
    [IMG]https://i304.photobucke*****m/albums/nn168/guza44/sig-1.png[/IMG]

  7. #7
    Lolland's Avatar
    Join Date
    Feb 2009
    Gender
    male
    Location
    Lolland!
    Posts
    3,156
    Reputation
    49
    Thanks
    868
    My Mood
    Inspired
    Quote Originally Posted by guza44_44 View Post
    yes they have completely stopped allowing sending keys on there, So here is your answer:

    You Cannot do this, try a different game
    Yeah you can do it.

    It's called User events.

  8. #8
    guza44_44's Avatar
    Join Date
    Oct 2008
    Gender
    male
    Posts
    433
    Reputation
    16
    Thanks
    310
    Quote Originally Posted by lolland View Post
    Yeah you can do it.

    It's called User events.
    well i mean the regular send.keys ways, like a spammer, but ya adding diff code will make things work again
    [IMG]https://i304.photobucke*****m/albums/nn168/guza44/sig-1.png[/IMG]

  9. #9
    HackManster's Avatar
    Join Date
    Sep 2009
    Gender
    female
    Location
    Wherever there's a computer....
    Posts
    22
    Reputation
    10
    Thanks
    0
    My Mood
    Brooding
    Thanks all for your help, I am currently trying the Sendinput API which should drop it right into the input stream, but it keeps erroring out due to some small inconsistency....

  10. #10
    NextGen1's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Not sure really.
    Posts
    6,312
    Reputation
    382
    Thanks
    3,019
    My Mood
    Amazed
    Quote Originally Posted by HackManster View Post
    Thanks all for your help, I am currently trying the Sendinput API which should drop it right into the input stream, but it keeps erroring out due to some small inconsistency....
    Explain what method you are using, and what the inconsistency's are , and we can probably help


     


     


     



    The Most complete application MPGH will ever offer - 68%




  11. #11
    HackManster's Avatar
    Join Date
    Sep 2009
    Gender
    female
    Location
    Wherever there's a computer....
    Posts
    22
    Reputation
    10
    Thanks
    0
    My Mood
    Brooding
    Ok, here is my code.

    In the declarations:

    Code:
        Const KEYEVENTF_KEYUP = &H2
        Const INPUT_MOUSE = 0
        Const INPUT_KEYBOARD = 1
        Const INPUT_HARDWARE = 2
        Private Const MOUSEEVENTF_ABSOLUTE = &H8000 ' absolute move 32768
        Private Const MOUSEEVENTF_LEFTDOWN = &H2 ' left button down 2
        Private Const MOUSEEVENTF_LEFTUP = &H4 ' left button up 4
        Private Const MOUSEEVENTF_MIDDLEDOWN = &H20 ' middle button down 32
        Private Const MOUSEEVENTF_MIDDLEUP = &H40 ' middle button up 64
        Private Const MOUSEEVENTF_MOVE = &H1 ' mouse move 1
        Private Const MOUSEEVENTF_RIGHTDOWN = &H8 ' right button down 8
        Private Const MOUSEEVENTF_RIGHTUP = &H10 ' right button up 16
    
        Private Structure MOUSEINPUT
            Public dx As Long
            Public dy As Long
            Public mouseData As Long
            Public dwFlags As Long
            Public time As Long
            Public dwExtraInfo As Long
        End Structure
    
        Private Structure KEYBDINPUT
            Public wVk As Integer
            Public wScan As Integer
            Public dwFlags As Long
            Public time As Long
            Public dwExtraInfo As Long
        End Structure
    
        Private Structure HARDWAREINPUT
            Public uMsg As Long
            Public wParamL As Integer
            Public wParamH As Integer
        End Structure
    
        Private Structure GENERALINPUT
            Public dwType As Long
            Public xi() As Byte
        End Structure
    
        Private Declare Function SendInput Lib "user32.dll" (ByVal nInputs As Long, ByVal pInputs As GENERALINPUT, ByVal cbSize As Long) As Long
        Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (ByVal pDst, ByVal pSrc, ByVal ByteLen) 'I cant type these as Visul Studio doesn't support the Any type

    And the sub thats erroring

    Code:
       Sub ClickMouse(ByVal x As Long, ByVal y As Long)
            Dim GInput(0 To 1) As GENERALINPUT
            Dim MINPUT As New MOUSEINPUT
            MINPUT.dx = x
            MINPUT.dy = y
            '* 65535 / My.Computer.Screen.WorkingArea.Height * My.Computer.Screen.BitsPerPixel
            MINPUT.mouseData = 0
            MINPUT.dwFlags = MOUSEEVENTF_MOVE + MOUSEEVENTF_LEFTDOWN
            MINPUT.time = 0
            MINPUT.dwExtraInfo = 0
            GInput(0).dwType = INPUT_MOUSE
            CopyMemory(GInput(0).xi(0), MINPUT, Len(MINPUT)) ' errors here *********************************
    
            MINPUT.dx = x
            MINPUT.dy = y
            '* 65535 / My.Computer.Screen.WorkingArea.Height * My.Computer.Screen.BitsPerPixel
            MINPUT.mouseData = 0
            MINPUT.dwFlags = MOUSEEVENTF_LEFTUP + MOUSEEVENTF_MOVE
            MINPUT.time = 0
            MINPUT.dwExtraInfo = 0
            GInput(1).dwType = INPUT_MOUSE ' keyboard input
            CopyMemory(GInput(1).xi(0), MINPUT, Len(MINPUT))
            Call SendInput(2, GInput(0), Len(GInput(0)))
        End Sub
    It says "*********enceexeption: object reference not set to an instance of the object" I can get it to go away by dimentioning ginput(0).xi like so

    Code:
    Redim Ginput(0).xi(len(MINPUT))
    But then it tells me I'm trying to access protected memory.

  12. #12
    NextGen1's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Not sure really.
    Posts
    6,312
    Reputation
    382
    Thanks
    3,019
    My Mood
    Amazed
    This Code

    Code:
    Public Class Form1
        Const KEYEVENTF_KEYUP = &H2
        Const INPUT_MOUSE = 0
        Const INPUT_KEYBOARD = 1
        Const INPUT_HARDWARE = 2
        Private Const MOUSEEVENTF_ABSOLUTE = &H8000 ' absolute move 32768
        Private Const MOUSEEVENTF_LEFTDOWN = &H2 ' left button down 2
        Private Const MOUSEEVENTF_LEFTUP = &H4 ' left button up 4
        Private Const MOUSEEVENTF_MIDDLEDOWN = &H20 ' middle button down 32
        Private Const MOUSEEVENTF_MIDDLEUP = &H40 ' middle button up 64
        Private Const MOUSEEVENTF_MOVE = &H1 ' mouse move 1
        Private Const MOUSEEVENTF_RIGHTDOWN = &H8 ' right button down 8
        Private Const MOUSEEVENTF_RIGHTUP = &H10 ' right button up 16
    
        Private Structure MOUSEINPUT
            Public dx As Long
            Public dy As Long
            Public mouseData As Long
            Public dwFlags As Long
            Public time As Long
            Public dwExtraInfo As Long
        End Structure
    
        Private Structure KEYBDINPUT
            Public wVk As Integer
            Public wScan As Integer
            Public dwFlags As Long
            Public time As Long
            Public dwExtraInfo As Long
        End Structure
    
        Private Structure HARDWAREINPUT
            Public uMsg As Long
            Public wParamL As Integer
            Public wParamH As Integer
        End Structure
    
        Private Structure GENERALINPUT
            Public dwType As Long
            Public xi() As Byte
        End Structure
    
        Private Declare Function SendInput Lib "user32.dll" (ByVal nInputs As Long, ByVal pInputs As GENERALINPUT, ByVal cbSize As Long) As Long
        Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (ByVal pDst, ByVal pSrc, ByVal ByteLen) 'I cant type these as Visul Studio doesn't support the Any type
    
        Sub ClickMouse(ByVal x As Long, ByVal y As Long)
            Dim GInput(0 To 1) As GENERALINPUT
            Dim MINPUT As New MOUSEINPUT
            MINPUT.dx = x
            MINPUT.dy = y
            '* 65535 / My.Computer.Screen.WorkingArea.Height * My.Computer.Screen.BitsPerPixel
            MINPUT.mouseData = 0
            MINPUT.dwFlags = MOUSEEVENTF_MOVE + MOUSEEVENTF_LEFTDOWN
            MINPUT.time = 0
            MINPUT.dwExtraInfo = 0
            GInput(0).dwType = INPUT_MOUSE
            CopyMemory(GInput(0).xi(0), MINPUT, Len(MINPUT)) ' errors here *********************************
    
            MINPUT.dx = x
            MINPUT.dy = y
            '* 65535 / My.Computer.Screen.WorkingArea.Height * My.Computer.Screen.BitsPerPixel
            MINPUT.mouseData = 0
            MINPUT.dwFlags = MOUSEEVENTF_LEFTUP + MOUSEEVENTF_MOVE
            MINPUT.time = 0
            MINPUT.dwExtraInfo = 0
            GInput(1).dwType = INPUT_MOUSE ' keyboard input
            CopyMemory(GInput(1).xi(0), MINPUT, Len(MINPUT))
            Call SendInput(2, GInput(0), Len(GInput(0)))
        End Sub
    
    End Class
    Has 0 errors, Running or Debugging....

    What else is in your code, the null exception maybe coming from another part of the code,


     


     


     



    The Most complete application MPGH will ever offer - 68%




  13. #13
    HackManster's Avatar
    Join Date
    Sep 2009
    Gender
    female
    Location
    Wherever there's a computer....
    Posts
    22
    Reputation
    10
    Thanks
    0
    My Mood
    Brooding
    It can't be; theres no other code. I'll attach a screenshot of the error message. A point of interest; when I view the contents of Ginput(0), it says "Nothing" for xi. Maybe something with visual studio?

  14. #14
    NextGen1's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Not sure really.
    Posts
    6,312
    Reputation
    382
    Thanks
    3,019
    My Mood
    Amazed
    OS + SP(If any) + Framwork?

    If you have framework 2.0 update to 3.5 (not 4 beta)

    I know there was a issue with null reference exceptions that was resolved in 3.5 or with a hotfix in 2.0 , and as far as your users go, make sure network 3.5 is a prerequisite


     


     


     



    The Most complete application MPGH will ever offer - 68%




  15. #15
    HackManster's Avatar
    Join Date
    Sep 2009
    Gender
    female
    Location
    Wherever there's a computer....
    Posts
    22
    Reputation
    10
    Thanks
    0
    My Mood
    Brooding
    OK, i solved my earlier two problems... but now I've got another one!

    Code changes:

    Code:
        Public Structure MOUSEINPUT
            Public dx As Integer
            Public dy As Integer
            Public mouseData As Integer
            Public dwFlags As Integer
            Public dwtime As Integer
            Public dwExtraInfo As Integer
        End Structure
    
        Public Structure INPUT_TYPE
            Public dwType As Integer
            Public xi As MOUSEINPUT
        End Structure
    
    Private Declare Function SendInput Lib "user32.dll" (ByVal nInputs As Integer, ByRef pInputs As INPUT_TYPE, ByVal cbSize As Integer) As Integer

    Code:
        Sub ClickMouse(ByVal x As Long, ByVal y As Long)
            Dim inputEvents As INPUT_TYPE
    
            inputEvents.xi.dx = x
            inputEvents.xi.dy = y
            inputEvents.xi.mouseData = 0
            inputEvents.xi.dwFlags = MOUSEEVENTF_MOVE
            inputEvents.xi.dwtime = 0
            inputEvents.xi.dwExtraInfo = 0
            inputEvents.dwType = INPUT_MOUSE
            Dim s = System.Runtime.InteropServices.Marshal.SizeOf(GetType(INPUT_TYPE))
    
            If SendInput(1, inputEvents, s) = 0 Then MsgBox(System.Runtime.InteropServices.Marshal.GetLastWin32Error.ToString)
        End Sub
    The function call works fine, but the mouse just sits there. I figured out the API was returning 0 (the error code) and that I had to get the last win32error code. This told me it was code 87, or

    87 The parameter is incorrect. ERROR_INVALID_PARAMETER
    So now I'm back to square one!!

Page 1 of 2 12 LastLast

Similar Threads

  1. Sending keys to minimized windows
    By stupidname1 in forum Vindictus Help
    Replies: 5
    Last Post: 07-05-2011, 04:47 AM
  2. Sending Keys into Vindictus using autoit(While minimized)
    By azrith001 in forum Vindictus Help
    Replies: 2
    Last Post: 05-22-2011, 09:30 PM
  3. [Help] How can i send Keys to CrossFire
    By user44 in forum CrossFire Hack Coding / Programming / Source Code
    Replies: 1
    Last Post: 03-15-2011, 12:58 PM
  4. [Help] Send Key/Mouse movements to crossfire?
    By HackManster in forum CrossFire Hacks & Cheats
    Replies: 16
    Last Post: 01-28-2010, 03:11 PM
  5. Help with sending keys
    By Crash in forum C++/C Programming
    Replies: 4
    Last Post: 11-23-2009, 07:48 AM