今天在删自己的黑历史时,突然发现了几个VBS文件。。发现了以前写的vbs代码加密器。
[mb_view]手机上就别玩了 😯 至于为什么你懂的[/mb_view]
首先,我们都知道,VBS代码可以直接被看到的,[v_act] 😯 不知道VBS的是什么,度娘会告诉你的。[/v_act]
下面这个程序可以对VBS代码进行简单的加密,原理灰常简单,
- 1.读取源文件的所有代码
- 1.读取源文件的所有代码
- 2.计算Asc值
- 3.写入,Execute用Chr还原后的代码。
废话不多说 😯 [才不会告诉你我没话说了]上代码
代码:
加密:
On Error Resume Next Set argv = WScript.Arguments If argv.Count = 0 Then WScript.Quit Set fso = CreateObject("scripting.filesystemobject") With fso.OpenTextFile(argv(0),1) data = .ReadAll : .Close End With With fso.OpenTextFile(argv(0)&".txt",2,True) .WriteLine "data="&Chr(34)&ASCdata(data)&Chr(34) .WriteLine "Function ChrData(Data)" .WriteLine "MyArray = Split(Data, "","", -1, 1)" .WriteLine "For each OldData in MyArray" .WriteLine "Newdata=NewData"&Chr(38)&"chr(OldData)" .WriteLine "Next" .WriteLine "ChrData=NewData" .WriteLine "End Function" .WriteLine "execute Chrdata(data)" .Close End With MsgBox "OK!",,"Encrypt" Function ASCdata(Data) num=len(data) newdata="" For j=1 to num If j=num then newdata=newdata&asc(mid(data,j,1)) Else newdata=newdata&asc(mid(data,j,1))&"," End If Next ASCdata=newdata End function
[v_act]保存上面代码为VBS[*.vbs],将欲加密文件拖入,生成加密后的txt[/v_act]
解密:
on error resume next set fso=createobject("scripting.filesystemobject") set ws=createobject("wscript.shell") Set objDialog = CreateObject("UserAccounts.CommonDialog") objDialog.Filter = "vbs File|*.vbs|All Files|*.*" objDialog.InitialDir = "" objDialog.ShowOpen strLoadFile = objDialog.FileName if not strLoadFile = "" then set file=fso.opentextfile(strLoadFile,1) all=file.readall file.close s=instr(1,all,"next") alls=mid(all,1, s+3 ) set file=fso.createtextfile(strLoadFile,8,true) file.write alls file.writeline empty file.writeline"set fso=createobject("&""""&"scripting.filesystemobject"&""""&")" file.writeline"set file=fso.createtextfile(wscript.scriptfullname,8,true)" file.writeline"file.write runner" file.writeline"file.close" file.close ws.run""""&strLoadFile&"""",0,true msgbox"解密成功!",4096+64 end if
[v_act]保存上面代码为VBS[*.vbs],将欲解密文件拖入,生成解密后的txt[/v_act]
发表回复