[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖

[问题求助] vbs加密如何看源码

附件为网上下载的一个加密的vbe脚本,用vbe decode解密后,文本方式打开发现还是乱码,表现为中文部分显示正常,字母和字符部分应该是被加密成乱码格式了  请教如何解密查看原代码

本帖最后由 老刘1号 于 2019-4-13 19:16 编辑

结论:你那个是假的vbe decode
  1. msgbox("欢迎使用本脚本!"&vbcrlf&"作者:小狼818"&vbcrlf&"QQ:542181983"&vbcrlf&"微信公众号:CATIA那点事儿"&vbcrlf&"关注获得更多资源!")
  2. on error resume next
  3. Set CATIA=GetObject(,"CATIA.Application")
  4. if err.number<>0 then
  5. msgbox("No CATIA session found!")
  6. wscript.quit
  7. end if
  8. on error goto 0
  9. '加一些错误控制
  10. Dim Doc
  11. On Error Resume Next
  12. Set Doc = CATIA.ActiveDocument
  13. If Err.Number <> 0 Then '这里是防止在CATIA没有文件打开的情况下运行
  14.     MsgBox ("No document opened in CATIA!")
  15.     wscript.quit
  16. Else
  17.     If TypeName(Doc) <> "DrawingDocument" Then
  18.         MsgBox ("Please run this macro with a Drawing document opened!") '这里是防止在激活的文档不是Drawing的情况下运行
  19.         wscript.quit
  20.     End If
  21. End If
  22. On Error GoTo 0
  23. Dim lView, lBView, lSlct, lVisprp, QtyDict, TempProduct, lTable, oTable, lTexts, oParameters
  24. Dim n, Source, Index, ProductList(50), iCt
  25. Dim LH, LW, Fr, Mt, Wt, Num, SWt, nu, nt
  26. Set lSlct = CATIA.ActiveDocument.Selection
  27. Set lVisprp = lSlct.VisProperties
  28. On Error Resume Next
  29. Set lView = CATIA.ActiveDocument.Sheets.ActiveSheet.Views.Item(3)
  30. If Err.Number <> 0 Then
  31.     MsgBox ("No user define views exsit!") '这里是防止没有视图的情况下运行
  32.     wscript.quit
  33. End If
  34. On Error GoTo 0
  35. Set lBView = CATIA.ActiveDocument.Sheets.ActiveSheet.Views.Item("Background View")
  36. Set lTable = lBView.Tables
  37. On Error Resume Next '这里是防止在没有3D文档链接的情况下运行
  38. Set oProductDoc = lView.GenerativeLinks.FirstLink
  39. If Err.Number <> 0 Then
  40.     MsgBox ("This drawing has no link to any 3D document!")
  41.     wscript.quit
  42. End If
  43. On Error GoTo 0
  44. Set oproducts = oProductDoc.Products
  45. if oproducts.count=0 then
  46.     MsgBox ("Linked 3D document is not a product, can not create detail list!")
  47.     wscript.quit
  48. end if
  49. On Error Resume Next '做个提示,当明细栏已存在时,提示是更新还是取消
  50.     Dim Tb, Stu
  51.     Set Tb = lTable.GetItem("DetailTable")
  52.     If Err.Number = 0 Then
  53.         Stu = MsgBox("BOM already exsits, do you want to update informations?", vbYesNo)
  54.         If Stu = vbNo Then
  55.             wscript.quit
  56.         Else
  57.             lSlct.Add (Tb)
  58.             lSlct.Delete
  59.         End If
  60.     End If
  61. On Error GoTo 0
  62. Set QtyDict = CreateObject("Scripting.Dictionary")
  63. LH = CATIA.ActiveDocument.Sheets.ActiveSheet.GetPaperHeight
  64. LW = CATIA.ActiveDocument.Sheets.ActiveSheet.GetPaperWidth
  65. 'lBView.Activate'只做视图的表格对象操作时,可以不激活该视图
  66. Index = 1
  67. For n = 1 To oproducts.Count
  68.     Set TempProduct = oproducts.Item(n)
  69.     If QtyDict.Exists(TempProduct.PartNumber) = False Then
  70.         QtyDict.Add TempProduct.PartNumber, 1
  71.         Set ProductList(Index) = TempProduct
  72.         Index = Index + 1
  73.     End If
  74. Next
  75. Fr=10
  76. XOrig = LW - Fr - 180
  77. YOrig = 56 + Fr
  78. Set oTable = lTable.Add(XOrig, YOrig, QtyDict.Count + 2, 8, 5, 5)
  79. oTable.Name = "DetailTable" '给表格命名,方便获取
  80. oTable.AnchorPoint = 2'CatTableBottomleft
  81. oTable.MergeCells QtyDict.Count + 1, 1, 2, 1
  82. oTable.MergeCells QtyDict.Count + 1, 2, 2, 1
  83. oTable.MergeCells QtyDict.Count + 1, 3, 2, 1
  84. oTable.MergeCells QtyDict.Count + 1, 4, 2, 1
  85. oTable.MergeCells QtyDict.Count + 1, 5, 2, 1
  86. oTable.MergeCells QtyDict.Count + 1, 8, 2, 1
  87. oTable.MergeCells QtyDict.Count + 2, 6, 1, 2
  88. oTable.SetCellString QtyDict.Count + 1, 1, "序号"
  89. Set lTexts = oTable.GetCellObject(QtyDict.Count + 1, 1)
  90. lTexts.SetFontSize 0, 0, 3.5
  91. oTable.SetCellAlignment QtyDict.Count + 1, 1, 4
  92. oTable.SetCellString QtyDict.Count + 1, 2, "代号"
  93. Set lTexts = oTable.GetCellObject(QtyDict.Count + 1, 2)
  94. lTexts.SetFontSize 0, 0, 3.5
  95. oTable.SetCellAlignment QtyDict.Count + 1, 2, 4
  96. oTable.SetCellString QtyDict.Count + 1, 3, "名称"
  97. Set lTexts = oTable.GetCellObject(QtyDict.Count + 1, 3)
  98. lTexts.SetFontSize 0, 0, 3.5
  99. oTable.SetCellAlignment QtyDict.Count + 1, 3, 4
  100. oTable.SetCellString QtyDict.Count + 1, 4, "数量"
  101. Set lTexts = oTable.GetCellObject(QtyDict.Count + 1, 4)
  102. lTexts.SetFontSize 0, 0, 3.5
  103. oTable.SetCellAlignment QtyDict.Count + 1, 4, 4
  104. oTable.SetCellString QtyDict.Count + 1, 5, "材料"
  105. Set lTexts = oTable.GetCellObject(QtyDict.Count + 1, 5)
  106. lTexts.SetFontSize 0, 0, 3.5
  107. oTable.SetCellAlignment QtyDict.Count + 1, 5, 4
  108. oTable.SetCellString QtyDict.Count + 2, 6, "重量/kg"
  109. Set lTexts = oTable.GetCellObject(QtyDict.Count + 2, 6)
  110. lTexts.SetFontSize 0, 0, 3.5
  111. oTable.SetCellAlignment QtyDict.Count + 2, 6, 4
  112. oTable.SetCellString QtyDict.Count + 1, 6, "单件"
  113. Set lTexts = oTable.GetCellObject(QtyDict.Count + 1, 6)
  114. lTexts.SetFontSize 0, 0, 3.5
  115. oTable.SetCellAlignment QtyDict.Count + 1, 6, 4
  116. oTable.SetCellString QtyDict.Count + 1, 7, "总计"
  117. Set lTexts = oTable.GetCellObject(QtyDict.Count + 1, 7)
  118. lTexts.SetFontSize 0, 0, 3.5
  119. oTable.SetCellAlignment QtyDict.Count + 1, 7, 4
  120. oTable.SetCellString QtyDict.Count + 1, 8, "备注"
  121. Set lTexts = oTable.GetCellObject(QtyDict.Count + 1, 8)
  122. lTexts.SetFontSize 0, 0, 3.5
  123. oTable.SetCellAlignment QtyDict.Count + 1, 8, 4
  124. oTable.SetColumnSize 1, 10
  125. oTable.SetColumnSize 2, 25
  126. oTable.SetColumnSize 3, 40
  127. oTable.SetColumnSize 4, 10
  128. oTable.SetColumnSize 5, 40
  129. oTable.SetColumnSize 6, 15
  130. oTable.SetColumnSize 7, 15
  131. oTable.SetColumnSize 8, 25
  132. For n = 1 To QtyDict.Count
  133. A = QtyDict.Count - n + 1
  134. oTable.SetCellString A, 1, cstr(n)
  135. Set lTexts = oTable.GetCellObject(A, 1)
  136. lTexts.SetFontSize 0, 0, 3.5
  137. oTable.SetCellAlignment A, 1, 4
  138. oTable.SetCellString A, 2, ProductList(n).PartNumber
  139. Set lTexts = oTable.GetCellObject(A, 2)
  140. lTexts.SetFontSize 0, 0, 3.5
  141. oTable.SetCellAlignment A, 2, 4
  142. oTable.SetCellString A, 3, ProductList(n).Name
  143. Set lTexts = oTable.GetCellObject(A, 3)
  144. lTexts.SetFontSize 0, 0, 3.5
  145. oTable.SetCellAlignment A, 3, 4
  146. '数量
  147. '看你之前写的,子装配应该只有1级,那就遍历一下所有子装配,看看有多少个重名的,就表示有多少个
  148. Dim iCount, iPro
  149. iCount = 0
  150. For Each iPro In oproducts
  151.     If iPro.PartNumber = ProductList(n).PartNumber Then iCount = iCount + 1
  152. Next
  153. oTable.SetCellString A, 4, CInt(iCount)
  154. Set lTexts = oTable.GetCellObject(A, 4)
  155. lTexts.SetFontSize 0, 0, 3.5
  156. oTable.SetCellAlignment A, 4, 4
  157. '获取材料
  158. '防止没添加材料,加个错误控制
  159. On Error Resume Next
  160. Dim Prt
  161. Set Prt = ProductList(n).ReferenceProduct.Parent.Part
  162. Dim MatMng
  163. Set MatMng = Prt.GetItem("CATMatManagerVBExt")
  164. Dim Mat
  165. MatMng.GetMaterialOnPart Prt, Mat
  166. oTable.SetCellString A, 5, Mat.Name
  167. Set lTexts = oTable.GetCellObject(A, 5)
  168. lTexts.SetFontSize 0, 0, 3.5
  169. oTable.SetCellAlignment A, 5, 4
  170. On Error GoTo 0
  171. oTable.SetCellString A, 6, Round(ProductList(n).Analyze.Mass, 2)
  172. Set lTexts = oTable.GetCellObject(A, 6)
  173. lTexts.SetFontSize 0, 0, 3.5
  174. oTable.SetCellAlignment A, 6, 4
  175. '总重量
  176. '总重也只需要是单个重量*个数就可以了
  177. oTable.SetCellString A, 7, Round(ProductList(n).Analyze.Mass, 2) * iCount
  178. Set lTexts = oTable.GetCellObject(A, 7)
  179. lTexts.SetFontSize 0, 0, 3.5
  180. oTable.SetCellAlignment A, 7, 4
  181. Next
  182. 'lView.Activate
复制代码

TOP

回复 2# 老刘1号

这还有一说   收集到的资料中decode有2001和2006两个版本,试了都没用,请问高人用的是哪一个

TOP

回复 3# 天涯浪子1988


    用的是这个,算法没研究过

TOP

返回列表