;;加密一个lisp文件
(defun C:TT4 (/ FF FNAME LST TMP)
;;读文件
(if (setq fname (getfiled "***选择Lsp文件***" "" "lsp" 16))
(progn
(setq FF (open fname "r"))
(while (setq TMP (read-char FF))
(setq LST (cons TMP LST))
)
(close FF)
(setq Lst (reverse Lst))
(setq FF (open fname "w"))
;;写入文件头
(foreach N (vl-string->list "AutoCAD PROTECTED LISP file")
(write-char N FF)
)
(write-char 13 FF)
(write-char 10 FF)
(write-char 26 FF)
;;写入
(write-char 65 FF)
(setq LST (++++ LST 65))
(foreach N LST (write-char N FF))
(close FF)
)
)
(princ)
)
;;;=========================