![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Banned
![]() ![]() |
Keylogger in Python
I don't actually want to make or use one, I'm just curious if there is any way at all you could get this to work? Care to describe how?
I can only think of one method, but it would be stupid because you'd have to click on a Pygame screen and type everything in to that, but how the hell does that make sense? ![]()
__________________
Looking for tough programming challenges? Try participating in Sane's Monthly Algorithms Challenges! Composing Techno is a little side hobby of mine. Techno by DJ Sane. All free for download. |
|
|
|
|
|
#2 | ||
|
Professional Programmer
Join Date: Apr 2005
Location: London, England
Posts: 459
Rep Power: 4
![]() |
Quote:
Quote:
![]() You just want to ask the OS API to provide you with notification whenever a key is hit. Easy to do with the WinAPI (and Python has full (well, almost full) win32 bindings), and should be fairly easy to do on X. Not sure with Mac 'tho. |
||
|
|
|
|
|
#3 |
|
Banned
![]() ![]() |
So is it something along the lines of forking the process to the background, and then making the os module catch all the keys or something?
Hmm. That might give me something to research and learn from in a couple of months when I finish what I'm up to now.
__________________
Looking for tough programming challenges? Try participating in Sane's Monthly Algorithms Challenges! Composing Techno is a little side hobby of mine. Techno by DJ Sane. All free for download. |
|
|
|
|
|
#4 |
|
Programming Guru
![]() ![]() ![]() |
Let me know how it goes, I'd like to see how this would work out in Python.
__________________
http://jasonpowers.net "There are a thousand hacking at the branches of evil to one who is striking at the root." |
|
|
|
|
|
#5 |
|
Professional Programmer
Join Date: Apr 2005
Location: London, England
Posts: 459
Rep Power: 4
![]() |
No, it's not in the os module. I mean the OS itself. Oh ok then, here are the functions you'll need :p:
win32api.GetAsyncKeyState - takes a number parameter which is maps to the character you want to check for (you'll want to check for any character from 32 to 256). It'll return -32767 if that character is currently being pressed, IIRC. chr - Maps said number to an ASCII character (e.g chr(97) => 'a') From what I remember, that should be it. I'll leave the rest to you . Good luck |
|
|
|
|
|
#6 | |
|
Programmer
Join Date: Jul 2005
Posts: 73
Rep Power: 4
![]() |
Quote:
|
|
|
|
|
|
|
#7 |
|
Hobbyist Programmer
Join Date: Nov 2004
Location: 1691 miles East of L.A.
Posts: 159
Rep Power: 5
![]() |
Cerulean has already given enough information to complete this task although I would start the keyscan at 8 to capture backspace, tab, enter and escape. If you still don't understand you should try google results for the API call mentioned.
__________________
-- lostcauz Stepped in what?... Behind whose barn?... I didn't even know they had a cow! |
|
|
|
|
|
#8 | |
|
Professional Programmer
Join Date: Apr 2005
Location: London, England
Posts: 459
Rep Power: 4
![]() |
Quote:
|
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|