Autocad.lsp Virüsü, Temizleme Şekli ve Karşılaşılan Problem

C@GL@R

Üye
Kayıt
17 Ekim 2009
Mesaj
83
Tepki
3
Tekstil Grafik Kursu
Arkadaşlar karşılaştığım bir olay üzerine sizinle paylaşmak istedim..

Bu virüs dwg (çizim) dosyası açılmasıyla birlikte çalışıyor ve kendisini autocad’in ana lisp dosyalarına kopyalıyor. Bu şekilde de her dosya açıldığında çalışıp açtığınız her klasöre kendini kopyalayarak sisteminize yayılıyor. Klasörlerdeki “acaddoc.lsp” dosyalarını silmemiz bir işe yaramıyor.

Verdiği hata ise, Autocad Proje dosyasını açtığımız zaman sayfa kitleniyor ve ESC tuşuna basmadıkça da kilitlenme geçmiyor.. Kısacası sıkıcı bir durum..

ALS.Bursted.A veya ALS.Bursted.D olarak da adlandırılan bu virüsü temizlemek için ise aşağıdaki kodu Autocad kod giriş bölümünü kopyala/yapıştır şeklinde yapmamız ve enter ile kodu göndermemiz..

Umarım faydalı olmuştur.. İyi günler

Kod:
(setq flagx t)
(setq bz "(setq flagx t)")
(defun clearfile (target bz / flag flag1 wjm wjm1 text)
  (setq flag nil)
  (setq flag1 nil)
  (princ (strcat "\nClearfile -> " target))
  (if (findfile target)   ;if file exists
    (progn
      (setq wjm1 (open target "r"))
      (while (setq text (read-line wjm1))
 (if (= text bz)
   (setq flag1 t)
 )
      )     ;while
      (close wjm1)
    )     ;progn
  )     ;if
  (if flag1    ;virus found!
    (progn
      (princ (strcat "\nVirus found -> " target))
      (setq flag t)
      (setq wjm (open target "r"))
      (setq wjm1 (open "temp.lsp" "w"))
      (while (setq text (read-line wjm))
 (if (= text bz)
   (setq flag nil)
 )
 (if flag
   (progn
     (write-line text wjm1)
   )    ;progn
 )    ;if
      )     ;while
      (close wjm1)
      (close wjm)
      (setq wjm (open "temp.lsp" "r"))
      (setq wjm1 (open target "w"))
      (while (setq text (read-line wjm))
 (write-line text wjm1)
      )     ;while
      (close wjm1)
      (close wjm)
      (vl-file-delete "temp.lsp")
    )     ;progn
    ;(princ (strcat "\nClean file: " target))
  )     ;if
)     ;defun
(setq ms "(setq acaddocfix t)")
(defun copyfix (target / wjm1 text flag1)
  (princ (strcat "\nCopyfix -> " target))
  (if (findfile target)   ;if file exists
    (progn
      (setq flag1 t)
      (setq wjm1 (open target "r"))
      (while (setq text (read-line wjm1))
 (if (= text ms)
   (setq flag1 nil)
 )
      )     ;while
      (close wjm1)
      (if flag1
 (progn
   (setq wjm1 (open target "a"))
   ;(write-line (chr 13) wjm1)
   (write-line "\n(setq acaddocfix t)" wjm1)
   (write-line ";;; ^^ ACADDOCFIX STARTS HERE ^^" wjm1)
   ;; Start of clearfix
   (write-line "(defun cleanvirus( / lspfiles lspfile x)" wjm1)
   (write-line
     " (setq lspfiles '(\"acad.vlx\" \"logo.gif\" \"acaddoc.lsp\") )"
     wjm1
   )
   (write-line " (foreach lspfile lspfiles " wjm1)
   (write-line "  (while (setq x (findfile lspfile))" wjm1)
   (write-line "   (progn" wjm1)
   (write-line "    (vl-file-delete x)" wjm1)
   (write-line "    (princ \"[URL="file://\\nDeleted"]\\nDeleted[/URL] file : \")" wjm1)
   (write-line "    (princ x)" wjm1)
   (write-line "   );progn" wjm1)
   (write-line "  );while" wjm1)
   (write-line " );foreach" wjm1)
   (write-line " )" wjm1)
   (write-line "(cleanvirus)" wjm1)
 
   (write-line
     "(defun clearfile(target bz / flag flag1 wjm wjm1 text)"
     wjm1
   )
   (write-line " (setq flag nil)" wjm1)
   (write-line " (setq flag1 nil)" wjm1)
   (write-line " (if (findfile target) ;if file exists" wjm1)
   (write-line "  (progn" wjm1)
   (write-line "   (setq wjm1 (open target \"r\"))" wjm1)
   (write-line "   " wjm1)
   (write-line "   (while (setq text (read-line wjm1))" wjm1)
   (write-line "    (if (= text bz) (setq flag1 t))" wjm1)
   (write-line "   );while" wjm1)
   (write-line "   " wjm1)
   (write-line "   (close wjm1)" wjm1)
   (write-line "  );progn" wjm1)
   (write-line "    );if" wjm1)
   (write-line " (if flag1 ;virus found!" wjm1)
   (write-line "  (progn" wjm1)
   (write-line
     "   (princ (strcat \"[URL="file://\\nVirus"]\\nVirus[/URL] found: \" target))"
     wjm1
   )
   (write-line "   (setq flag t)" wjm1)
   (write-line "   (setq wjm (open target \"r\"))" wjm1)
   (write-line "   (setq wjm1 (open \"temp.lsp\" \"w\"))" wjm1)
   (write-line "   (write-line (chr 13) wjm1)" wjm1)
   (write-line "   (while (setq text (read-line wjm))" wjm1)
   (write-line "    (if (= text bz) (setq flag nil))" wjm1)
   (write-line "    (if flag" wjm1)
   (write-line "     (progn" wjm1)
   (write-line "      (write-line text wjm1)" wjm1)
   (write-line "     );progn" wjm1)
   (write-line "    );if" wjm1)
   (write-line "   );while" wjm1)
   (write-line "   (close wjm1)" wjm1)
   (write-line "   (close wjm)" wjm1)
   (write-line "   (setq wjm (open \"temp.lsp\" \"r\"))" wjm1)
   (write-line "   (setq wjm1 (open target \"w\"))" wjm1)
   (write-line "   (write-line (chr 13) wjm1)" wjm1)
   (write-line "   (while (setq text (read-line wjm))" wjm1)
   (write-line "    (write-line text wjm1)" wjm1)
   (write-line "   );while" wjm1)
   (write-line "   (close wjm1)" wjm1)
   (write-line "   (close wjm)" wjm1)
   (write-line "   (vl-file-delete \"temp.lsp\")" wjm1)
   (write-line "  );progn" wjm1)
   (write-line "    );if" wjm1)
   (write-line ");defun" wjm1)
 
   (write-line "(setq acadmnl (findfile \"acad.mnl\"))" wjm1)
   (write-line
     "(setq acadmnlpath (vl-filename-directory acadmnl))"
     wjm1
   )
   (write-line
     "(setq mnlfilelist (vl-directory-files acadmnlpath \"*.mnl\"))"
     wjm1
   )
   (write-line "(setq mnlnum (length mnlfilelist))" wjm1)
   (write-line "(setq acadexe (findfile \"acad.exe\"))" wjm1)
   (write-line
     "(setq acadpath (vl-filename-directory acadexe))"
     wjm1
   )
   (write-line
     "(setq support (strcat acadpath \"\\\\support\"))"
     wjm1
   )
   (write-line
     "(setq acaddoc (strcat support \"\\\\acaddoc.lsp\"))"
     wjm1
   )
   (write-line
     "(setq lspfilelist (vl-directory-files support \"*.lsp\"))"
     wjm1
   )
   (write-line
     "(setq lspfilelist (append lspfilelist (list \"acaddoc.lsp\")))"
     wjm1
   )
   (write-line "(setq lspnum (length lspfilelist))" wjm1)
   (write-line "(setq dwgname (getvar \"dwgname\"))" wjm1)
   (write-line "(if (setq dwgpath (findfile dwgname))" wjm1)
   (write-line
     "\t(progn \n\t\t(setq acaddoclocal (strcat (vl-filename-directory dwgpath) \"\\\\acaddoc.lsp\")) \n\t\t(clearfile acaddoclocal bz) \n\t)"
     wjm1
   )
   (write-line ") ;if" wjm1)
   (write-line "(clearfile acaddoc bz)" wjm1)
   (write-line "(setq mnln 0)" wjm1)
   (write-line "(while (< mnln mnlnum)" wjm1)
   (write-line
     " (setq mnlfilename (strcat acadmnlpath \"\\\\\" (nth mnln mnlfilelist)))"
     wjm1
   )
   (write-line " (clearfile mnlfilename bz)" wjm1)
   (write-line " (setq mnln (1+ mnln))" wjm1)
   (write-line ");while" wjm1)
   (write-line "(setq lspn 0)" wjm1)
   (write-line "(while (< lspn lspnum)" wjm1)
   (write-line
     " (setq lspfilename (strcat support \"\\\\\" (nth lspn lspfilelist)))"
     wjm1
   )
   (write-line " (clearfile lspfilename bz)" wjm1)
   (write-line " (setq lspn (1+ lspn))" wjm1)
   (write-line ");while" wjm1)
   ;; End of clearfix
   (write-line "(princ)" wjm1)
   (close wjm1)
 )    ;progn
      )     ;if
    )     ;progn
  )     ;if
)
 
(setq acadmnl (findfile "acad.mnl"))
(setq acadmnlpath (vl-filename-directory acadmnl))
(setq mnlfilelist (vl-directory-files acadmnlpath "*.mnl" 1))
(setq
  mnlnum (vl-list-length (vl-directory-files acadmnlpath "*.mnl" 1))
)
(setq acadexe (findfile "acad.exe"))
(setq acadpath (vl-filename-directory acadexe))
(setq support (strcat acadpath "[URL="file://\\support"]\\support[/URL]"))
(setq acaddoc (strcat support "[URL="file://\\acaddoc.lsp"]\\acaddoc.lsp[/URL]"))
(setq lspfilelist (vl-directory-files support "*.lsp"))
(setq lspfilelist (append lspfilelist (list "acaddoc.lsp")))
(setq lspnum (length lspfilelist))
(setq dwgname (getvar "dwgname"))
(if (setq dwgpath (findfile dwgname)) ; if a file is open
  (progn
    (setq acaddoclocal
    (strcat (vl-filename-directory dwgpath)
     "[URL="file://\\acaddoc.lsp"]\\acaddoc.lsp[/URL]"
    )
    )
    (clearfile acaddoclocal bz)
  )
)
(clearfile acaddoc bz)
(setq mnln 0)
(while (< mnln mnlnum)
  (setq mnlfilename (strcat acadmnlpath "\\" (nth mnln mnlfilelist)))
  (clearfile mnlfilename bz)
  (setq mnln (1+ mnln))
)     ;while
(setq lspn 0)
(while (< lspn lspnum)
 (setq lspfilename (strcat support "\\" (nth lspn lspfilelist)))
 (clearfile lspfilename bz)
 (setq lspn (1+ lspn))
);while
(if (findfile "acad2011doc.lsp")
 (progn
  (setq acad2011doc (findfile "acad2011doc.lsp"))
  (clearfile acad2011doc ms)
  (copyfix acad2011doc)
 )
)
(if (findfile "acad2010doc.lsp")
 (progn
  (setq acad2010doc (findfile "acad2010doc.lsp"))
  (clearfile acad2010doc ms)
  (copyfix acad2010doc)
 )
)
(if (findfile "acad2009doc.lsp")
 (progn
  (setq acad2009doc (findfile "acad2009doc.lsp"))
  (clearfile acad2009doc ms)
  (copyfix acad2009doc)
 )
)
(if (findfile "acad2008doc.lsp")
 (progn
  (setq acad2008doc (findfile "acad2008doc.lsp"))
  (clearfile acad2008doc ms)
  (copyfix acad2008doc)
 )
)
(if (findfile "acad2008doc.lsp")
 (progn
  (setq acad2007doc (findfile "acad2007doc.lsp"))
  (clearfile acad2007doc ms)
  (copyfix acad2007doc)
 )
)
 

Abdullah Şahin

Altın Üye
Altın Üye
Kayıt
3 Nisan 2008
Mesaj
2.632
Tepki
89
Paylaşım için teşekkürler Çağlar. Bir kaç gün önce AutoCad kullanan bir arkadaşım bu sıkıntısı için bana gelmişti. Sayende sorunu böyle çözeceğim..
 
Yukarı Alt