求解开jscript.encode代码的asp函数
• 经验
求解开jscript.encode代码的asp函数Java语言(一种计算机语言,尤用于创建网站)描述语言函数已经有了,有没有山杨的函数?或者有没有高手可以把下面的写成白杨的,万分感谢~!复制代码代码如下:SCRIPTLANGUAGE=JavaScript !- functiontoEncode(s,l){ enc=new ActiveX object( Scripting .编码器);returnenc .EncodeScriptFile(" . "l,s,0,l cript );}varSTATE _ COPY _ INPUT=100 varSTATE _ READLEN=101 varSTATE _ DECODE=102 varSTATE _ une scape=103varpick_encoding=newArray( 1,2,0,1,2,0,2,0,0,2,0,1,0,0,0,0,0,0,2,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,2,0,0,0,0varrawData=newArray(0x64,0x37,0x69,0x50,0x7E,0x2C,0x22,0x5A,0x65,0x4A,0x45,0x72,0x61,0x3A,0x5B,0x5E,0x79,0x66,0x5D,0x59,0x75,0x5B,0x27,0x4C,0x42,0x76,0x45,0x60,0x63,0x76,0x23,0x62,var transformed=new array()for(vari=0;i3;我)对于(vari=31,转换[I]=new array();I=126 I)for(varj=0;JBOY3乐队;j)transformed[j][rawData[(I-31)* 3j]]=(I==31)?9:我var digits=new array()for(vari=0;i26i ) {数字A .charCodeAt(0) i]=i位数a .charCodeAt(0)I]=I 26 } for(vari=0;i10I)数字[0 。charCodeAt(0) i]=i 52位[0x2b]=62位[0x2f]=63函数unescape(char){ var escapes= #!*$ varescaped=rn@ 如果(char。charcodeat(0)126)如果(转义,则返回char。(char)的索引!=-1)回车转义。substr(转义。(char)的索引,1)返回“?”}function decode base 64(string){ var val=0 val=(digits[string。substr(0,1)).charCodeAt(0)]2)val=(digits[string。substr(1,1).charCodeAt(0)]4)val=(digits[string。substr(1,1).charCodeAt(0)]0xf)12 val=((digits[string。substr(2,1)).charCodeAt(0)]2)8)val=((digits[string。substr(2,1)).charCodeAt(0)]0x 3)22)val=(digits[string。substr(3,1).charCodeAt(0)]16) returnval }函数tranencode(编码字符串){varmarker=#@~^ varstringindex=0 varscript index=-1 varuncodingindex=0 varchar=null varencodinglength=uncodinglength=0 varstate=state _ copy _ input varuncodingstring= varre,arrwhile(STATE){ switch(STATE){ case(STATE _ COPY _ INPUT):脚本索引=编码字符串。if(scriptIndex!=-1){ uncodingstring=编码字符串。substring(字符串索引,脚本索引)脚本索引=标记。length STATE=STATE _ READLEN } else { string index=string index==0?0:字符串索引un编码字符串=编码字符串。substr(字符串索引,编码字符串。长度)状态=0 }中断case(STATE _ READLEN):编码长度=编码字符串。substr(脚本索引,6)uncodinglength=decode base 64(编码长度)脚本索引=(6 == .长度)状态=状态_解码中断case(STATE_DECODE): if(!uncodinglength){ string index=脚本索引dqgaaa==^#~@.length uncoding index=0 STATE=STATE _ COPY _ INPUT break } char=编码字符串。substr(script index,1)if(char== @ )STATE=STATE _ UNESCAPE else { if(char。charcode at(0)0x ff){ uncoding string=string。from charcode(transformed[pick _ encoding[uncoding indexd]][char。charcode at(0)])uncoding index } else { uncoding string=char }脚本索引uncodinglength-break }caseSTATE _ UNESCAPE:未编码字符串=UNESCAPE(编码字符串。substr(script index,1))脚本索引;uncoding length-=2 uncoding index STATE=STATE _ DECODE break } }re=new regexp((JScript | VBscript).encode , gmi )while(arr=re。exec(未编码字符串))未编码字符串=RegExp。左上下文正则表达式.$ 1正则表达式。右上下文returnuncodingstring }/////脚本ASP不等于vbs,只是个框架而已这段代码你在脚本里加个runat=server 然后直接调用这个函数就可以了脚本语言= JavaScript runat= server .% toEncode(xxx) %