Jump to content

TASM32 Keybd_Event

- - - - -

  • Please log in to reply
5 replies to this topic

#1
JMC31337

JMC31337

    Learning Programmer

  • Members
  • PipPipPip
  • 32 posts
quick and dirty way to send keys using MSDN Virtual Keycodes

i'm not gonna post the entire TASM32 .code setups, just how it works







VK_WIN equ 5Bh ; THIS IS THE WINDOWS KEY
VK_M equ 4Dh ;THIS IS THE M KEY

push 0
push 0
push 0
push VK_WIN ;WINDOWS keypress
call keybd_event ;call OBSOLETE API
push 0
push 0
push 0
push VK_M ;M KEYPRESS
call keybd_event ;call OBSOLETE API

if placed into your asm code will MINIMIZE ALL WINDOWS that can be minimized
check out the keybd_event Function thru the MSDN for further info

sendinput wouldnt work with tasm32 via a simple call SendInput, so you'll have to load user32.dll then the sendinput function thru another means... keybd_event is quicker
"Your Life Is Your Crime, It's Punishment Time"

#2
dargueta

dargueta

    Writes binary right handed and hex left handed

  • Moderators
  • 4,705 posts
  • Programming Language:C, Java, C++, PHP, Python, Perl, Assembly, Bash, Others
  • Learning:JavaScript
Interesting... Would that be push dword 0 or push word 0 ?
By the way, for future reference, we have a "Classes and Code Snippets" forum for things like this.
sudo rm -rf /

#3
JMC31337

JMC31337

    Learning Programmer

  • Members
  • PipPipPip
  • 32 posts

dargueta said:

Interesting... Would that be push dword 0 or push word 0 ?
By the way, for future reference, we have a "Classes and Code Snippets" forum for things like this.

has to be dword...

yu can test this out by changing the push 0 to
push dword 0 across the board then try it with push word 0 you'll notice in this example if its just plain dword 0 it still minimizes, but if its push word 0 it wont minimize

and thnx for the code snippets link... my bad...
"Your Life Is Your Crime, It's Punishment Time"

#4
dargueta

dargueta

    Writes binary right handed and hex left handed

  • Moderators
  • 4,705 posts
  • Programming Language:C, Java, C++, PHP, Python, Perl, Assembly, Bash, Others
  • Learning:JavaScript
No problem, I did this too when I was starting out. :) I'm going to see if I can move this.
sudo rm -rf /

#5
marjie

marjie

    Newbie

  • Members
  • Pip
  • 6 posts
great respon

#6
Guest_blairgo_*

Guest_blairgo_*
  • Guests
So interesting, i like it




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users