Skip to content
MPGHThe Dark Arts
/
RegisterLog in
Forum
Community
What's NewLatest posts across the boardTrendingHottest threads right nowSubscribedThreads you follow
Discussion
GeneralIntroductionsEntertainmentDebate FortFlaming & Rage
Board
News & AnnouncementsMPGH TimesSuggestions & HelpGiveaways
More Sections
Art & Graphic DesignProgrammingHackingCryptocurrency
Hacks & Cheats
Games
ValorantCS2 / CS:GOCall of Duty / WarzoneFortniteApex LegendsEscape From Tarkov
+14 moreLeague of LegendsGTA VMinecraftRustROTMGBattlefieldTroveBattleOnCombat ArmsCrossFireBlackshotRuneScapeDayZDead by Daylight
Resources
Game Hacking TutorialsReverse EngineeringGeneral Game HackingAnti-CheatConsole Game Hacking
Tools
Game Hacking ToolsTrainers & CheatsHack/Release NewsNew
Submit a release →Share your cheat, tool, or config with the community.
AINEW
AI Tools
General & DiscussionPrompt EngineeringLLM JailbreaksHotAI Agents & AutomationLocal / Open Models
AI × Gaming
AI Aimbots & VisionML Anti-CheatGame Bots & Automation
Create
AI Coding / Vibe CodingAI Art & MediaAI Voice & TTS
The AI frontier →Where game hacking meets modern machine learning. Jump in.
Marketplace
Buy & Sell
SellingBuyingTradingUser Services
Trust & Safety
Middleman LoungeMarketplace TalkVouch Copy Profiles
Money
Cryptocurrency TalkCurrency ExchangeWork & Job Offers
Start selling →List accounts, services, and goods. Use the middleman to trade safe.
MPGH The Dark Arts

A community for offensive security research, reverse engineering, and AI.

Community

ForumMarketplaceSearch

Account

RegisterLog in

Legal

Privacy PolicyForum RulesHelp & FAQ
© 2026 MPGH · All rights reserved.Built by the community, for the community. For educational purposes onlyContent is shared for security research and education — we don't condone illegal use. You're responsible for complying with applicable laws. Use at your own risk.
Home › Forum › Programming › Visual Basic Programming › Send Key/Mouse to crossfire?

QuestionSend Key/Mouse to crossfire?

Posts 1–15 of 21 · Page 1 of 2
HA
HackManster
Send Key/Mouse to crossfire?
It was suggested on another thread that you guys could help me with a little problem... please see

http://www.mpgh.net/forum/175-crossf...crossfire.html
#1 · 16y ago
Zoom
Zoom
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)
#2 · 16y ago
NextGen1
NextGen1
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. "
#3 · 16y ago
HA
HackManster
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?
#4 · 16y ago
Lolland
Lolland
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
#5 · 16y ago
guza44_44
guza44_44
yes they have completely stopped allowing sending keys on there, So here is your answer:

You Cannot do this, try a different game
#6 · 16y ago
Lolland
Lolland
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.
#7 · 16y ago
guza44_44
guza44_44
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
#8 · 16y ago
HA
HackManster
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....
#9 · 16y ago
NextGen1
NextGen1
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
#10 · 16y ago
HA
HackManster
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.
#11 · 16y ago
NextGen1
NextGen1
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,
#12 · 16y ago
HA
HackManster
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?
#13 · 16y ago
NextGen1
NextGen1
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
#14 · 16y ago
HA
HackManster
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!!
#15 · 16y ago
Posts 1–15 of 21 · Page 1 of 2

Post a Reply

Similar Threads

  • Send Key/Mouse movements to crossfire?By HackManster in CrossFire Hacks & Cheats
    16Last post 16y ago
  • How can i send Keys to CrossFireBy user44 in CrossFire Hack Coding / Programming / Source Code
    1Last post 15y ago
  • Sending Keys into Vindictus using autoit(While minimized)By azrith001 in Vindictus Help
    2Last post 15y ago
  • Sending keys to minimized windowsBy stupidname1 in Vindictus Help
    5Last post 15y ago
  • Help with sending keysBy Crash in C++/C Programming
    4Last post 16y ago

Tags for this Thread

None