javascript之ESC(第二类混淆)


Posted in Javascript onMay 06, 2007

ESC(第二类混淆)
GNU项目
http://www.saltstorm.net/downloads/esc/ESC.zip

将以下代码保存为
ESC.wsf

<?xml version="1.0"?> 
<!-- Generated by Soya.IO.WSFFactory v0.95 [Sun, 6 Feb 2005 20:19:57 UTC] --> 
<package> 
<job> 
<?job error="false" debug="false" ?> 
<resource id="about"> 
----------------------------------------------------------------------------- 
  ESC (ECMAScript Cruncher) 
  * Version       : 1.13 
  * Date          : 2005-02-06 21:19:57 [+0100] 
  * License       : GNU GPL (http://www.gnu.org/copyleft/gpl.txt) 
  * Copyright (C) 2001-2005 Thomas Loo <tloo@saltstorm.net>   --------------------------------------------------------------------------- 
  ESC is an ECMAScript(*) pre-processor enabling an unlimited number of 
  external scripts to be compressed/crunched into tight, bandwidth-optimized 
  packages. ESC supports compressing of external sources only. Trying to 
  process scripts inlined in HTML, ASP, PHP or equivalent pages are NOT 
  recommended with this version of ESC. This feature might be added in a 
  future version. Type "cscript ESC.wsf -help" for usage instructions. 
  ESC is built using components from the Soya Scripting API 1.0.0-b10, 
  a uni-host/cross-browser ECMAScript compliant class-library distributed 
  freely under the terms of the BSD License. The Soya Scripting API, 
  'lib-soya' and the Soya SDK can be found at http://www.saltstorm.net/ 
  --------------------------------------------------------------------------- 
  * ECMAScript is the international standard for javascript. 
----------------------------------------------------------------------------- 
</resource> 
<resource id="copyright"> 
----------------------------------------------------------------------------- 
  This program is free software; you can redistribute it and/or modify 
  it under the terms of the GNU General Public License as published by 
  the Free Software Foundation; either version 2 of the License, or 
  (at your option) any later version. 
  This program is distributed in the hope that it will be useful, 
  but WITHOUT ANY WARRANTY; without even the implied warranty of 
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
  GNU General Public License for more details. 
  You should have received a copy of the GNU General Public License 
  along with this program; if not, write to the Free Software 
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
----------------------------------------------------------------------------- 
</resource> 
<resource id="usage"> 
------------------------------------------------------------------------------ 
 Usage: cscript ESC.wsf -l [0-4] -ow output.js foo.js bar.js C:\scripts\baz... 
 ----------------------------------------------------------------------------- 
  -a  [-about]             : Description page 
  -c  [-copyright]         : Copyright/license notice 
  -e  [-example]           : Examples of usage 
  -h  [-help]              : This help-screen 
 ----------------------------------------------------------------------------- 
  -l  [-level]   [01(2)34] : [optional] Set crunch-level (4 sets -$ on) 
  -s  [-silent]            : [optional] Run silent, nada stdout 
  -v  [-verbose]           : [optional] Run in verbose mode 
  -$                       : [optional] Activate variable-substitution engine 
 ----------------------------------------------------------------------------- 
  -oa <filename>           : Target filename for appending 
  -ow <filename>           : Target filename for writing 
  -ow STDOUT               : Write stream to STDOUT 
 ----------------------------------------------------------------------------- 
 <input-file(s)>           : [required] 
  file(s) and/or directories containing scripts to crunch... 
  (paths containing spaces must be quoted) 
</resource> 
<resource id="example"> 
----------------------------------------------------------------------------- 
 Examples of usage. 
  Crunch 'original1.js','original2.js' and 'original3.js' at 
  level 2 (default) and save the output as 'crunched.js'. 
  Any previous file named 'crunched.js' will be overwritten. 
   X:\cscript ESC.wsf -ow crunched.js original1.js original2.js original3.js 
  --------------------------------------------------------------------------- 
  Grab all scriptfiles (.js) in directory 'C:\script-directory' and crunch 
  them at level 1 (comment and empty line removal only) and append the result 
  to 'crunched.js'. If 'crunched.js' doesn't exist, it will be created. 
   X:\cscript ESC.wsf -l 1 -oa crunched.js C:\script-directory 
  --------------------------------------------------------------------------- 
  Subject 'original1.js' and 'original2.js' for variable substitution, 
  but perform no comment or whitespace removal. 
  Redirect output to STDOUT instead of writing to file. 
   X:\cscript ESC.wsf -l 0 -$ -ow STDOUT original1.js original2.js 
  --------------------------------------------------------------------------- 
  Crunch 'original.js' using variable substitution and remove 
  any occurance of whitespace (where permitted...) 
  and save it as 'crunched.js' (equals -l 3 -$) 
   X:\cscript ESC.wsf -l 4 -ow crunched.js original.js 
  --------------------------------------------------------------------------- 
 Try 'ESC.wsf -help' for information about available run-time directives. 
----------------------------------------------------------------------------- 
</resource> 
<resource id="wscript"> 
ESC must be run from a DOS command prompt under     
cscript.exe. Do you want to switch host and have 
ESC bring up a helpscreen ? 
</resource> 
<resource id="jscript"> 
ESC needs JScript 5.5 or higher to score... 
You need to update your version of JScript to run ESC. 
Read the 'Requirements' section in the manual for information 
how to obtain and install the latest version of Microsofts 
'Windows Script' package. 
</resource> 
<resource id="common.map"> 
Anchor 
ActiveXObject 
Call 
Closure 
Components 
Dictionary 
Document 
DOMParser 
Embed 
EvalError 
Event 
Form 
Global 
HttpCookie 
Image 
JavaArray 
JavaClass 
JavaMethod 
JavaObject 
JavaPackage 
Layer 
MimeType 
MimeTypeArray 
Option 
Url 
Packages 
Plugin 
PluginArray 
Popup 
RangeError 
ReferenceError 
TypeError 
StyleClass 
StyleSelector 
SyntaxError 
TypeError 
WScript 
URIError 
XMLHttpRequest 
XMLSerializer 
XPathEvaluator 
XSLTDocument 
XSLTProcessor 
Attr 
CDATASection 
CharacterData 
Comment 
CSS2Properties 
DOMException 
DOMImplementation 
DocumentType 
Element 
EntityReference 
EvalError 
NamedNodeMap 
Node 
NodeList 
Notation 
ProcessingInstruction 
Text 
HTMLElement 
HTMLDocument 
HTMLCollection 
HTMLHtmlElement 
HTMLHeadElement 
HTMLLinkElement 
HTMLTitleElement 
HTMLMetaElement 
HTMLBaseElement 
HTMLIsIndexElement 
HTMLStyleElement 
HTMLBodyElement 
HTMLFormElement 
HTMLSelectElement 
HTMLOptGroupElement 
HTMLOptionElement 
HTMLInputElement 
HTMLTextAreaElement 
HTMLButtonElement 
HTMLLabelElement 
HTMLFieldSetElement 
HTMLLegendElement 
HTMLUListElement 
HTMLOListElement  
HTMLDListElement 
HTMLDirectoryElement 
HTMLMenuElement 
HTMLLIElement 
HTMLBlockquoteElement  
HTMLDivElement 
HTMLParagraphElement 
HTMLHeadingElement 
HTMLQuoteElement 
HTMLPreElement 
HTMLBRElement 
HTMLBaseFontElement  
HTMLFontElement 
HTMLHRElement 
HTMLModElement  
HTMLAnchorElement 
HTMLImageElement 
HTMLObjectElement 
HTMLParamElement 
HTMLAppletElement 
HTMLMapElement 
HTMLAreaElement 
HTMLScriptElement 
HTMLTableElement 
HTMLTableCaptionElement 
HTMLTableColElement 
HTMLTableSectionElement 
HTMLTableRowElement 
HTMLTableCellElement 
HTMLFrameSetElement 
HTMLFrameElement 
HTMLIFrameElement 
_newEnum 
alert 
atob 
attachEvent 
back 
btoa 
captureEvents 
clearTimeout 
clearInterval 
close 
CollectGarbage 
confirm 
createEventObject  
createPopup 
decodeURI 
decodeURIComponent 
detachEvent 
dump 
encodeURI 
encodeURIComponent 
escape 
eval 
execScript 
find 
forward 
frameElement 
getAttention 
GetAttention 
getClass 
getComputedStyle 
getResource 
GetObject 
home 
isFinite 
isNaN 
moveBy 
moveTo 
open 
openDialog 
parseInt 
parseFloat 
print 
prompt 
releaseEvents 
resizeBy 
resizeTo 
ScriptEngine 
ScriptEngineMajorVersion 
ScriptEngineMinorVersion 
ScriptEngineBuildVersion     
scroll 
scrollBy 
scrollByLines 
scrollByPages 
scrollIntoView 
scrollTo 
setCursor 
setInterval 
setTimeout 
showHelp 
showModalDialog 
showModelessDialog 
sizeToContent 
stop 
taint 
toString 
updateCommands 
unescape 
untaint 
valueOf 
_content 
appCore 
arguments 
arity 
callee 
caller 
clientInformation 
clipboardData 
closed 
constructor 
controllers 
crypto 
debug 
defaultStatus 
directories 
document 
element 
event 
external 
history 
forward 
frames 
Infinity 
innerHeight 
innerWidth 
java 
length 
loading 
location 
locationbar 
name 
menubar 
navigator 
netscape 
offscreenBuffering 
opener 
opera 
outerHeight 
outerWidth 
pageXOffset 
pageYOffset 
parent 
personalbar 
pkcs11 
prompter 
prototype 
returnValue 
screen 
screenLeft 
screenTop 
screenX 
screenY 
scrollX 
scrollY 
scrollbars 
self 
sidebar 
status 
statusbar 
style 
sun 
title 
toolbar 
top 
window 
onafterprint 
onbeforeprint 
onbeforeunload 
onblur 
onchange 
onclick 
onclose 
onerror 
onfocus 
onhelp 
onload 
onresize 
onreset 
onscroll 
onselect 
onunload 
onmousedown 
onmouseup 
onmouseover 
onmouseout 
onkeydown 
onkeyup 
onkeypress 
onmousemove 
onsubmit 
onreset 
onchange 
onselect 
onclose 
onabort 
onerror 
onpaint 
ondragdrop 
Soya 
BOOTSTRAP 
</resource> 
<resource id="core.map"> 
abstract 
break 
continue 
const 
class 
catch 
case 
debugger 
default 
double 
delete 
do 
enum 
extends 
else 
function 
finally 
float 
false 
for 
get 
instanceof 
implements 
import 
int 
in 
if 
long 
null 
new 
protected 
private 
package 
public 
return 
switch 
static 
super 
set 
typeof 
throw 
true 
this 
try 
undefined 
void 
var 
while 
with 
getter 
setter 
__defineGetter__ 
__defineSetter__ 
end 
elif  
cc_on  
_win32 
_win16 
_mac 
_alpha 
_x86 
_mc680x0 
_PowerPC 
_jscript 
_jscript_build 
_jscript_version 
Array 
Boolean 
Date 
Enumerator 
Error 
Function 
Math 
Number 
Object 
RegExp 
String 
VBArray 
</resource> 
<script language="JScript"> 
<![CDATA[ 
/*** <POD [ESCtool] (Soya/1.0.0-b10; crlvl:2/1; Sun, 6 Feb 2005 20:19:58 UTC)> ***/ 
/** 
Proving that ESC actually can handle name-mangling and as a general self-sanity 
 check, ESC has been used to compress itself along with other required Soya-beans 
 while creating the package you see below. To examine these beans in a more human 
 readable form, get the latest distribution of the Soya API. 
**/ 
function Soya_API($h) 
{ 
this.name='Soya'; 
this.version='1.0.0-b10'; 
this.type='static'; 
this.debug=0; 
this.host=$h; 
this.libPath='/lib-soya/'; 
this.podPath='pods'; 
this.resourcePath='resources'; 
this.attachBean=$a; 
this.declareBean=$b; 
this.registerBean=$c; 
this.BeanPrototype=Soya_BeanPrototype; 
this.beans=new Object(); 
this.beans.all=new Array(); 
Soya_Loader.prototype=new this.BeanPrototype(); 
this.Loader=new Object(); 
this.Loader.orphans=new Array(); 
this.Loader.callbacks=new Object(); 
this.declareBean('Soya.BeanPrototype',null,this.name,false,true); 
} 
function Soya_VirtualBean(){} 
function Soya_BeanPrototype(){ 
this.name='Soya.BeanPrototype'; 
} 
function $a($i){ 
if(!$i.virtual){ 
eval($i.mutexName).prototype=$i; 
eval($i.name+'='+(!$i.constructable?'new ':' ')+ 
$i.mutexName+(!$i.constructable?'()':'')); 
} 
else eval($i.name+'=this.beans["'+$i.name+'"]'); 
$i.complete=true; 
if(this.Loader&&this.Loader.callbacks[$i.name]) 
this.Loader.callbacks[$i.name](eval($i.name)); 
} 
function $b($j,$k,$l,$m,$n){ 
var $o=$k?new this.BeanPrototype():new Soya_VirtualBean(); 
$o.name=$j; 
$o.mutexName=$k||'Soya_VirtualBean'; 
$o.parentName=$l; 
$o.iid=0; 
$o.stack=new Array(); 
$o.complete=Boolean($n); 
$o.constructable=($k&&!$m); 
$o.virtual=!$k; 
return(this.beans[$j]=this.beans.all[this.beans.all.length]=$o); 
} 
function $c($j,$m,$p,i){ 
var $q; 
var $r=$j.split('\x2e'); 
var $k=$r.join('\x5f'); 
if(!this.beans[$j]){ 
if($p){ 
var $s=''; 
$q=$r[0]; 
for(i=1;i<$r.length-1;i++){ 
$s+=$q; 
$q+=('\x2e'+$r[i]); 
if(i<=$p&&!this.beans[$q]) 
this.attachBean(this.declareBean($q,null,$s,true,true)); 
} 
} 
$r.length-=$p?$p:1; 
$q=$r.join('\x2e'); 
this.declareBean($j,$k,$q,$m); 
if($r.length>1&&!this.beans[$q]) 
this.Loader.orphans[this.Loader.orphans.length]=this.beans[$j]; 
else{ 
this.attachBean(this.beans[$j]); 
var $t=new Array(); 
for(i=0;i<this.Loader.orphans.length;i++) 
if(this.Loader.orphans[i].parentName==$j) 
this.attachBean(this.Loader.orphans[i]); 
else $t[$t.length]=this.Loader.orphans[i]; 
this.Loader.orphans=$t; 
} 
} 
return Boolean(i) 
} 
function $d($u){ 
this.getResourcePath=Function('sName', 
"return(Soya.libPath + Soya.resourcePath + '/' + (sName||this.name).split('.').join('/') + '/')"); 
this.getClass=Function('sName','return eval(Soya.beans[sName || this.name].mutexName)'); 
this.toString=Function("return('[object ' + (this.name || 'noname') + ']')"); 
this.getBeanPath=Function('sName', 
"return(Soya.libPath + (sName||this.name).split('.').join('/') + '.js')"); 
this.type='static'; 
if(!$u){ 
this.finalize=$f; 
this.initialize=$e; 
} 
} 
function $e($v){ 
this.iid=this.getClass().prototype.iid++; 
if(this.stackable) 
this.stack[this.iid]=this; 
if(!Soya.beans[this.name].initialized){ 
$v=$v|| 
Soya.host[Soya.beans[this.name].mutexName+'_initialize']; 
if(typeof($v)=='function') 
Soya.beans[this.name].initialized=!$v(this.getClass(),this); 
} 
} 
function $f($w){ 
$w=$w|| 
Soya.host[Soya.beans[this.name].mutexName+'_finalize']; 
if(typeof($w)=='function') 
$w(this.getClass(),this); 
} 
function Soya_Loader(){}; 
function $g($x,$y,$z){ 
if(!Soya.fso) 
Soya.fso=new ActiveXObject('Scripting.FilesystemObject'); 
if(Soya.fso.FileExists($x)){ 
var $i=Soya.fso.GetFile($x), 
$A=Soya.fso.OpenTextFile($i.Path), 
$B=$A.Read($z||$i.Size); 
$A.Close(); 
return $B; 
} 
else if(!$y) 
return(WScript.Echo(this.name+' '+Soya.version+ 
'> File Not found: '+$x),WScript.Quit(99)); 
else return ''; 
} 
Soya_BeanPrototype.prototype=new $d(0); 
Soya_VirtualBean.prototype=new $d(1); 
Soya_API.prototype=new $d(1); 
var Soya=new Soya_API(this); 
if(typeof(BOOTSTRAP)=='function')BOOTSTRAP(Soya); 
function Soya_Common() 
{ 
this.name='Soya.Common'; 
this.type='static'; 
this.version='1.03'; 
this.dependencies=[]; 
this.destroy=$E; 
this.makeFunction=$G; 
this.typematch=$F; 
this.getObject=$C; 
this.$ih=$H; 
Function.prototype.getArguments=$D; 
Soya.BeanPrototype.prototype.Extends= 
Function('oBean','bOvr','Soya.Common.$ih(oBean, this, bOvr)'); 
Soya.BeanPrototype.prototype.Implements= 
Function('oBean','bOvr','Soya.Common.$ih(this, oBean, bOvr)'); 
this.interfaces=new Object(); 
this.interfaces['Scripting.FilesystemObject']=Soya.fso; 
} 
function $C($I,$J){ 
if(typeof(this.interfaces[$I])=='undefined'){ 
if(typeof ActiveXObject=='function'){ 
Soya.host.msieax=null; 
if(typeof Error=='function') 
eval('try{Soya.host.msieax=new ActiveXObject("'+$I+'")}catch(e){}'); 
else{ 
var $K=String("on error resume next\nself.msieax=CreateObject('"+$I+"'))"); 
self.execScript($K,'vbscript'); 
} 
if(!$J) 
return Soya.host.msieax; 
this.interfaces[$I]=Soya.host.msieax; 
} 
} 
return this.interfaces[$I]||void(0); 
} 
function $D($L){ 
var $M=[], 
$N=(isNaN($L)||$L<1)? 
0:Math.min($L,this.arguments.length); 
for(;$N<this.arguments.length;$N++) 
$M[$M.length]=this.arguments[$N]; 
return $M; 
} 
function $E($O){ 
if($O!=null&&typeof($O)=='object') 
for(var $P in $O){ 
if(typeof($O[$P])=='object'&&$O[$P]) 
if($O[$P].constructor&&!$O[$P].style){ 
this.destroy($O[$P]); 
delete($O[$P]); 
} 
else $O[$P]=null; 
} 
} 
function $F($Q,$R){ 
var $S; 
switch(typeof($Q)){ 
case 'number':$S=2;break; 
case 'boolean':$S=4;break; 
case 'string':$S=8;break; 
case 'function':$S=16;break; 
case 'object':$S=32;break; 
default:$S=1;break; 
} 
return Boolean($S&($R||62)); 
} 
function $G($T){ 
if($T&&this.typematch($T,16)) 
return $T; 
else return Function(($T&&this.typematch($T,8))?$T:''); 
} 
function $H($U,$V,$W){ 
for(var $P in $U) 
if($P!='name'&&(!$W||typeof($V[$P])=='undefined')) 
$V[$P]=$U[$P]; 
} 
if(typeof(Soya)=='object')Soya.registerBean('Soya.Common',true); 
function Soya_WSH() 
{ 
this.name='Soya.WSH'; 
this.type='static'; 
this.version='0.88'; 
this.dependencies=['Soya.Common','Soya.WSH.Registry']; 
this.osInfo={}; 
this.arguments={length:0}; 
this.$09=function($00) 
{return $00.length<2?$00:$00.replace(/^\\-/,'-').replace(/\\{2}/g,'\\')}; 
this.getArgument=function($01){return(this.arguments[$01]||"")} 
this.getArguments=$X; 
this.getOSInfo=$Z; 
this.getShell=$Y; 
} 
function $X(){ 
if(!this.arguments.length&&WScript.Arguments.length){ 
var i,$02,$03=[],$04=new RegExp('^-+'); 
for(i=0;i<WScript.Arguments.length;i++) 
$03[$03.length]=WScript.Arguments.item(i); 
for(i=0;i<$03.length;i++){ 
$02=$03[i].replace($04,'-'); 
if($02.length>1&&$04.test($02)){ 
if(typeof $03[i+1]!='undefined'&&!$04.test($03[i+1])) 
this.arguments[this.$09($02.replace($04,''))]= 
this.$09($03[1+(i++)]); 
else this.arguments[this.$09($02.replace($04,''))]=1; 
}; 
else if($02.length) 
this.arguments[this.arguments.length++]=this.$09($03[i]); 
} 
} 
return this.arguments; 
} 
function $Y(){ 
if(!this.shell) 
this.shell=Soya.Common.getObject('WScript.Shell'); 
return this.shell; 
} 
function $Z(){ 
if(this.osInfo.$0a) 
return this.osInfo; 
var $05=Soya.Common.getObject('Scripting.FilesystemObject'), 
$06=this.getShell().ExpandEnvironmentStrings("%SYSTEMROOT%"); 
this.osInfo.MSIEVersion=Soya.WSH.Registry.regRead('HKLM\\SOFTWARE\\Microsoft\\Internet Explorer\\Version'); 
this.osInfo.NETVersion=Soya.WSH.Registry.regRead('HKLM\SOFTWARE\Microsoft\.NETFramework\\Version')||-1; 
this.osInfo.SPVersion=Soya.WSH.Registry.regRead('HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CSDVersion')||-1; 
this.osInfo.JSVersion=parseFloat(ScriptEngineMajorVersion()+'.'+ScriptEngineMinorVersion()); 
if($05.FolderExists($06+'\\system32')) 
$07=$05.GetFileVersion($06+'\\system32\\kernel32.dll'); 
else if($05.FolderExists($06+'\\system')) 
$07=$05.GetFileVersion($06+'\\system\\kernel32.dll'); 
if($07){ 
/^(\d)\.(\d+)\.(\d+)\.\d+$/.test($07); 
this.osInfo.majorVersion=parseInt(RegExp.$1); 
this.osInfo.minorVersion=parseInt(RegExp.$2,10); 
this.osInfo.buildVersion=parseInt(RegExp.$3,10); 
this.osInfo.version=$07; 
var $08={ 
'4.00.950':'Win95', 
'4.00.1111':'Win95 OSR2', 
'4.00.1381':'WinNT', 
'4.10.1998':'Win98', 
'4.10.2222':'Win98SE', 
'4.90.3000':'WinME', 
'5.0.2195':'Win2K', 
'5.10.2600':'WinXP' 
}; 
this.osInfo.name=$08[$07.replace(/\.\d+$/,'')]||'unknown'; 
} 
this.osInfo.$0a=1; 
return this.osInfo; 
} 
if(typeof(Soya)=='object')Soya.registerBean('Soya.WSH',true); 
function Soya_Saltstorm_ESC($0s,$0t,$0u,$y) 
{ 
this.name='Soya.Saltstorm.ESC'; 
this.version='1.13'; 
this.type='constructor'; 
this.dependencies=['Soya.Common','Soya.ECMA.Array']; 
this.resourcePath=$0u||''; 
this.crunchLevel=$0s||2; 
this.substitute=false; 
this.verbose=$0t; 
this.silent=($y||typeof window=='object'); 
this.initialize(); 
this.flush(); 
} 
function Soya_Saltstorm_ESC_initialize($0v,$0w){ 
$0x=$0w; 
var $0y="(?:\"{2}|'{2}|\".*?.\"|'.*?.'|\\/(?!\\*|\\/)..*?\\/)"; 
var $0z="[-!%&;<=>~:\\/\\^\\+\\|\\,\\(\\)\\*\\?\\[\\]\\{\\}]+"; 
var $0A="\\/\\*(?!@).(?:.|\\n)*?\\*\\/|\\/\\/.*"; 
var $0B="\".*?.\"|'.*?.'|\\s*\\/{2,}.*\\n"; 
var $0C="\\}[\\s\\n]*?([^;,ce\\|\\.\\]\\)\\}])"; 
with($0v){ 
prototype.fileFilter=new RegExp('.+\\\\(?!$|_)\\w*\\.js$','i'); 
prototype.$1n=["0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",9]; 
prototype.$1o={}; 
prototype.fso=Soya.Loader.fso||new ActiveXObject('Scripting.FilesystemObject'); 
prototype.core={}; 
prototype.bless={}; 
prototype.mangle={}; 
prototype.common={}; 
prototype.$1p=$g; 
prototype.crunch=$0q; 
prototype.flush=function(){this.buffer='';this.report=new $0c()}; 
prototype.getSubstitute=$0g; 
prototype.loadMaps=$0d; 
prototype.out=$0b; 
prototype.load=$0e; 
prototype.save=$0f; 
prototype.getReport=$0r; 
prototype.$1q=new RegExp("[$_]"); 
prototype.$1r=new RegExp("[^$\\w]","g"); 
prototype.$1s=new RegExp("^[\\x00\\.\"']"); 
prototype.$1t=new RegExp("\\s+$"); 
prototype.$1u=new RegExp("^\\s*\\W"); 
prototype.$1v=new RegExp("^[-\\\\+\"~'!]"); 
prototype.$1w=new RegExp("("+$0y+")|("+$0A+")","g"); 
prototype.$1x=new RegExp("("+$0B+")","g"); 
prototype.$1y=new RegExp("("+$0y+")|(\\r?\\n\\s+)|(\\x20{2,})","g"); 
prototype.$1z=new RegExp("("+$0y+")|(\\w+)?[ \\t]+("+$0z+")","g"); 
prototype.$1A=new RegExp("("+$0y+")|("+$0z+")[ \\t]+","g"); 
prototype.$1B=new RegExp("("+$0y+")|function[\\n\\s]+([$\\w]+)","g"); 
prototype.$1C=new RegExp("("+$0y+")|("+$0A+")|(\\W[\\n\\s]*?[$\\w]+)\\b","gm"); 
prototype.$1D=new RegExp("("+$0y+")|(\\x00)|\\.[\\n\\s]*?([$_][$\\w]{3,})","g"); 
prototype.$1E=new RegExp("("+$0y+")|("+$0C+")","g"); 
} 
} 
function $0b($0D,$0E){ 
if(!this.silent){ 
var $0F=String((!$0E?'ESC> ':'')+($0D||'')); 
WScript.Echo($0F); 
} 
} 
function $0c(){ 
this.scripts=[]; 
this.rawSize= 
this.crunchedSize= 
this.elapsedTime=0; 
} 
function $0d(){ 
if(this.$1F) 
return; 
var $0G,$0H,$0I,$0J,$0K; 
for(var i=0;i<arguments.length;i++){ 
$0G=arguments[i].replace(/\W.+$/,''); 
try{ 
$0I=getResource(arguments[i]).split(/\r?\n/g)||[]; 
for(var j=0;j<$0I.length;j++) 
if($0I[j].length&&!$0x.$1u.test($0I[j])) 
Soya_Saltstorm_ESC.prototype[$0G][$0I[j].replace($0x.$1t,'')]=1; 
if(this.verbose) 
this.out('Parsed map "'+$0G+'", '+$0I.length+' entries.') 
} 
catch($0L){ 
if($0L) 
$0I=null; 
} 
if($0I) 
continue; 
else $0H=this.fso.BuildPath(this.resourcePath,arguments[i]); 
if(/^common|core/.test(arguments[i])&&!this.fso.FileExists($0H)){ 
this.out('Couldn\'t $0M $0N:'+ 
this.fso.GetAbsolutePathName($0H)); 
return WScript.Quit(99); 
} 
else if(typeof this[$0G]!='object'){ 
this.out('Unrecognized mapname : '+$0G); 
return WScript.Quit(99); 
} 
else if(this.fso.FileExists($0H)){ 
$0I=this.fso.OpenTextFile($0H); 
$0K=0; 
while(!$0I.AtEndOfStream){ 
$0J=$0I.ReadLine(); 
if($0J.length&&!$0x.$1u.test($0J)) 
Soya_Saltstorm_ESC.prototype[$0G][$0J.replace($0x.$1t,'')]=++$0K; 
} 
$0I.Close(); 
Soya_Saltstorm_ESC.prototype[$0G].length=$0K; 
if(this.verbose) 
this.out('Loaded map "'+$0G+'", '+$0K+' entries. ['+$0H+']'); 
} 
} 
this.$1F=1; 
} 
function $0e(){ 
var i,$0O,$0P,$0Q,$0R=[]; 
for(i=0;i<arguments.length;i++){ 
if(arguments[i]&&this.fso.FolderExists(arguments[i])){ 
$0Q=new Enumerator(this.fso.GetFolder(arguments[i]).SubFolders); 
for(;!$0Q.atEnd();$0Q.moveNext()) 
arguments[arguments.length++]=$0Q.item().Path; 
$0Q=new Enumerator(this.fso.GetFolder(arguments[i]).Files); 
for(;!$0Q.atEnd();$0Q.moveNext()) 
if($0Q.item().Size&&this.fileFilter.test($0Q.item().Path)) 
$0R.push($0Q.item().Path); 
} 
else if(arguments[i]) 
$0R.push(arguments[i]); 
} 
for(i=0;i<$0R.length;i++){ 
if(!this.fso.FileExists($0R[i])){ 
this.out('Couldn\'t $0M $0S:"' + this.fso.GetAbsolutePathName(aLoadQueue[i]) + '"'); 
return WScript.Quit(99); 
} 
else if(this.verbose) 
this.out('Loading script :"'+this.fso.GetAbsolutePathName($0R[i])+'"'); 
$0P=this.fso.GetFile($0R[i]); 
this.buffer+=(this.report.scripts.length?'\r\n':''); 
this.buffer+=this.$1p($0P.Path,true); 
this.report.scripts.push( 
$0P.Path+' ('+($0P.Size/1024).toFixed(2)+' kb)'); 
} 
return $0R.length; 
} 
function $0f($0T,$0U){ 
var $0V; 
if(!$0T){ 
this.out('Need an output filename!'); 
return WScript.Quit(99); 
} 
else if(this.fso.FolderExists($0T)){ 
this.out('Need an output filename, "'+ 
this.fso.GetAbsolutePathName($0T)+'" is a folder.'); 
return WScript.Quit(99); 
} 
this.outFile=this.fso.GetAbsolutePathName($0T); 
this.outMode=$0U?'Writing':'Appending'; 
$0V=this.fso.OpenTextFile(this.outFile,($0U?2:8),true); 
$0V.WriteLine(this.buffer); 
$0V.Close(); 
} 
function $0g($0W){ 
if(!this.$1o[$0W]){ 
var k=1; 
while(k<5){ 
this.$1n[k]++; 
if(this.$1n[k]&&!(this.$1n[k]%62)){ 
k++; 
if(this.$1n.length==k) 
this.$1n[k]=-1; 
} 
else break; 
} 
this.$1o[$0W]='$'; 
for(k=this.$1n.length-1;k>0;k--) 
this.$1o[$0W]+=this.$1n[0].charAt(this.$1n[k]%62); 
if(this.verbose) 
this.out('Substituting ['+this.$1o[$0W]+'] -> ['+$0W+']'); 
} 
return this.$1o[$0W]; 
} 
function $0h($0X,$0Y,$0Z){ 
if(typeof $0Z!='undefined') 
return ''; 
else return $0X; 
} 
function $0i($0X,$10){ 
if(typeof $10!='undefined'&&/^\s+/.test($10)) 
return '\r\n'; 
else return $0X; 
} 
function $0j($0X,$11,$12){ 
if(typeof $11!='undefined') 
return $0X; 
else if($12&&$12.length>2&& 
($0x.mangle[$12]||$0x.$1q.test($12.charAt(0)))) 
$12=$0x.getSubstitute($12); 
else Soya_Saltstorm_ESC.prototype.bless[$12]=1; 
return String('function \x00'+$12); 
} 
function $0k($0X,$11,$13,$14){ 
if(typeof $11=='undefined'&&typeof $13=='undefined'&&typeof $14=='string'){ 
$14=$14.replace(/\s+/g,''); 
if(!$0x.$1s.test($14)&&isNaN(parseInt($14.substr(1),10))){ 
$14=$14.replace($0x.$1r,''); 
if($14.length>2&&!$0x.core[$14]&&!$0x.common[$14]&& 
!$0x.bless[$14]&&($0x.mangle[$14]||!$0x.mangle.length)) 
return $0X.replace($14,$0x.getSubstitute($14)); 
} 
} 
return $0X; 
} 
function $0l($0X,$11,$15,$P){ 
if(typeof $P=='string') 
return(!$0x.core[$P]&&!$0x.common[$P]&&!$0x.bless[$P])? 
String('.'+$0x.getSubstitute($P)):$0X; 
else if(typeof $11!='undefined') 
return $0X; 
else return ''; 
} 
function $0m($0X,$11,$16,$17,$18){ 
if(typeof $11!='undefined') 
return $0X; 
else if(typeof $16!='undefined') 
return '\r\n'; 
else if(typeof $17!='undefined') 
return ' '; 
else return ''; 
} 
function $0n($0X,$11,$19,$1a){ 
if(typeof $11=='undefined'){ 
if(!$0x.$1v.test($1a)||!$19||!$0x.core[$19]) 
return($19||'')+$1a; 
else return $0X; 
} 
else return $11; 
} 
function $0o($0X,$11,$1a){ 
if(typeof $11!='undefined') 
return $0X; 
else return $1a; 
} 
function $0p($0X,$11,$1b,$1c){ 
if(typeof $11!='undefined') 
return $0X; 
return('};'+$1c); 
} 
function $0q($1d,$0s,$1e){ 
var $B=(typeof $1d=='string')?$1d:this.buffer; 
this.loadMaps('core.map','common.map','bless.map','mangle.map'); 
if(!this.buffer.length&&!$1d) 
return String(); 
else if(typeof $0s=='number') 
this.crunchLevel=$0s; 
var $1f=(new Date()).getTime()-1; 
var $1g=$B.length; 
this.report.rawSize+=$B.length; 
if(this.crunchLevel>=1){ 
$B=$B.replace(this.$1w,$0h) 
.replace(this.$1x,$0i) 
.replace(/\s+\r?\n/g,'\r\n'); 
if(this.verbose) 
this.out('Removing comments, empty lines and trailing whitespace, saved '+ 
($1g-$B.length)+' bytes.'); 
$1g=$B.length; 
} 
if(this.crunchLevel>=2){ 
$B=$B.replace(this.$1y,$0m); 
if(this.verbose) 
this.out('Removing tabs and spaces, saved '+ 
($1g-$B.length)+' bytes.'); 
$1g=$B.length; 
$B=$B.replace(this.$1z,$0n); 
if(this.verbose) 
this.out('Removing spaces left to operators, saved '+ 
($1g-$B.length)+' bytes.'); 
$1g=$B.length; 
$B=$B.replace(this.$1A,$0o); 
if(this.verbose) 
this.out('Removing spaces right to operators, saved '+ 
($1g-$B.length)+' bytes.'); 
$1g=$B.length; 
} 
if(this.substitute||$1e||this.crunchLevel>=4){ 
$B=$B.replace(this.$1B,$0j); 
$B=$B.replace(this.$1C,$0k); 
$B=$B.replace(this.$1D,$0l); 
if(this.verbose) 
this.out('Substitution summary, saved '+ 
($1g-$B.length)+' bytes.'); 
$1g=$B.length; 
} 
if(this.crunchLevel>=3){ 
$B=$B.replace(/\r?\n/g,'') 
.replace(this.$1E,$0p); 
$B+='\r\n'; 
if(this.verbose){ 
this.out('Removing newlines, saved '+ 
($1g-$B.length)+' bytes.'); 
this.out('',1); 
} 
} 
if(typeof $1d=='string'){ 
this.report.crunchedSize+=$B.length; 
this.buffer+=$B; 
} 
else{ 
this.buffer=$B; 
this.report.crunchedSize=$B.length; 
} 
this.report.elapsedTime+=(new Date()).getTime()-$1f; 
return this.buffer; 
} 
function $0r($1h){ 
var $1i=($1h||'\r\n'), 
$1j=this.label?String($1i+this.label+$1i):''; 
if(!this.report.elapsedTime){ 
$1j+='Nothing to report, yet...'; 
return(!$1k)?this.out($1j,1):$1j; 
} 
var $1l=Boolean(this.substitute||this.crunchLevel>=4), 
$1m=this.report.rawSize-this.report.crunchedSize; 
if(this.report.scripts.length){ 
$1j+="-----------------------------------------------------------------------------"+$1i; 
$1j+=" Crunching script(s):\r\n\t * "+this.report.scripts.join("\r\n\t * ")+$1i; 
$1j+="-----------------------------------------------------------------------------"+$1i; 
$1j+=" "+(this.outMode||"Put")+" to : "+(this.outFile||"[buffer]")+" ("+ 
(this.report.crunchedSize/1024).toFixed(2)+" kb)"+$1i; 
} 
$1j+="-----------------------------------------------------------------------------"+$1i; 
$1j+=" Processtime     :\t"+(this.report.elapsedTime/1000).toFixed(3)+" secs"+$1i; 
$1j+=" Crunch-level    :\t"+this.crunchLevel+$1i; 
$1j+=" Subst. engine   :\t"+($1l?'On':'Off')+$1i; 
if($1l) 
$1j+=" Substitutions   :\t"+(this.$1n[1]-9)+$1i; 
$1j+=" Original size   :\t"+(this.report.rawSize/1024).toFixed(2)+" kb"+$1i; 
$1j+=" Crunched size   :\t"+(this.report.crunchedSize/1024).toFixed(2)+" kb"+$1i; 
$1j+=" Saving ratio    :\t"+($1m/1024).toFixed(2)+" kb"+$1i; 
$1j+="   -'' ''-   (%) :\t"+(($1m/this.report.rawSize)*100).toFixed(2)+" %"+$1i; 
$1j+="-----------------------------------------------------------------------------"+$1i; 
return $1j; 
} 
if(typeof(Soya)=='object')Soya.registerBean('Soya.Saltstorm.ESC',false,1); 
/*** </POD> ***/ 
]]> 
</script> 
<script language="JScript"> 
<![CDATA[ 
    /* 
    Command flow control script for ESC.wsf 
    Edited : 2005-02-06 
    */ 
    var oShell = WScript.CreateObject('WScript.Shell'); 
    if(!oShell) 
      WScript.Quit(64); 
    // Do we have Jscript 5.5+ ? 
    else if(oShell && parseFloat(ScriptEngineMajorVersion() + '.' + ScriptEngineMinorVersion()) < 5.5) 
      oShell.Popup(getResource('jscript'), 64, WScript.ScriptName, 16), WScript.Quit(4); 
    // Is ESC executed under cscript ? 
    // if not let user select switching to cscript automagically. 
    else if(oShell && WScript.FullName.toLowerCase().indexOf('cscript') < 0){ 
      if(oShell.Popup(getResource('wscript'), 64, WScript.ScriptName, 52) == 6) 
        oShell.Run('%comspec% /Q /K cscript //NoLogo ' + WScript.ScriptName + ' -a', 9); 
      WScript.Quit(3); 
      } 
    // get the cmdline arguments formatted in a nice manner. 
    var oArgs = Soya.WSH.getArguments(); 
    // should we run in verbose-mode ?; 
    var bVerbose = Boolean(!oArgs.s && !oArgs.silent && (oArgs.v || oArgs.verbose)); 
    // create an instance of the ESC object. 
    var esc = new Soya.Saltstorm.ESC(oArgs.l || oArgs.level, bVerbose); 
    esc.label = 'ESC (ECMAScript Cruncher) ' + esc.version + 
             '\r\nCopyright (C) 2001-2005 Thomas Loo <tloo@saltstorm.net>'; 
    esc.resourcePath = esc.fso.GetParentFolderName(WScript.ScriptFullName || '.'); 
    var sOutput = String(oArgs.oa || oArgs.ow || ''); 
    if(oArgs.a || oArgs.about){ 
      WScript.Echo(getResource('about')); 
      WScript.Quit(1); 
      } 
    else if(oArgs.c || oArgs.copyright){ 
      WScript.Echo('\n' + esc.label + getResource('copyright')); 
      WScript.Quit(1); 
      } 
    else if(oArgs.e || oArgs.example){ 
      WScript.Echo('\n' + esc.label + getResource('example')); 
      WScript.Quit(1); 
      } 
    // if there are options missing, print out the help table and quit. 
    else if((oArgs.h || oArgs.help) || !sOutput.length || !oArgs[0]){ 
      WScript.Echo('\n' + esc.label + getResource('usage')); 
      WScript.Quit((oArgs.h || oArgs.help) ? 1 : 2); 
      } 
    // Wake up the variable substitution engine if option set (-$); 
    esc.substitute = Boolean(oArgs.$); 
    // load input files; 
    for(var i = 0; i < oArgs.length; i++) 
      esc.load(oArgs[i]); 
    // crunch baby, crunch!; 
    if(sOutput.toUpperCase() == 'STDOUT'){ 
      esc.silent = true; 
      WScript.StdOut.Write(esc.crunch()); 
      } 
    else if(sOutput.length){ 
      esc.crunch(); 
      esc.save(sOutput, Boolean(oArgs.ow)); 
      // write report to stdout if not silence'd. 
      if(!oArgs.s && !oArgs.silent) 
        WScript.StdOut.Write(esc.getReport()); 
      } 
    // Shutting down nicely.. 
    WScript.Quit(0); 
]]> 
</script> 
</job> 
</package>
Javascript 相关文章推荐
执行iframe中的javascript方法
Oct 07 Javascript
学习从实践开始之jQuery插件开发 菜单插件开发
May 03 Javascript
window.event.keyCode兼容IE和Firefox实现js代码
May 30 Javascript
JS+CSS实现淡入式焦点图片幻灯切换效果的方法
Feb 26 Javascript
深入理解JavaScript系列(46):代码复用模式(推荐篇)详解
Mar 04 Javascript
JavaScript希尔排序、快速排序、归并排序算法
May 08 Javascript
两种js监听滚轮事件的实现方法
May 13 Javascript
Bootstrap文件上传组件之bootstrap fileinput
Nov 25 Javascript
用React实现一个完整的TodoList的示例代码
Oct 30 Javascript
Angular4 反向代理Details实践
May 30 Javascript
JS实现提示框跟随鼠标移动
Aug 27 Javascript
微信小程序如何实现radio单选框单击打勾和取消
Jan 21 Javascript
通过Unicode转义序列来加密,按你说的可以算是混淆吧
May 06 #Javascript
使用正则替换变量
May 05 #Javascript
又一个小巧的图片预加载类
May 05 #Javascript
清华大学出版的事半功倍系列 javascript全部源代码
May 04 #Javascript
用js实现的抽象CSS圆角效果!!
May 03 #Javascript
学习jquery必备 api中英文对照的chm手册 下载
May 03 #Javascript
Packer 3.0 JS压缩及混淆工具 下载
May 03 #Javascript
You might like
php 服务器调试 Zend Debugger 的安装教程
2009/09/25 PHP
php开发过程中关于继承的使用方法分享
2011/06/17 PHP
hadoop常见错误以及处理方法详解
2013/06/19 PHP
php中\r \r\n \t的区别示例介绍
2014/02/08 PHP
PHP使用CURL获取302跳转后的地址实例
2014/05/04 PHP
php实现的返回数据格式化类实例
2014/09/22 PHP
PHP连接操作access数据库实例
2015/03/30 PHP
PHP使用strstr()函数获取指定字符串后所有字符的方法
2016/01/07 PHP
JavaScript 题型问答有答案参考
2010/02/17 Javascript
16个最流行的JavaScript框架[推荐]
2011/05/29 Javascript
基于jquery的loading 加载提示效果实现代码
2011/09/01 Javascript
为原生js Array增加each方法
2012/04/07 Javascript
基于Jquery实现的一个图片滚动切换
2012/06/21 Javascript
display和visibility的区别示例介绍
2014/02/26 Javascript
jQuery实现tag便签去重效果的方法
2015/01/20 Javascript
简单介绍JavaScript的变量和数据类型
2015/06/03 Javascript
整理AngularJS中的一些常用指令
2015/06/16 Javascript
jQuery表单验证简单示例
2016/10/17 Javascript
javascript实现根据函数名称字符串动态执行函数的方法示例
2016/12/28 Javascript
vuex页面刷新后数据丢失的方法
2019/01/17 Javascript
mapboxgl区划标签避让不遮盖实现的代码详解
2020/07/01 Javascript
JavaScript动画实例之粒子文本的实现方法详解
2020/07/28 Javascript
Webpack5正式发布,有哪些新特性
2020/10/12 Javascript
vue实现点击出现操作弹出框的示例
2020/11/05 Javascript
Python复制文件操作实例详解
2015/11/10 Python
python 读写、创建 文件的方法(必看)
2016/09/12 Python
python 编写简单网页服务器的实例
2018/06/01 Python
用Python一键搭建Http服务器的方法
2018/06/01 Python
python能做什么 python的含义
2019/10/12 Python
Python RabbitMQ实现简单的进程间通信示例
2020/07/02 Python
世界上第一个创建了罩杯系统的美国内衣品牌:Maidenform
2019/03/23 全球购物
FILA德国官方网站:来自意大利的体育和街头服饰品牌
2019/07/19 全球购物
八年级作文之感恩
2019/11/22 职场文书
MySQL中出现乱码问题的终极解决宝典
2021/05/26 MySQL
python ConfigParser库的使用及遇到的坑
2022/02/12 Python
Golang jwt身份认证
2022/04/20 Golang