网络编程
位置:首页>> 网络编程>> Asp编程>> Shellcode加密解密函数

Shellcode加密解密函数

作者:Bin 来源:Bin博客 发布时间:2009-04-24 11:18:00 

标签:shellcode,加密,解密,函数

不知道写得对不对啊!错了再改吧!

加密函数

Function Encodestr(s,xorstr)
Dim en
For i=1 To Len(s)
    en = en & hex (Asc(Mid(s,i,1)) Xor "&h"&xorstr)
Next
If Len(s) Mod 2 >0 Then 
    en = en & "00"
End If     
Set regex=new regExp
     regex.pattern="(..)(..)"
     regex.IgnoreCase=true
     regex.global=true
     matches=regex.replace(en,"%u$2$1")
  Encodestr=LCase(matches)
End Function

解密函数

Function Decodestr(s,xorstr)
Dim de,destr
de=Replace(s,"%u","")
set regex=new regExp
     regex.pattern="(..)(..)"
     regex.IgnoreCase=true
     regex.global=true
     matches=regex.replace(de,"$2$1")
For i = 1 To Len(matches) step 2
     hexTmp = Mid(matches,i,2)
     If hexTmp <> "00" Then
     destr = destr & CHR(CLng("&h" & hexTmp) Xor "&h"&xorstr)
     End If
Next
Decodestr=LCase(destr)
End Function 

 

0
投稿

猜你喜欢

手机版 网络编程 asp之家 www.aspxhome.com