其实很多人看过猫老师的视频之后都基本上可以懂一点
就是利用二进制编辑器来查找命令
利用命令调用原命令
实现了看起来破解的目的
不过对于软件的源代码基本上什么都没有见到
这种破解适合商业化的,但是确实不适合程序员想要的东西
开源是一种美德,但是不开源不代表没有高尚的品质-by-shikey
今天从明经上看到两个例子:
下载WINHEX 打开你的VLX(我的这个包含3个LISP,每一个都是一句(ALERT “HELLO”))
从FAS4前面一个格式开始选择,一直到下一个FAS前面,也就是日期后面,选中,右键,编辑,复制选块,侄新文件,
另存一个随便命名的,但文件格式一定是FAS,即可如下图
最后在CAD里加载即可,够简单吧,!!
点评一下:基本上初步进入vlx的分离工作了.还有一个例子看完再说
(vl-load-com)
(defun AYL-binary (Import / AdoObj BytLst)
(if (setq AdoObj (Vlax-Get-Or-Create-Object “ADODB.Stream”))
(progn
(Vlax-Put-Property AdoObj ‘Type 1)
(Vlax-Invoke AdoObj ‘Open)
(Vlax-Invoke-Method AdoObj ‘LoadFromFile Import)
(Vlax-Put-Property AdoObj ‘Position 0)
(setq BytLst (Vlax-Invoke-Method AdoObj ‘Read (Vlax-Get-Property AdoObj ‘Size)))
(Vlax-Invoke-Method AdoObj ‘Close)
(vlax-release-object AdoObj)
(vlax-safearray->list (vlax-variant-value BytLst))
)
)
)(defun AYL-list->variant (ptsList / arrayspace sArray)
(setq arrayspace (vlax-make-safearray 17 (cons 0 (1- (length ptsList))))
sArray (vlax-safearray-fill arrayspace ptsList)
)
(vlax-make-variant sArray)
)(defun AYL-write-binary (Export DatLst / AdoObj)
(if (setq AdoObj (Vlax-Get-Or-Create-Object “ADODB.Stream”))
(progn
(Vlax-Put-Property AdoObj ‘Type 1)
(Vlax-Invoke AdoObj ‘Open)
(Vlax-Put-Property AdoObj ‘Position 0)
(Vlax-Invoke-Method AdoObj ‘Write (AYL-list->variant DatLst))
(vl-file-delete Export)
(Vlax-Invoke AdoObj ‘SaveToFile Export 1)
(Vlax-Invoke-Method AdoObj ‘Close)
(princ (strcat “\n成功创建 ” Export ” 文件!”))
(vlax-release-object AdoObj)
)
)
)(defun AYL-E->D (ELst / n s e)
(setq s 0)
(while (= (car ELst) 0)
(setq ELst (cdr ELst))
)
(if (< 0 (setq n (length ELst)) 5)
(foreach Item ELst
(setq n (1- n)
e (expt 256 n)
s (+ s (* Item e))
)
)
)
s
)(defun AYL-null (TmpLst)
(princ)
)(defun AYL-Umvlx (Import / BytLst TmpLst Number Int0 Int1 Int2 Int3 Fname Export)
(if (setq BytLst (AYL-binary Import))
(progn
(setq TmpLst nil Number (length BytLst))
(princ “\n文件大小:”)
(princ Number)
;;提取前8个字节 VRTLIB-1
(repeat 8
(setq TmpLst (cons (car BytLst) TmpLst)
BytLst (cdr BytLst)
)
)
(if (= (vl-list->string (reverse TmpLst)) “VRTLIB-1”)
(setq TmpLst nil)
(progn (princ “\n无效的vlx文件”) (VL-EXIT-WITH-VALUE “”))
)
;;提取4个字节,这四个字节表示的整数指除最后16个字节外的所有字节的总数,包括开头的八个字节
(repeat 4
(setq TmpLst (cons (car BytLst) TmpLst)
BytLst (cdr BytLst)
)
)
(setq Int0 (- (AYL-E->D TmpLst) 12) TmpLst nil)
(while (> (rem Int0 4) 0) (setq Int0 (1+ Int0)))
(setq Fname (substr Import 1 (- (strlen Import) 4 (strlen (vl-filename-base Import)))))
(while (> Int0 6)
(setq TmpLst nil Export Fname)
(repeat 4
(setq TmpLst (cons (car BytLst) TmpLst)
BytLst (cdr BytLst)
)
)
(setq Number (AYL-E->D TmpLst))
(while (> (rem Number 4) 0) (setq Number (1+ Number)))
(setq Int0 (- Int0 Number)
Int1 (car BytLst)
Int2 (cadr BytLst)
Int3 (caddr BytLst)
BytLst (cdddr BytLst)
)
(if (and (member Int1 ‘(50 55 70 216 0)) (member Int2 ‘(0 4 5)))
(progn
(setq TmpLst nil Number (- Number 7 Int3))
(repeat Int3
(setq TmpLst (cons (car BytLst) TmpLst)
BytLst (cdr BytLst)
)
)
(setq Export (strcat Export (vl-list->string (reverse TmpLst))))
(setq TmpLst nil)
(if (> Number 0)
(repeat Number
(setq TmpLst (cons (car BytLst) TmpLst)
BytLst (cdr BytLst)
)
)
)
(while (= (car TmpLst) 0) (setq TmpLst (cdr TmpLst)))
(setq TmpLst (reverse TmpLst))
(cond
((= Int1 216)
(if (= Int2 4)
(AYL-null TmpLst)
(progn (princ “文件信息错误”) (VL-EXIT-WITH-VALUE “”))
)
)
((= Int1 50)
(if (/= Int2 5) (progn (princ “文件类型错误50”) (VL-EXIT-WITH-VALUE “”)))
(setq Export (strcat Export “.fas”))
(if TmpLst
(progn (AYL-write-binary Export TmpLst) (princ ” “) (princ Number))
(close (open Export “w”))
)
)
((= Int1 0)
(if (/= Int2 0) (progn (princ “文件类型错误0”) (VL-EXIT-WITH-VALUE “”)))
(princ “\n这个类型的文件要根据实际情况更改后缀名”)
(setq Export (strcat Export “.ayl”))
(if TmpLst
(progn (AYL-write-binary Export TmpLst) (princ ” “) (princ Number))
(close (open Export “w”))
)
)
((= Int1 55)
(if (/= Int2 5) (progn (princ “文件类型错误55”) (VL-EXIT-WITH-VALUE “”)))
(setq Export (strcat Export “.txt”))
(if TmpLst
(progn (AYL-write-binary Export TmpLst) (princ ” “) (princ Number))
(close (open Export “w”))
)
)
((= Int1 70)
(if (/= Int2 5) (progn (princ “文件类型错误70”) (VL-EXIT-WITH-VALUE “”)))
(setq Export (strcat Export “.dcl”))
(if TmpLst
(progn (AYL-write-binary Export TmpLst) (princ ” “) (princ Number))
(close (open Export “w”))
)
)
(t (princ “文件类型错误”) (VL-EXIT-WITH-VALUE “”))
)
)
(progn (princ “文件类型错误”) (VL-EXIT-WITH-VALUE “”))
) ;_ end if
) ;_ end while
(princ “\n”)
) ;_ end progn
) ;_ end if
)(defun c:Umvlx (/ file)
(if (setq file (getfiled “” “” “vlx” 0))
(AYL-Umvlx file)
)
(princ)
)(princ “\n命令名: Umvlx”)
(princ ” 作者:晨语 QQ:1024045011″)
(princ)
点评一下:思路基本上一样的.
可见一斑的,vlx基本上就是一种打包,fas才是文件加密形式,而通过二进制编辑器可以看到fas的命令.所以基本上VLX仅仅是autocad里面的一种便捷方式,而arx和.net才是走商业化的
工具,另外一方面既然fas只加密了代码内部,而执行命令还需要call,这可不可能是cad的一种内部机制,
如果利用od将cad挂载直接解析是否会将fas代码还原.今天就不试了.做个记录.