flat assembler
Message board for the users of flat assembler.

Index > Windows > Hooooooks

Author
Thread Post new topic Reply to topic
WhiteDwarf



Joined: 25 Dec 2003
Posts: 17
WhiteDwarf 19 Jan 2004, 21:09
Where is WindowsHookEx? lol like in the resources where do u define it, it said it can find it in KERNEL32

My goal is to create a Hook that'll read all keys from the keyboard, is their a better way to do it than what im trying? like....a thread or systemwide which one would be best


i tried

Code:
format PE GUI 4.0
entry start
include '%fasminc%\win32a.inc'
section '.data' data readable writeable
  mainhwnd dd ?
  hInstance dd ?
section '.code' code readable executable
  start:
  invoke SetWindowsHookEx,WH_KEYBOARD,NULL,hInstance,NULL

section '.idata' import data readable writeable

  library kernel,'KERNEL32.DLL',\
          user,'USER32.DLL'

  import kernel,\
         GetModuleHandle,'GetModuleHandleA',\
         ExitProcess,'ExitProcess',\
         SetWindowsHookEx,'SetWindowsHookEx'

  import user,\
         TranslateMessage,'TranslateMessage',\
         DispatchMessage,'DispatchMessageA',\
         PostQuitMessage,'PostQuitMessage'
                                                                     
    


Thankkkkkkkyou
Post 19 Jan 2004, 21:09
View user's profile Send private message Reply with quote
silkodyssey



Joined: 02 Oct 2003
Posts: 198
Location: St.Vincent & the Grenadines
silkodyssey 19 Jan 2004, 23:49
WhiteDwarf,

SetWindowsHookEx is located in user32.dll. Sorry for the misinformation Very Happy

_________________
silkodyssey
Post 19 Jan 2004, 23:49
View user's profile Send private message MSN Messenger Reply with quote
silkodyssey



Joined: 02 Oct 2003
Posts: 198
Location: St.Vincent & the Grenadines
silkodyssey 20 Jan 2004, 00:05
There are ansi and unicode versions of the SetWindowsHooKEx function. So the actual name should be SetWindowsHookExA or SetWindowsHookExW.

_________________
silkodyssey
Post 20 Jan 2004, 00:05
View user's profile Send private message MSN Messenger Reply with quote
WhiteDwarf



Joined: 25 Dec 2003
Posts: 17
WhiteDwarf 20 Jan 2004, 01:40
Ok i think i found what i want, I want a System-wide Remote hook.....I heard these are *notorious* for effecting System performance, so are there other types of hooks i could use to monitor *every* key entered.

Also...Since im using a Remote hook.....I have to create my own DLL for the filter function? Confused

and i use hInstance to refer to the DLL? how do i do that Crying or Very sad

It seems kind of confusing to me...... Very Happy

Thanks
Post 20 Jan 2004, 01:40
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.