Pack.wsf WSH under the JS encryption tool Sina is also using the _ Script plus decryption

Source: Internet
Author: User
Tags constructor pack
Pack.wsf
Copy Code code as follows:

<job>

<!--Windows Scripting Host command line wrapper for Pack.js-->
<!--Run as CScript//nologo infile > OutFile-->

<script type= "Text/javascript" >
Function icommon (That) {if (that!=null) {that.inherit=common.prototype.inherit;that.specialize= Common.prototype.specialize}return that};icommon.specialize=function (p,c) {if (!p) p={};if (!c) c= P.constructor;if (C=={}.constructor) c=new function ("This.inherit ()"); C.valueof=new function ("Return  this "); C.valueof.prototype=new this.valueof;c.valueof.prototype.specialize (P);c.prototype=new  C.valueof;c.valueof.prototype.constructor=c.prototype.constructor=c;c.ancestor=this;c.specialize= Arguments.callee;c.ancestorof=this.ancestorof;return c};icommon.valueof=new function ("return  This "); Icommon.valueof.prototype={constructor:icommon,inherit:function () {return  Arguments.callee.caller.ancestor.apply (this,arguments)},specialize:function (that) {if (this== This.constructor.prototype&&this.constructor.specialize) {return  This.constructor.valueOf.prototype.specialize (that)}for (var i in that) {switch (i) {case " Constructor ": Case" toString ":Case "valueof": continue}if (typeof that[i]== "function" &&that[i]!=this[i)) {That[i].ancestor=this[i]} This[i]=that[i]}if (that.tostring!=this.tostring&&that.tostring!={}.tostring) {that.toString.ancestor= This.tostring;this.tostring=that.tostring}return this}};function common () {};this. Common=icommon.specialize ({constructor:common,tostring:function () {return "[common " + ( this.constructor.classname| | " Object ") +"] "},instanceof:function (Klass) {return this.constructor==klass| | Klass.ancestorof (This.constructor)}); Common.classname= "Common"; Common.ancestor=null; Common.ancestorof=function (Klass) {while (klass&&klass.ancestor!=this) klass=klass.ancestor;return  Boolean (Klass)}; Common.valueof.ancestor=icommon;function parsemaster () {var e=0,r=1,l=2;var g=/\ (/g,S=/\$\d/,I=/ ^\$\d+$/,t=/([' "]) \1\+ (. *) \+\1\1$/,es=/\\./g,q=/'/,de=/\x01[^\x01]*\x01/g;var self=this;this.add=function (E,R) {if (!r) r= ""; Var l= (_14 (String (e)). Match (G) | | ""). length+1;if (S.test (R)) {if (I.test (R)) {R=parseint (R.slice (1)) -1}else{var i=l;var q=q.test (_14 (R))? ' "': '"; while (i) R=r.split ("$" +i--). Join (q+ "+a[o+" +i+ "]+" +q); R=new function ("A,o", "Return" +q+r.replace (T, "$") +q)} }_31 (e| | " /^$/", r,l)};this.exec=function (s) {_3.length=0;return _28 (_5 (S,this.escapechar). Replace (new regexp , This.ignorecase? " GI ":" G "), _29), This.escapechar). Replace (DE," ")};this.reset=function () {_1.length=0};var _3=[];var _1=[ ];var _30=function () {return "(+string (This[e)). Slice (1,-1) +") "};_1.tostring=function () {return  This.join ("|")}; Function _31 () {arguments.tostring=_30;_1[_1.length]=arguments}function _29 () {if (!arguments[0]) return '; Var i=1,j=0,p;while (p=_1[j++]) {if (Arguments[i]) {Var r=p[r];switch (typeof r) {case ' function ': Return r (arguments,i); case "number": Return arguments[r+i]}var d= (Arguments[i].indexof ( Self.escapechar) ==-1)? "": "\x01" +arguments[i]+ "\x01"; return d+r}else i+=p[l]}};function&Nbsp;_5 (s,e) {Return e?s.replace (New regexp ("\" +e+ "(.)", "G"), function (m,c) {_3[_3.length]=c;return  e}): S};function _28 (s,e) {Var i=0;return e?s.replace (New regexp ("\" +e, "G"), Function ( {return e+ (_3[i++]| | "")}): S};function _14 (s) {return s.replace (ES, "")}}; Parsemaster.prototype={constructor:parsemaster,ignorecase:false,escapechar: "" "};function pack (_7,_0,_2,_8) {var i= "$"; _7+= "\ n"; _0=math.min (parseint (_0), km) FUNCTION&NBSP;_15 (s) {var i,p;for (i=0; (p=_6[i)); i++ {s=p (s)}return s};var _25=function (p,a,c,k,e,d) {while (c--) if (k[c)) P=p.replace (New regexp (' \\b ') +e (c) + ' \\b ', ' G '), k[c]; Return p};var _26=function () {if (! '). Replace (/^/,string)) {while (c--) d[e (c)]=k[c]| | E (c); K=[function (e) {return d[e]}];e=function () {return ' \\w+ '};c=1}};var _6=[];function _4 (p) {_6[ _6.LENGTH]=P};FUNCTION&NBSP;_18 (s) {var p=new parsemaster;p.escapechar= "\";p. Add (/' [^ ' \n\r]* '/,I); P.add (/"[^" \n\r]* "/,i);p. Add (/\/\/[^\n\r]*[\n\r]/,  ];p. Add (/\/\*[^*]*\*+ ([^\/][^*]*\*+) *\//, " ");p. Add (/\s+ /g?i?) /, "$");p. Add (/[^\w\x24\/' "*) \?:]\/[^\/\n\r\*][^\/\n\r]*\/g?i?/,i); if (_8) p.add (/;;; [^\n\r]+[\n\r]/);p. Add (/\ (;; \) /,i);p. Add (/;+\s* ([};]) /, "$"); S=p.exec (s);p. Add (/(\b|\x24) \s+ (\b|\x24)/, "$2 $3");p. Add ([+\-]) \s+ ([+\-])/, "$2 $3");p. Add ( /\s+/, ""); Return p.exec (s)};function _17 (s) {Var p=new parsemaster;p.add (/((\x24+)) ([A-zA-Z_ ]+)) (\d*)/,function (m,o) {Var l=m[o+2].length;var s=l-math.max (l-m[o+3].length,0); return m[o+1]. substr (s,l) +m[o+4]}); Var r=/\b_[a-za-z\d]\w*/;var k=_13 (S,_9 (R), _21); Var e=k.e;p.add (r,function (M,o) {Return e[m[o]]}); Return p.exec (s)};function _16 (s) {if (_0>62) s=_20 (s); var p=new parsemaster;var e=_ (_0); var r= (_0>62)/\w\w+/ :/\w+/;k=_13 (S,_9 (R), e); Var e=k.e;p.add (R,function (m,o) {return  e[m[o]]; return s&&_27 (P.exec (s), K)};functIon _13 (s,r,e) {Var a=s.match (R); Var so=[];var en={};var pr={};if (a) {Var u=[];var  p={};var v={};var c={};var i=a.length,j=0,w;do{w= "$" +a[--i];if (!c[w]) {c[w]=0;u[j]=w;p["$" + (V[j]=e (j))]=j++}c[w]++}while (i); I=u.length;do{w=u[--i];if (p[w]!=null) {so[p[w]]=w.slice (1);p r[p[w]]=true;c[w] =0}}while (i); U.sort (function (m1,m2) {RETURN&NBSP;C[M2]-C[M1]}) j=0;do{if (So[i]==null) so[i]=u[j++].slice (1); en[ So[i]]=v[i]}while (++i<u.length)}return{s:so,e:en,p:pr}};function _27 (p,k) {var E=_10 ("e\\ (c\\)", "G "");p = "'" +_5 (p) + "'"; Var a=math.min (k.s.length,_0) | | 1;var c=k.s.length;for (VAR&NBSP;I&NBSP;IN&NBSP;K.P) k.s[i]= ""; k= "" "+k.s.join (" | ") + "'. Split (' | ')"; Var e=_0>62?_11:_12 (a); E=string (e). replace (/_0/g, "a"). Replace (/arguments\.callee/g, "E"); var i= "C" + (a>10?). ToString (a) ":" "); if (_2) {var d=_19 (_26); if (_0>62) d=d.replace (/\\\\w/g," [\\xa1-\\xff] "); Else if (A <36) D=d.replace (e,i); if (!c) d=d.replace (_10 ("(c) \\s*=\\s*1"), "$1=0 ")}var u=string (_25); if (_2) {u=u.replace (/\{/," {"+d+;")} U=u.replace (/"/g," ""); if (_0>62) {u=u.replace (/' \\\\b ' \s*\+|\+\s* ' \\\\b '/g, "")}if (a>36| | _0>62| | _2) {u=u.replace (/\{/, "{e=" +e+ ";")} Else{u=u.replace (e,i)}u=pack (u,0,false,true); Var p=[p,a,c,k];if (_2) {p=p.concat (0, "{}")}return "eval (" +u+ "( "+p+") \ n "};function _12 (a) {return a>10?a>36?a>62?_11:_22:_23:_24};var _24=function (c) {Return c};var _23=function (c) {return c.tostring)};var _22=function (c) {return (c<_0? ') : Arguments.callee (parseint (C/_0)) + ((c=c%_0) >35? String.fromCharCode (c+29): C.tostring ())};var _11=function (c) {return (c<_0? ": Arguments.callee (C/_0)) + String.fromCharCode (c%_0+161)};var _21=function (c) {return "_" +c};function _5 (s) {Return s.replace (/[[\ \])/g, "\\$1")}; Function _20 (s) {return s.replace (/[\xa1-\xff]/g,function (m) {return "\\x" +m.charcodeat (0). toString (16) })};function _10 (s,f) {return new regexp (S.replace/\$/g, "\\$"), F)};function _19 (f) {with (String (f)) Return slice (IndexOf ("{") +1,lastindexof ("}"))}; Function _9 (R) {return new regexp (String (R). Slice (1,-1), "G")};_4 (_18); if (_8) _4 (_17); if (_0) _4 (_16 ); Return _15 (_7)};
</script>
<script type= "Text/javascript" >

var VERSION = ' 1.0.0 ';
var AUTHOR = ' Rob seiler '; * seiler@elr.com.au * *

/* GET command line arguments * *
function Js_getargs () {
var args = [];
var objargs = wscript.arguments;
if (Objargs.length > 0) {
for (var i = 0; i < objargs.length; i++) {
Args[i] = objargs (i); /* Sic-index in "()"-a object, not a array! */
}
}
return (args);
}

/* Read the input file * * *
function Js_readfile (fname) {
var s = ';
var ForReading = 1;
var fso = new ActiveXObject ("Scripting.FileSystemObject");
var ts = fso. OpenTextFile (fname, ForReading);
while (!ts. AtEndOfStream) {
s + + TS. ReadLine () + ' \ n ';
}
Ts. Close ();
return (s);
}

/* Show help if needed-eg 0 command line arguments * *
function Js_help () {
WScript.Echo (' Compress and encode a Javascript source file using Dean Edwards ' Packer ');
WScript.Echo (' version: ' + version);
WScript.Echo (' Syntax:program sourcefile [_encoding] [_fastdecode] [_specialchars]\n ');
}

/* Main program:get arguments; Read input file; Output Packed String * *
function Main () {
var params = [];
params = Js_getargs ();
Params[1] = (typeof (params[1]) = = ' undefined ')? 62:PARAMS[1]; -dean:changed defaults
PARAMS[2] = (typeof (params[2]) = = ' undefined ')? 1:PARAMS[2];
PARAMS[3] = (typeof (params[3]) = = ' undefined ')? 0:PARAMS[3];
if (Params[0] > ') {
var $script = Js_readfile (Params[0]);
if ($script > ') {
$script = Pack ($script, params[1], params[2], params[3]); * * Returns the Dean Edwards "packed" String * *
WScript.Echo ($script);
}
else {js_help ();}
}
else {js_help ();}
}

* Do the job * *
Main ();
</script>

</job>

Test.bat
Copy Code code as follows:

Cscript/nologo pack.wsf test.js >> test-p.js

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.