I am trying to make a simple keylogger in C-language.So I decided to use a far pointer to access the keyboard buffer.(32 bytes, address- 0x41E).I just assigned that address to a far pointer and tried to access the buffer.But the code I typed is showing only these 3 characters- a smiley,@ and lots of spaces.This is my code-
#include<stdio.h>
#include<conio.h>
int main()
{
char far *s,*p,*m;
char arr[32];
s=(char far*)0x0041E;
m=(char far*)0x0041E;
p=(char far*)0x0043D;
while(!kbhit())
{
m=s;
while(m<=p)
{
printf(" %c",*m);
m++;
}
}
return 0;
}
Links for address of keyboard buffer-(A little recent reference :-)) http://wiki.osdev.org/Memory_Map_(x86) http://computer.forensikblog.de/en/2009/04/reading-passwords-from-the-keyboard-buffer.html