You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I believe that this is built under the console subsystem which relies on the method of using ShowWindow to hide the console window (correct me if I'm wrong). The issue is that it will flash the console on execution and is therefore not an elegant solution.
My Proposal
Build and compile the code under the Windows subsystem and entirely move away from the use of a console. This change renders the Stealth function and #define (in)visible obsolete.
Adjustments
Microsoft Visual C++:
Change: int main()
to: int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShow)
For UNICODE, use: int wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nShow)
Create project under Win32 Project or change the SubSystem setting to Windows (/SUBSYSTEM:WINDOWS) under Properties -> Linker -> System.
GCC/G++:
Build using the -mwindows flag. The above steps are optional.
I like the way it is - however, I am open to improvements. With the console flashing on startup, it does occur in the pcs I have used in my experience, but I'm not sure if it is standard.
Do you have any other advantages of using it along with the console flash?
Not that I can think of, no. The reason why I proposed this is because keyloggers are stealth malware and having the console flash may raise suspicion against it. Perhaps someone who might use it would prefer no console flash but if you're fine with the way it currently is, then so be it.
Problem
I believe that this is built under the console subsystem which relies on the method of using
ShowWindow
to hide the console window (correct me if I'm wrong). The issue is that it will flash the console on execution and is therefore not an elegant solution.My Proposal
Build and compile the code under the Windows subsystem and entirely move away from the use of a console. This change renders the
Stealth
function and#define (in)visible
obsolete.Adjustments
Microsoft Visual C++:
Change:
int main()
to:
int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShow)
For UNICODE, use:
int wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nShow)
Create project under
Win32 Project
or change theSubSystem
setting toWindows (/SUBSYSTEM:WINDOWS)
underProperties -> Linker -> System
.GCC/G++:
Build using the
-mwindows
flag. The above steps are optional.If visibility is desired, use:
The text was updated successfully, but these errors were encountered: