> 웹 프론트엔드 > JS 튜토리얼 > 자바스크립트의 ESC (두 번째 유형의 혼동)_해커 성격

자바스크립트의 ESC (두 번째 유형의 혼동)_해커 성격

WBOY
풀어 주다: 2016-05-16 19:14:07
원래의
1233명이 탐색했습니다.

ESC (Type 2 Obfuscation)
GNU 프로젝트
http://www.saltstorm.net/downloads/esc/ESC.zip

다음 코드를
ESC.wsf

코드 복사 코드는 다음과 같습니다.







-----------------------------------------------------------------------------
  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 

  ---------------------------------------------------------------------------
  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.
-----------------------------------------------------------------------------



-----------------------------------------------------------------------------

  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

-----------------------------------------------------------------------------




------------------------------------------------------------------------------
 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            : Target filename for appending
  -ow            : Target filename for writing
  -ow STDOUT               : Write stream to STDOUT
 -----------------------------------------------------------------------------
            : [required]
  file(s) and/or directories containing scripts to crunch...
  (paths containing spaces must be quoted)



-----------------------------------------------------------------------------
 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.
-----------------------------------------------------------------------------



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 ?




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.





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
소야
BOOTSTRAP




추상
break
continue
const
class
catch
case
debugger
default
double
delete
do
enum
확장
else
함수
마지막으로
float
false
for
get
instanceof
구현
import
int
in
if
long
null
new
protected
private
package
public
return
switch
static
super
set
typeof
throw
true
this
시도
undefine
void
var
while
with
getter
setter
__defineGetter__
__defineSetter__
end
elif 
cc_on 
_win32
_win16
_mac
_alpha
_x86
_mc680x0
_PowerPC
_jscript
_jscript_build
_jscript_version
배열
부울
날짜
열거자
오류
함수
수학
숫자
객체
RegExp
문자열
VBArray




/***  ***/
/**
ESC가 실제로 이름 조작을 처리할 수 있고 일반적으로 자기 건전한
검사로 처리할 수 있다는 것을 증명하면서 ESC는 아래에 보이는 패키지를 생성하는 동안 다른 필수 콩
과 함께 자신을 압축하는 데 사용되었습니다. 보다 인간적인
읽기 쉬운 형식으로 이러한 빈을 검사하려면 Soya API의 최신 배포판을 다운로드하세요.
**/
함수 Soya_API($h)
{
this.name ='소야';
this.version='1.0.0-b10';
this.type='정적';
this.debug=0;
this.host=$h;
this.libPath='/lib-soya/';
this.podPath='포드';
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);
}
함수 Soya_VirtualBean(){}
함수 Soya_BeanPrototype(){
this.name='Soya.BeanPrototype';
}
함수 $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));
}
함수 $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 배열();
$o.complete=부울($n);
$o.constructable=($k&&!$m);
$o.virtual=!$k;
return(this.beans[$j]=this.beans.all[this.beans.all.length]=$o);
}
함수 $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 배열();
for(i=0;iif(this.Loader.orphans[i].parentName==$j)
this.attachBean(this. Loader.orphans[i]);
그 외 $t[$t.length]=this.Loader.orphans[i];
this.Loader.orphans=$t;
}
}
부울(i) 반환
}
함수 $d($u){
this.getResourcePath=Function('sName',
"return(Soya.libPath   Soya.resourcePath   '/'   (sName||this.name).split( '.').가입하다('/') '/')");
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='정적';
if(!$u){
this.finalize=$f;
this.initialize=$e;
}
}
함수 $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);
}
}
함수 $f($w){
$w=$w||
Soya.host[Soya.beans[this.name].mutexName '_finalize'];
if(typeof($w)=='함수')
$w(this.getClass(),this);
}
함수 Soya_Loader(){};
함수 $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();
$B 반환;
}
else if(!$y)
return(WScript.Echo(this.name ' ' Soya.version
'> 파일 찾을 수 없음: ' $x),WScript.Quit( 99));
그렇지 않으면 ''를 반환합니다.
}
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)=='기능')BOOTSTRAP(소야);
함수 Soya_Common()
{
this.name='Soya.Common';
this.type='정적';
this.version='1.03';
this.dependent=[];
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;
}
함수 $C($I,$J){
if(typeof(this.interfaces[$I])=='정의되지 않음'){
if(typeof ActiveXObject==' 함수'){
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 nextnself.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);
}
함수 $D($L){
var $M=[],
$N=(isNaN($L)||$L<1)?
0:Math.min($L,this.arguments.length);
for(;$N$M[$M.length]=this.arguments[$N];
$M 반환;
}
함수 $E($O){
if($O!=null&&typeof($O)=='object')
for(var $P in $O){
if(typeof($O[$P])=='객체'&&$O[$P])
if($O[$P].constructor&&!$O[$P].style){
this.destroy($O[$P]);
삭제($O[$P]);
}
그 외 $O[$P]=null;
}
}
함수 $F($Q,$R){
var $S;
switch(typeof($Q)){
case 'number':$S=2;break;
case 'boolean':$S=4;break;
case 'string':$S=8;break;
케이스 '기능':$S=16;break;
케이스 '객체':$S=32;break;
기본값:$S=1;break;
}
return Boolean($S&($R||62));
}
함수 $G($T){
if($T&&this.typematch($T,16))
return $T;
그렇지 않으면 함수(($T&&this.typematch($T,8))?$T:'')를 반환합니다.
}
함수 $H($U,$V,$W){
for(var $P in $U)
if($P!='name'&&(!$W ||typeof($V[$P])=='정의되지 않음'))
$V[$P]=$U[$P];
}
if(typeof(Soya)=='object')Soya.registerBean('Soya.Common',true);
함수 Soya_WSH()
{
this.name='Soya.WSH';
this.type='정적';
this.version='0.88';
this.dependent=['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;
}
함수 $X(){
if(!this.arguments.length&&WScript.Arguments.length){
var i,$02,$03=[],$04=new RegExp('^- ');
for(i=0;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]!='undefine'&&!$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;
}
함수 $Y(){
if(!this.shell)
this.shell=Soya.Common.getObject('WScript.Shell');
this.shell을 반환합니다.
}
함수 $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('HKLMSOFTWAREMicrosoft.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 $/,'')]||'알 수 없음';
}
this.osInfo.$0a=1;
this.osInfo를 반환합니다.
}
if(typeof(Soya)=='object')Soya.registerBean('Soya.WSH',true);
함수 Soya_Saltstorm_ESC($0s,$0t,$0u,$y)
{
this.name='Soya.Saltstorm.ESC';
this.version='1.13';
this.type='생성자';
this.dependent=['Soya.Common','Soya.ECMA.Array'];
this.resourcePath=$0u||'';
this.crunchLevel=$0s||2;
this.substitute=false;
this.verbose=$0t;
this.silent=($y||typeof 창=='객체');
this.initialize();
this.flush();
}
함수 Soya_Saltstorm_ESC_initialize($0v,$0w){
$0x=$0w;
var $0y="(?:"{2}|'{2}|".*?."|'.*?.'|\/(?!\*|\/)..*? \/)";
var $0z="[-!%&;<=>~:\/\^\ \|\,\(\)\*\?\[\]\{\ }] ";
var $0A="\/\*(?!@).(?:.|\n)*?\*\/|\/\/.*";
var $0 B="".*?."|'.*?.'|\s*\/{2,}.*\n";
var $0C="\}[\s\n]*? ([^;,ce\|\.\]\)\}])";
with($0v){
prototype.fileFilter=new RegExp('.\\(?!$|_) \w*\.js$','i');
prototype.$1n=["0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",9];
prototype.fso=Soya. Loader.fso||new ActiveXObject('Scripting.FilesystemObject');
prototype.core={};
prototype.bless={};
prototype.mangle={}; common={};
prototype.$1p=$g;
prototype.crunch=$0q;
prototype.flush=function(){this.buffer='';this.report=new $0 c()};
prototype.getSubstitute=$0g;
prototype.loadMaps=$0d;
prototype.load=$0e; 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")
프로토타입. $1D=new RegExp("(" $0y ")|(\x00)|\.[\n\s]*?([$_][$\w]{3,})","g") ;
prototype.$1E=new RegExp("(" $0y ")|(" $0C ")","g")
}
}
함수 $0b($0D ,$0E){
if(!this.silent){
var $0F=String((!$0E?'ESC> ':'') ($0D||'')
WScript.Echo($0F)
}
}
함수 $0c(){
this.scripts=[];
this.rawSize=
this.crunchedSize=
this.elapsedTime=0;
}
함수 $0d(){
if(this.$1F)
return;
var $0G,$0H,$0I,$0J,$0K;
for(var i=0;i$0G=arguments[i].replace(/W. $/,'');
시도해 보세요{
$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('파싱된 맵 "' $0G '", ' $0I.length ' entries.')
}
catch($0L){
if($0L)
$0I=null;
}
if($0I)
계속;
그 외 $0H=this.fso.BuildPath(this.resourcePath,arguments[i]);
if(/^common|core/.test(arguments[i])&&!this.fso.FileExists($0H)){
this.out('$0M $0N을 할 수 없습니다:'
this.fso.GetAbsolutePathName($0H));
WScript.Quit(99)를 반환합니다.
}
else if(typeof this[$0G]!='object'){
this.out('인식할 수 없는 지도 이름: ' $0G);
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,'')]= $0 케이;
}
$0I.Close();
Soya_Saltstorm_ESC.prototype[$0G].length=$0K;
if(this.verbose)
this.out('로드된 지도 "' $0G '", ' $0K ' 항목. [' $0H ']');
}
}
this.$1F=1;
}
함수 $0e(){
var i,$0O,$0P,$0Q,$0R=[];
for(i=0;iif(arguments[i]&&this.fso.FolderExists(arguments[i])){
$0Q=new 열거자(this .fso.GetFolder(인수[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( '$0M $0S를 할 수 없습니다:"'   this.fso.GetAbsolutePathName(aLoadQueue[i])   '"');
WScript.Quit(99)를 반환합니다.
}
else if(this.verbose)
this.out('스크립트 로드 중 :"' this.fso.GetAbsolutePathName($0R[i]) '"');
$0P=this.fso.GetFile($0R[i]);
this.buffer =(this.report.scripts.length?'rn':'');
this.buffer =this.$1p($0P.Path,true);
this.report.scripts.push(
$0P.Path ' (' ($0P.Size/1024).toFixed(2) ' kb)');
}
$0R.length를 반환합니다.
}
함수 $0f($0T,$0U){
var $0V;
if(!$0T){
this.out('출력 파일 이름이 필요합니다!');
WScript.Quit(99)를 반환합니다.
}
else if(this.fso.FolderExists($0T)){
this.out('출력 파일 이름이 필요합니다, "'
this.fso.GetAbsolutePathName($0T) '" 폴더입니다.');
WScript.Quit(99)를 반환합니다.
}
this.outFile=this.fso.GetAbsolutePathName($0T);
this.outMode=$0U?'쓰기':'추가';
$0V=this.fso.OpenTextFile(this.outFile,($0U?2:8),true);
$0V.WriteLine(this.buffer);
$0V.Close();
}
함수 $0g($0W){
if(!this.$1o[$0W]){
var k=1;
while(k<5){
this.$1n[k] ;
if(this.$1n[k]&&!(this.$1n[k]b)){
k ;
if(this.$1n.length==k)
this.$1n[k]=-1;
}
그렇지 않으면 중단;
}
this.$1o[$0W]='$';
for(k=this.$1n.length-1;k>0;k--)
this.$1o[$0W] =this.$1n[0].charAt(this.$1n [k]b);
if(this.verbose)
this.out('대체 [' this.$1o[$0W] '] -> [' $0W ']');
}
이것을 반환하세요.$1o[$0W];
}
함수 $0h($0X,$0Y,$0Z){
if(typeof $0Z!='undefine')
return'';
그렇지 않으면 $0X를 반환합니다.
}
함수 $0i($0X,$10){
if(typeof $10!='undefine'&&/^s /.test($10))
return 'rn';
그렇지 않으면 $0X를 반환합니다.
}
함수 $0j($0X,$11,$12){
if(typeof $11!='undefine')
return $0X;
else if($12&&$12.length>2&&
($0x.mangle[$12]||$0x.$1q.test($12.charAt(0))))
$12=$0x .getSubstitute($12);
그 외 Soya_Saltstorm_ESC.prototype.bless[$12]=1;
return String('function x00' $12);
}
함수 $0k($0X,$11,$13,$14){
if(typeof $11=='정의되지 않음'&&typeof $13=='정의되지 않음'&&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));
}
}
$0X 반환;
}
함수 $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!='undefine')
$0X를 반환합니다.
그렇지 않으면 ''를 반환합니다.
}
함수 $0m($0X,$11,$16,$17,$18){
if(typeof $11!='undefine')
return $0X;
else if(typeof $16!='undefine')
return 'rn';
else if(typeof $17!='undefine')
return ' ';
그렇지 않으면 ''를 반환합니다.
}
함수 $0n($0X,$11,$19,$1a){
if(typeof $11=='undefine'){
if(!$0x.$1v.test( $1a)||!$19||!$0x.core[$19])
return($19||'') $1a;
그렇지 않으면 $0X를 반환합니다.
}
그렇지 않으면 $11를 반환합니다.
}
함수 $0o($0X,$11,$1a){
if(typeof $11!='undefine')
return $0X;
그렇지 않으면 $1a를 반환합니다.
}
함수 $0p($0X,$11,$1b,$1c){
if(typeof $11!='undefine')
return $0X;
return('};' $1c);
}
함수 $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)
. 교체(/s r?n/g,'rn');
if(this.verbose)
this.out('주석, 빈 줄 및 후행 공백을 제거하여 저장되었습니다.'
($1g-$B.length) '바이트.');
$1g=$B.길이;
}
if(this.crunchLevel>=2){
$B=$B.replace(this.$1y,$0m);
if(this.verbose)
this.out('탭과 공백을 제거하여 저장되었습니다.'
($1g-$B.length) '바이트.');
$1g=$B.길이;
$B=$B.replace(this.$1z,$0n);
if(this.verbose)
this.out('연산자에게 남은 공백을 제거하여 저장되었습니다.'
($1g-$B.length) '바이트.');
$1g=$B.길이;
$B=$B.replace(this.$1A,$0o);
if(this.verbose)
this.out('연산자에게 바로 공백을 제거하여 저장되었습니다.'
($1g-$B.length) '바이트.');
$1g=$B.길이;
}
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('대체 요약, 저장됨 '
($1g-$B.length) '바이트.');
$1g=$B.길이;
}
if(this.crunchLevel>=3){
$B=$B.replace(/r?n/g,'')
.replace(this.$1E,$0 피);
$B ='rn';
if(this.verbose){
this.out('줄바꿈 제거, 저장됨 '
($1g-$B.length) '바이트.');
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;
this.buffer를 반환합니다.
}
함수 $0r($1h){
var $1i=($1h||'rn'),
$1j=this.label?String($1i this.label $1 나):'';
if(!this.report.elapsedTime){
$1j ='아직 보고할 내용이 없습니다...';
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 ="--------------- ------------------------------------------------" $1 나;
$1j =" 크런칭 스크립트:rnt * " this.report.scripts.join("rnt * ") $1i;
$1j="------------------------------- ----------------------------------" $1i;
$1j =" " (this.outMode||"Put") " 대상: " (this.outFile||"[buffer]") " ("
(this.report.crunchedSize/1024). toFixed(2) " kb)" $1i;
}
$1j="------------------------------- ----------------------------------" $1i;
$1j =" 처리 시간     :t" (this.report.elapsedTime/1000).toFixed(3) " 초" $1i;
$1j =" 크런치 수준    :t" this.crunchLevel $1i;
$1j =" 하위 엔진   :t" ($1l?'On':'Off') $1i;
if($1l)
$1j =" 대체 항목   :t" (this.$1n[1]-9) $1i;
$1j =" 원본 크기   :t" (this.report.rawSize/1024).toFixed(2) " kb" $1i;
$1j =" 크런치 사이즈   :t" (this.report.crunchedSize/1024).toFixed(2) " kb" $1i;
$1j =" 절약 비율    :t" ($1m/1024).toFixed(2) " kb" $1i;
$1j ="   -'' ''-   (%) :t" (($1m/this.report.rawSize)*100).toFixed(2) " %" $1i;
$1j="------------------------------- ----------------------------------" $1i;
$1j 반환;
}
if(typeof(Soya)=='object')Soya.registerBean('Soya.Saltstorm.ESC',false,1);

/***  ***/

]]>


    /*
    ESC.wsf
에 대한 명령 흐름 제어 스크립트
    수정됨 : 2005-02-06
    */

    var oShell = WScript .CreateObject('WScript.Shell');

    if(!oShell)
      WScript.Quit(64);

    // Jscript 5.5가 있나요?
    else if(oShell && parseFloat(ScriptEngineMajorVersion()   '.'   ScriptEngineMinorVersion()) < 5.5)
      oShell.Popup(getResource('jscript'), 64, WScript.ScriptName, 16), WScript.Quit (4);

    // ESC는 cscript에서 실행되나요?
    // 사용자가 자동으로 cscript로 전환을 선택하도록 허용하지 않는 경우.
    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);
      }

    // 좋은 방식으로 형식이 지정된 cmdline 인수를 가져옵니다.
    var oArgs = Soya.WSH.getArguments();

    // 상세 모드에서 실행해야 할까요 ?;
    var bVerbose = Boolean(!oArgs.s && !oArgs.silent && (oArgs.v || oArgs.verbose));

    // ESC 객체의 인스턴스를 생성합니다.
    var esc = new Soya.Saltstorm.ESC(oArgs.l || oArgs.level, bVerbose);
    esc.label = 'ESC (ECMAScript Cruncher) '   esc.version 
             'rnCopyright(C) 2001-2005 Thomas Loo ';

    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);       }

    // 옵션이 누락된 경우 도움말 표를 인쇄하고 종료하세요.
    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);
      }

    //옵션이 설정되면(-$) 변수 대체 엔진을 깨우고;
    esc.substitute = Boolean(oArgs.$);

    // 입력 파일을 로드합니다.
    for(var i = 0; i < oArgs.length; i )
      esc.load(oArgs[i]);

    // 크런치 베이비, 크런치!;
    if(sOutput.toUpperCase() == 'STDOUT'){
      esc.silent = true;
      WScript.StdOut.Write(esc.crunch());
      }
    else if(sOutput.length){
      esc.crunch();
      esc.save(sOutput, Boolean(oArgs.ow));
      //무음 처리되지 않은 경우 stdout에 보고서를 작성합니다.
      if(!oArgs.s && !oArgs.silent)
        WScript.StdOut.Write(esc.getReport());
      }

    // 정상적으로 종료하는 중입니다..
    WScript.Quit(0);

]]>



원천:php.cn
본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
인기 튜토리얼
더>
최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿