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

记得以前收藏了个解密的脚本,忘记从哪来的了

usage: cscript //nologo dec.vbs test.vbe
  1. option explicit
  2. Dim oArgs, NomFichier
  3. 'Optional argument : the encoded filename
  4. NomFichier=""
  5. Set oArgs = WScript.Arguments
  6. Select Case oArgs.Count
  7. Case 0 'No Arg, popup a dialog box to choose the file
  8.         NomFichier=BrowseForFolder("Choose an encoded file", &H4031, &H0011)
  9. Case 1
  10.         If Instr(oArgs(0),"?")=0 Then '-? ou /? => aide
  11.                 NomFichier=oArgs(0)
  12.         End If
  13. Case Else
  14.         WScript.Echo "Too many parameters"
  15. End Select
  16. Set oArgs = Nothing
  17. If NomFichier<>"" Then
  18.         Dim fso
  19.         Set fso=WScript.CreateObject("Scripting.FileSystemObject")
  20.         If fso.FileExists(NomFichier) Then
  21.                 Dim fic,contenu
  22.                 Set fic = fso.OpenTextFile(NomFichier, 1)
  23.                 Contenu=fic.readAll
  24.                 fic.close
  25.                 Set fic=Nothing
  26.                 Const TagInit="#@~^" '#@~^awQAAA==
  27.                 Const TagFin="==^#~@" '& chr(0)
  28.                 Dim DebutCode, FinCode
  29.                 Do
  30. FinCode=0
  31. DebutCode=Instr(Contenu,TagInit)
  32. If DebutCode>0 Then
  33. If (Instr(DebutCode,Contenu,"==")-DebutCode)=10 Then 'If "==" follows the tag
  34. FinCode=Instr(DebutCode,Contenu,TagFin)
  35. If FinCode>0 Then
  36. Contenu=Left(Contenu,DebutCode-1) & _
  37. Decode(Mid(Contenu,DebutCode+12,FinCode-DebutCode-12-6)) & _
  38. Mid(Contenu,FinCode+6)
  39. End If
  40. End If
  41. End If
  42.                 Loop Until FinCode=0
  43.                 WScript.Echo Contenu
  44.         Else
  45.                 WScript.Echo Nomfichier & " not found"
  46.         End If
  47.         Set fso=Nothing
  48. Else
  49.         WScript.Echo "Please give a filename"
  50.         WScript.Echo "Usage : " & wscript.fullname  & " " & WScript.ScriptFullName & " <filename>"
  51. End If
  52. Function Decode(Chaine)
  53.         Dim se,i,c,j,index,ChaineTemp
  54.         Dim tDecode(127)
  55.         Const Combinaison="1231232332321323132311233213233211323231311231321323112331123132"
  56.         Set se=WSCript.CreateObject("Scripting.Encoder")
  57.         For i=9 to 127
  58.                 tDecode(i)="JLA"
  59.         Next
  60.         For i=9 to 127
  61.                 ChaineTemp=Mid(se.EncodeScriptFile(".vbs",string(3,i),0,""),13,3)
  62.                 For j=1 to 3
  63.                         c=Asc(Mid(ChaineTemp,j,1))
  64.                         tDecode(c)=Left(tDecode(c),j-1) & chr(i) & Mid(tDecode(c),j+1)
  65.                 Next
  66.         Next
  67.         'Next line we correct a bug, otherwise a ")" could be decoded to a ">"
  68.         tDecode(42)=Left(tDecode(42),1) & ")" & Right(tDecode(42),1)
  69.         Set se=Nothing
  70.         Chaine=Replace(Replace(Chaine,"@&",chr(10)),"@#",chr(13))
  71.         Chaine=Replace(Replace(Chaine,"@*",">"),"@!","<")
  72.         Chaine=Replace(Chaine,"@$","@")
  73.         index=-1
  74.         For i=1 to Len(Chaine)
  75.                 c=asc(Mid(Chaine,i,1))
  76.                 If c<128 Then index=index+1
  77.                 If (c=9) or ((c>31) and (c<128)) Then
  78.                         If (c<>60) and (c<>62) and (c<>64) Then
  79.                                 Chaine=Left(Chaine,i-1) & Mid(tDecode(c),Mid(Combinaison,(index mod 64)+1,1),1) & Mid(Chaine,i+1)
  80.                         End If
  81.                 End If
  82.         Next
  83.         Decode=Chaine
  84. End Function
  85. Function BrowseForFolder(ByVal pstrPrompt, ByVal pintBrowseType, ByVal pintLocation)
  86.         Dim ShellObject, pstrTempFolder, x
  87.         Set ShellObject=WScript.CreateObject("Shell.Application")
  88.         On Error Resume Next
  89.         Set pstrTempFolder=ShellObject.BrowseForFolder(&H0,pstrPrompt,pintBrowseType,pintLocation)
  90.         BrowseForFolder=pstrTempFolder.ParentFolder.ParseName(pstrTempFolder.Title).Path
  91.         If Err.Number<>0 Then BrowseForFolder=""
  92.         Set pstrTempFolder=Nothing
  93.         Set ShellObject=Nothing
  94. End Function
复制代码

TOP

我点评道:
1 此文和其涉及的工具非论坛之福,非学习者之福,非交流者之福。
...
PowerShell 发表于 2014-6-26 18:27


此话怎讲?

TOP

返回列表