_WinAPI_PostMessage prevented by anti bot detection

08/12/2023 17:42 Finch#1
Recently I'm working on simple bot for a 5095 conquer in AutoIt3.


I noticed that I'm being jail banned for using the bot when using postMessage() and If I use MouseClick() it is not detected. I was sending them to exactly the same position and timing inbetween clicks was identical.

I found some information about `LLMHF_LOWER_IL_INJECTED` and `LLMHF_INJECTED` in `_WinAPI_setWindowsHookEx`, but I have no idea how to modify this values for PostMessage.

Here is the code:

Code:
; bot ban
    _WinAPI_PostMessage($hWndControl, $WM_LBUTTONDOWN, $MK_LBUTTON, $lParam)
    Sleep($currentSleep) ; randomized time
    _WinAPI_PostMessage($hWndControl, $WM_LBUTTONUP, 0, $lParam)

;no bot ban
    MouseClick($MOUSE_CLICK_LEFT, $xCordClick, $yCordClick)
What I need to do to send a PostMessage that is indistinguishable from real mouse click?
Maybe there is some other way around to avoid being sent to bot jail?
02/24/2024 05:17 Touch Of Dead#2
Hey,

I don't know if you figured it out but here's how I remove the Injected flag from my spoofed keys.

At the top of my keyboard hook I have this to reset the flag on keydown event:

Code:
Case $WM_KEYDOWN, $WM_SYSKEYDOWN
            If BitAND($flags, $LLKHF_INJECTED) Then
                $flags = BitAND($flags, BitNOT($LLKHF_INJECTED))
            EndIf