脚本之家,脚本语言编程技术及教程分享平台!
分类导航

Python|VBS|Ruby|Lua|perl|VBA|Golang|PowerShell|Erlang|autoit|Dos|bat|

服务器之家 - 脚本之家 - VBS - VBE decoder

VBE decoder

2020-08-11 17:49脚本之家 VBS

Decode all files encoded (original version) with screnc.exe

This script give you a decoded listing from an encoded file.
Supports *,je, ,vbe, .asp, .hta, .htm, .html…
If used under cscript, puts the result to stdout.
The file can be multi-encoded (many scripts in the file, for ex. in an html file)
Used under wscript, pops up the decoded file in a message box.

File Name : decovbe.vbs
Requirement : none
Author : Jean-Luc Antoine
Submitted : 05/09/2001
Updated : 09/12/2001
Category : 4K

 

复制代码 代码如下:

option explicit
Dim oArgs, NomFichier
'Optional argument : the encoded filename
NomFichier=""
Set oArgs = WScript.Arguments
Select Case oArgs.Count
Case 0 'No Arg, popup a dialog box to choose the file
 NomFichier=BrowseForFolder("Choose an encoded file", &H4031, &H0011)
Case 1
 If Instr(oArgs(0),"?")=0 Then '-? ou /? => aide
  NomFichier=oArgs(0)
 End If
Case Else
 WScript.Echo "Too many parameters"
End Select
Set oArgs = Nothing

 

If NomFichier<>"" Then
 Dim fso
 Set fso=WScript.CreateObject("Scripting.FileSystemObject")
 If fso.FileExists(NomFichier) Then
  Dim fic,contenu
  Set fic = fso.OpenTextFile(NomFichier, 1)
  Contenu=fic.readAll
  fic.close
  Set fic=Nothing

  Const TagInit="#@~^" '#@~^awQAAA==
  Const TagFin="==^#~@" '& chr(0)
  Dim DebutCode, FinCode
  Do
   FinCode=0
   DebutCode=Instr(Contenu,TagInit)
   If DebutCode>0 Then
    If (Instr(DebutCode,Contenu,"==")-DebutCode)=10 Then 'If "==" follows the tag
     FinCode=Instr(DebutCode,Contenu,TagFin)
     If FinCode>0 Then
      Contenu=Left(Contenu,DebutCode-1) & _
      Decode(Mid(Contenu,DebutCode+12,FinCode-DebutCode-12-6)) & _
      Mid(Contenu,FinCode+6)
     End If
    End If
   End If
  Loop Until FinCode=0
  WScript.Echo Contenu
 Else
  WScript.Echo Nomfichier & " not found"
 End If
 Set fso=Nothing
Else
 WScript.Echo "Please give a filename"
 WScript.Echo "Usage : " & wscript.fullname  & " " & WScript.ScriptFullName & " <filename>"
End If

Function Decode(Chaine)
 Dim se,i,c,j,index,ChaineTemp
 Dim tDecode(127)
 Const Combinaison="1231232332321323132311233213233211323231311231321323112331123132"

 Set se=WSCript.CreateObject("Scripting.Encoder")
 For i=9 to 127
  tDecode(i)="JLA"
 Next
 For i=9 to 127
  ChaineTemp=Mid(se.EncodeScriptFile(".vbs",string(3,i),0,""),13,3)
  For j=1 to 3
   c=Asc(Mid(ChaineTemp,j,1))
   tDecode(c)=Left(tDecode(c),j-1) & chr(i) & Mid(tDecode(c),j+1)
  Next
 Next
 'Next line we correct a bug, otherwise a ")" could be decoded to a ">"
 tDecode(42)=Left(tDecode(42),1) & ")" & Right(tDecode(42),1)
 Set se=Nothing

 Chaine=Replace(Replace(Chaine,"@&",chr(10)),"@#",chr(13))
 Chaine=Replace(Replace(Chaine,"@*",">"),"@!","<")
 Chaine=Replace(Chaine,"@$","@")
 index=-1
 For i=1 to Len(Chaine)
  c=asc(Mid(Chaine,i,1))
  If c<128 Then index=index+1
  If (c=9) or ((c>31) and (c<128)) Then
   If (c<>60) and (c<>62) and (c<>64) Then
    Chaine=Left(Chaine,i-1) & Mid(tDecode(c),Mid(Combinaison,(index mod 64)+1,1),1) & Mid(Chaine,i+1)
   End If
  End If
 Next
 Decode=Chaine
End Function

Function BrowseForFolder(ByVal pstrPrompt, ByVal pintBrowseType, ByVal pintLocation)
 Dim ShellObject, pstrTempFolder, x
 Set ShellObject=WScript.CreateObject("Shell.Application")
 On Error Resume Next
 Set pstrTempFolder=ShellObject.BrowseForFolder(&H0,pstrPrompt,pintBrowseType,pintLocation)
 BrowseForFolder=pstrTempFolder.ParentFolder.ParseName(pstrTempFolder.Title).Path
 If Err.Number<>0 Then BrowseForFolder=""
 Set pstrTempFolder=Nothing
 Set ShellObject=Nothing
End Function



原文: http://www.interclasse.com/scripts/decovbe.php

延伸 · 阅读

精彩推荐
  • VBSVBS教程:正则表达式简介 -正则表达式语法

    VBS教程:正则表达式简介 -正则表达式语法

    正则表达式语法 一个正则表达式就是由普通字符(例如字符 a 到 z)以及特殊字符(称为元字符)组成的文字模式。该模式描述在查找文字主体时待匹配的...

    VBS教程网3302019-11-25
  • VBSVBS编程教程 (第1篇)

    VBS编程教程 (第1篇)

    VBScript的全称是:Microsoft Visual Basic Script Editon.(微软公司可视化BASIC脚本版). 正如其字面所透露的信息, VBS(VBScript的进一步简写)是基于Visual Basic的脚本语言....

    VBS教程网4812020-07-15
  • VBSAdsutil.vbs 在脚本攻击中的妙用[我非我原创]

    Adsutil.vbs 在脚本攻击中的妙用[我非我原创]

    adsutil.vbs是什么?相信用过IIS的网管员不会不知道。这是IIS自带的提供于命令行下管理IIS的一个脚本。位于%SystemDrive%\Inetpub\AdminScripts目录下。...

    VBS教程网2312020-07-07
  • VBSVBS文本文件操作实现代码

    VBS文本文件操作实现代码

    这篇文章主要介绍了VBS文本文件操作实现代码,需要的朋友可以参考下...

    VBS代码网8912020-08-12
  • VBS灵活实用VBS入门教程应用篇

    灵活实用VBS入门教程应用篇

    上一篇文章我们了解了VBS编程的一些基础知识,要更深入地学习还要学习选择结构和循环结构。 ...

    VBS教程网5742020-07-01
  • VBSWINDOWS脚本实践:为SAP补丁制作的VBS脚本代码

    WINDOWS脚本实践:为SAP补丁制作的VBS脚本代码

    本文主要分享WINDOWS脚本实践:为SAP补丁制作的VBS脚本代码,有需要的童鞋可以参考下...

    脚本之家3232020-07-06
  • VBS雷客图ASP站长安全助手vbs测试版代码

    雷客图ASP站长安全助手vbs测试版代码

    雷客图ASP站长安全助手是一个基于ASP的帮助站长维护网站安全的程序。这个版本(vbs测试版)主要用于服务器本地运行以查找ASP木马。此版本为测试版,希...

    脚本之家2312020-07-03
  • VBSVBS数组深入浅出

    VBS数组深入浅出

    VBS数组在应用中没有像其他语句那么广泛,VBS数组存在不少功能上的局限性(如二维数组的定义、赋值),在使用上也没有java等语言那么便捷...

    VBS教程网2962020-08-18