I know that there are standard WinApi tools for moving the mouse, but this does not fit a specific task. Is simulation possible at a lower level?

I will add specifics. There is a certain game in which mouse_event, SetCursorPos have no effect at all. So I wonder why? And are there any other ways to achieve the goal. Naturally, physical mouse input works.

  • 2
    Show me something, I do not know what. Do me so, I do not know how ... - Kromster
  • one
    On the lower one, of course, write the driver, let him introduce himself to the system as a mouse driver ... - Mike
  • And what effect do you want, that even it can not be achieved on WinAPI? There is a suspicion that if WinAPI could not do this, then nothing else can. - VladD
  • @Zoom: It makes sense to add to the question. - VladD
  • Once upon a time, I did such a focus through interruptions on the asm, but I'm afraid that even if I remember how it is, this code will instantly cut either UAC or antivirus, because The code was from the category of hacks, when you can not but really want it. As a hint: look in the memory addresses of input-output registers for the mouse and work with them directly, if the system allows. On Sharp it will not work, you need a language with a compilation into native code, direct memory access and support for assembler inserts. - rdorn

1 answer 1

here on the assembly. will it come down? more low i don't know

`

format PE GUI 4.0 entry start include 'win32a.inc' ;--------------------------------------------- section '.code' code readable executable start: invoke GetModuleHandle,0 ;invoke DialogBoxParam,eax,37,HWND_DESKTOP,DialogProc,0 invoke ExitProcess,0 ;--------------------------------------------- proc DialogProc hwnddlg,msg,wparam,lparam push ebx esi edi cmp [msg],WM_INITDIALOG je .wminitdialog cmp [msg],WM_COMMAND je .wmcommand cmp [msg],WM_CLOSE je .wmclose cmp [msg],WM_TIMER je .wmtimer xor eax,eax jmp .finish .wminitdialog: ; β€ΡΡ‚Π°Π½ΠΎΠ²ΠΈΡ‚ΡŒ Ρ‚Π°ΠΉΠΌΠ΅Ρ€ Π½Π° срабатываниС ΠΊΠ°ΠΆΠ΄ΡƒΡŽ сСкунду invoke SetTimer,[hwnddlg],1,100,NULL jmp .processed .wmcommand: cmp [wparam],BN_CLICKED shl 16 + IDCANCEL je .wmclose jmp .processed .wmtimer: ; Ρ•Π΅Ρ€Π΅ΠΌΠ΅ΡΡ‚ΠΈΡ‚ΡŒ ΠΌΡ‹ΡˆΠΊΡƒ Π½Π° 1 ΠΌΠΈΠΊΠΊΠΈ ΠΎΡ‚Π½ΠΎΡΠΈΡ‚Π΅Π»ΡŒΠ½ΠΎ Π΅Π΅ Ρ‚Π΅ΠΊΡƒΡ‰Π΅ΠΉ ΠΏΠΎΠ·ΠΈΡ†ΠΈΠΈ invoke mouse_event,MOUSEEVENTF_MOVE,0,0,0,0 jmp .processed .wmclose: invoke EndDialog,[hwnddlg],0 .processed: mov eax,1 .finish: pop edi esi ebx ret endp ;--------------------------------------------- section '.idata' import data readable writeable library kernel32,'KERNEL32.DLL',\ user32,'USER32.DLL' include 'apia\kernel32.inc' include 'apia\user32.inc' ;--------------------------------------------- section '.rsrc' resource data readable directory RT_DIALOG,dialogs resource dialogs,\ 37,LANG_ENGLISH+SUBLANG_DEFAULT,demonstration dialog demonstration,'Preventing Windows to Sleeping Demo #1',0,0,190,55,WS_CAPTION+WS_SYSMENU+DS_CENTER+DS_SYSMODAL dialogitem 'BUTTON','',-1, 2, -1, 185, 35,WS_VISIBLE+BS_GROUPBOX dialogitem 'STATIC','No Screensaver, no Sleeping ;)',-1,6,15,177,13,WS_VISIBLE+ES_CENTER dialogitem 'BUTTON','Exit',IDCANCEL,135,37,50,15,WS_VISIBLE+WS_TABSTOP+BS_PUSHBUTTON enddialog 

`

  • 2
    This is the same WinAPI. - VladD