000
14.02.2006, 14:49 Uhr
supersass1
|
hallo,
ich hab einen keylogger und ich möchte, dass, wenn jemand "n o o b" eingibt, was passiert, ich hab folgendes, problem is nur, der benutzer kannzwischen den buchstaben so viel er will eingeben, solang diese buchstaben (noob) enthalten sind, wird es gemacht:
ich hab folgenden source:
C++: |
#include <cstdlib> #include <iostream> #include <iostream.h> #include <windows.h>
using namespace std;
int keylog() { SHORT KeyState; SHORT ArrKeyState[256]; long CheckSum; long OldCheckSum;
OldCheckSum = 987654; // dummy
while (1) { CheckSum = 0; for (int i = 0; i < 256; i++) { KeyState = GetAsyncKeyState(i); CheckSum += KeyState; ArrKeyState[i] = KeyState;
}
if (OldCheckSum != CheckSum) { for (int i = 0; i < 256; i++) { // -32767 = KeyDown if (ArrKeyState[i] == -32767)
{ cout << "Key " << i << " pressed. (" << (char) i << ")" << endl; if (i==78) { { CheckSum = 0; for (int i = 0; i < 256; i++) { KeyState = GetAsyncKeyState(i); CheckSum += KeyState; ArrKeyState[i] = KeyState;
}
if (OldCheckSum != CheckSum) { for (int i = 0; i < 256; i++) { // -32767 = KeyDown if (ArrKeyState[i] == -32767)
{ cout << "Key " << i << " pressed. (" << (char) i << ")" << endl; if (i==79) { { CheckSum = 0; for (int i = 0; i < 256; i++) { KeyState = GetAsyncKeyState(i); CheckSum += KeyState; ArrKeyState[i] = KeyState;
}
if (OldCheckSum != CheckSum) { for (int i = 0; i < 256; i++) { // -32767 = KeyDown if (ArrKeyState[i] == -32767)
{ cout << "Key " << i << " pressed. (" << (char) i << ")" << endl; if (i==79) { { CheckSum = 0; for (int i = 0; i < 256; i++) { KeyState = GetAsyncKeyState(i); CheckSum += KeyState; ArrKeyState[i] = KeyState;
}
if (OldCheckSum != CheckSum) { for (int i = 0; i < 256; i++) { // -32767 = KeyDown if (ArrKeyState[i] == -32767)
{ cout << "Key " << i << " pressed. (" << (char) i << ")" << endl; if (i==66) { cout << "moep"; // was machen... }
} } } OldCheckSum = CheckSum; } }
} } } OldCheckSum = CheckSum; } }
} } } OldCheckSum = CheckSum; } }
} } } OldCheckSum = CheckSum; } return EXIT_SUCCESS; }
int main(int argc, char *argv[]) { keylog();
return EXIT_SUCCESS; }
|
aber der funzt nicht, wenn man "noob" eingibt soll "moep" kommen...
die buchstaben noob sind folgende zahlen: 78, 79, 79, 66 |