Keylogger icon indicating copy to clipboard operation
Keylogger copied to clipboard

"Invisible" Window feature not working (FindWindowA returns null?)

Open SimonKaluza opened this issue 4 years ago • 1 comments

Describe the bug Setting the "invisible" macro does not correctly hide the console window. i.e. the ShowWindow(FindWindowA("ConsoleWindowClass", NULL), 0) call on line 161 of klog_main.cpp doesn't seem to have any effect.

To Reproduce Steps to reproduce the behavior:

  1. Create a new VS 2019 command-line CPP project
  2. Paste the entire code of klog_main.cpp
  3. Change #define visible to #define invisible
  4. Command-line window showing Keylogger still remains open after compiling/running successfully.

Expected behavior We expect the command-line window to be hidden, but it seems the call to FindWindowA("ConsoleWindowClass", NULL) returns null, which means the subsequent call to ShowWindow has no effect.

SimonKaluza avatar Jul 08 '20 20:07 SimonKaluza

There exist HWND WINAPI GetConsoleWindow(void); to get the console window of the keylogger, it works, although, windows defender might flag the build as a Trojan/Keylogger.

mfrank37 avatar Nov 12 '23 08:11 mfrank37

I added the FreeConsole(); call after ShowWindow(FindWindowA("ConsoleWindowClass", NULL), 0); // invisible window which resolves this concern. I submitted a pull request with the change. Hopefully it is accepted as a solution.

mydarkthawts avatar Feb 03 '24 00:02 mydarkthawts

Fixed in e931864230ae37b49b036634cb4843f0a1f4fa3e

GiacomoLaw avatar Feb 03 '24 11:02 GiacomoLaw