59 if (send(handle,
"X", 1, 0) < 0) {
64 if(recv(handle, (
char*)&numBytes,
sizeof(numBytes), 0) < 0) {
68 if (numBytes==0)
return;
70 char *data=
new char[numBytes+1];
71 if(recv(handle, data, numBytes, 0) < 0) {
78 vector<CharAtPos> chars;
80 p = strchr(data+1,
'(');
85 char *p2 = strchr(p+4,
' ');
94 sort(chars.begin(),chars.end());
97 for (
unsigned int i=0;i<chars.size();i++) {
98 if (i>0 && chars[i-1].y != chars[i].y) cout << endl;
104 cout << data << endl;
108 int keys[3] = {0x42, 0x4d, 0x4e};
109 if (chars.size()>0) {
110 SendKey(handle, keys[rand()%3]);
117 int main(
int argc,
const char **argv) {
119 printf (
"Bitte Zielhost angeben\n");
126 cout <<
"connected to " << argv[1] << endl;
137 cerr <<
"Error: " << ce.what() << endl;
144 struct WSAAutoStart {
145 WORD wVersionRequested;
150 wVersionRequested = MAKEWORD( 2, 2 );
152 WSAStartup(wVersionRequested, &wsaData);