|
@@ -9,10 +9,10 @@
|
|
var replacement_chars=[
|
|
var replacement_chars=[
|
|
/* */ '(NaN+[]["filter"])[11]',
|
|
/* */ '(NaN+[]["filter"])[11]',
|
|
/*!*/ 'window["atob"]("If")[0]',
|
|
/*!*/ 'window["atob"]("If")[0]',
|
|
-/*"*/ '("").fontcolor()[12]',
|
|
|
|
|
|
+/*"*/ '("")["fontcolor"]()[12]',
|
|
/*#*/ 'window["atob"]("0iN")[1]',
|
|
/*#*/ 'window["atob"]("0iN")[1]',
|
|
/*$*/ 'window["atob"]("0iT")[1]',
|
|
/*$*/ 'window["atob"]("0iT")[1]',
|
|
-/*%*/ 'window["atob"]("0iW")[1]',
|
|
|
|
|
|
+/*%*/ 'window["escape"]("<")[0]',
|
|
/*&*/ 'window["atob"]("0ia")[1]',
|
|
/*&*/ 'window["atob"]("0ia")[1]',
|
|
/*'*/ 'window["atob"]("0if")[1]',
|
|
/*'*/ 'window["atob"]("0if")[1]',
|
|
/*(*/ '(false+[]["filter"])[20]',
|
|
/*(*/ '(false+[]["filter"])[20]',
|
|
@@ -20,23 +20,24 @@ var replacement_chars=[
|
|
/***/ 'window["atob"]("0ir")[1]',
|
|
/***/ 'window["atob"]("0ir")[1]',
|
|
/*+*/ 'window["atob"]("0it")[1]',
|
|
/*+*/ 'window["atob"]("0it")[1]',
|
|
/*,*/ 'window["atob"]("0iy")[1]',
|
|
/*,*/ 'window["atob"]("0iy")[1]',
|
|
-/*-*/ '(NaN+window["Date"]())[31]',
|
|
|
|
|
|
+/*-*/ '(NaN+window["Date"]())[31]',
|
|
/*.*/ 'window["atob"]("1i4")[1]',
|
|
/*.*/ 'window["atob"]("1i4")[1]',
|
|
/*/*/ '(true+("")["sub"]())[10]',
|
|
/*/*/ '(true+("")["sub"]())[10]',
|
|
|
|
|
|
/*0-9 ignored*/ ,,,,,,,,,,
|
|
/*0-9 ignored*/ ,,,,,,,,,,
|
|
|
|
|
|
-/*:*/ 'window["Date"]()[21]',
|
|
|
|
|
|
+/*:*/ 'window["Date"]()[21]',
|
|
/*;*/ 'window["atob"]("O0")[0]',
|
|
/*;*/ 'window["atob"]("O0")[0]',
|
|
/*<*/ '("")["sub"]()[0]',
|
|
/*<*/ '("")["sub"]()[0]',
|
|
-/*=*/ '("").fontcolor()[11]',
|
|
|
|
|
|
+/*=*/ '("")["fontcolor"]()[11]',
|
|
/*>*/ '("")["sub"]()[10]',
|
|
/*>*/ '("")["sub"]()[10]',
|
|
/*?*/ 'window["atob"]("0j9")[1]',
|
|
/*?*/ 'window["atob"]("0j9")[1]',
|
|
/*@*/ 'window["atob"]("00A")[1]',
|
|
/*@*/ 'window["atob"]("00A")[1]',
|
|
|
|
|
|
/*A*/ '(+[]+[]["constructor"])[10]',
|
|
/*A*/ '(+[]+[]["constructor"])[10]',
|
|
/*B*/ '(+[]+(false)["constructor"])[10]',
|
|
/*B*/ '(+[]+(false)["constructor"])[10]',
|
|
-/*C*/ 'window["atob"]("00N")[1]',
|
|
|
|
|
|
+/*C*/ '[]["sort"]["constructor"]("return \\\"\\103\\\"")()',
|
|
|
|
+
|
|
/*D*/ 'window["atob"](00)[1]',
|
|
/*D*/ 'window["atob"](00)[1]',
|
|
/*E*/ 'window["atob"](01)[2]',
|
|
/*E*/ 'window["atob"](01)[2]',
|
|
/*F*/ '(0+[]["filter"]["constructor"])[10]',
|
|
/*F*/ '(0+[]["filter"]["constructor"])[10]',
|
|
@@ -62,7 +63,7 @@ var replacement_chars=[
|
|
/*Z*/ 'window["atob"]("f")[0]',
|
|
/*Z*/ 'window["atob"]("f")[0]',
|
|
|
|
|
|
/*[*/ '(undefined+[]["filter"])[33]',
|
|
/*[*/ '(undefined+[]["filter"])[33]',
|
|
-/*\*/ 'window["atob"]("01y")[1]',
|
|
|
|
|
|
+/*\*/ 'window["unescape"]("%"+(5)+"c")[0]',
|
|
/*]*/ '(true+[]["filter"])[40]',
|
|
/*]*/ '(true+[]["filter"])[40]',
|
|
/*^*/ 'window["atob"](014)[1]',
|
|
/*^*/ 'window["atob"](014)[1]',
|
|
/*_*/ 'window["atob"](018)[1]',
|
|
/*_*/ 'window["atob"](018)[1]',
|
|
@@ -115,18 +116,23 @@ function makeDigit(d){
|
|
res=res.substr(1);
|
|
res=res.substr(1);
|
|
return res;
|
|
return res;
|
|
}
|
|
}
|
|
|
|
+
|
|
function makeNumberStr(r){
|
|
function makeNumberStr(r){
|
|
var res=makeDigit(r[0]);
|
|
var res=makeDigit(r[0]);
|
|
if (r.length>1)
|
|
if (r.length>1)
|
|
res+="+["+makeNumberStr(r.substr(1))+"]";
|
|
res+="+["+makeNumberStr(r.substr(1))+"]";
|
|
return res;
|
|
return res;
|
|
}
|
|
}
|
|
|
|
+
|
|
function makeNumber(r){
|
|
function makeNumber(r){
|
|
return "+("+makeNumberStr(r)+")";
|
|
return "+("+makeNumberStr(r)+")";
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
function swapString(s){
|
|
function swapString(s){
|
|
|
|
+
|
|
|
|
+ console.log(":", s)
|
|
|
|
+
|
|
s=s.substring(1,s.length-1);
|
|
s=s.substring(1,s.length-1);
|
|
s=s.replace(/\"/g,replacement_chars[2]);
|
|
s=s.replace(/\"/g,replacement_chars[2]);
|
|
|
|
|
|
@@ -168,8 +174,8 @@ function noalnum(){
|
|
|
|
|
|
txt=" "+document.getElementById("txt").value+" ";
|
|
txt=" "+document.getElementById("txt").value+" ";
|
|
|
|
|
|
-/* 1. FORMAT REFERENCES USING BRACKETS */
|
|
|
|
-txt=txt.replace(/\.([a-zA-Z0-9_$]+)/gi,"[\"$1\"]");
|
|
|
|
|
|
+// /* 1. FORMAT REFERENCES USING BRACKETS */
|
|
|
|
+// txt=txt.replace(/\.([a-zA-Z0-9_$]+)/gi,"[\"$1\"]");
|
|
|
|
|
|
|
|
|
|
/* 2. GROUND GLOBAL REFERENCES */
|
|
/* 2. GROUND GLOBAL REFERENCES */
|
|
@@ -177,54 +183,49 @@ txt=txt.replace(/([\s()\[\]{};+])(alert|eval|atob|btoa|document)/g,"$1(window[\"
|
|
|
|
|
|
|
|
|
|
/* 3. REPLACE ESCAPED QUOTES */
|
|
/* 3. REPLACE ESCAPED QUOTES */
|
|
-txt=txt.replace(/\\"/g,replacement_chars[92-32]+replacement_chars[34-32]);
|
|
|
|
-txt=txt.replace(/\\'/g,replacement_chars[92-32]+replacement_chars[39-32]);
|
|
|
|
|
|
+txt=txt.replace(/\\"/g,replacement_chars[92-32]+"+"+replacement_chars[34-32]);
|
|
|
|
+txt=txt.replace(/\\'/g,replacement_chars[92-32]+"+"+replacement_chars[39-32]);
|
|
|
|
|
|
|
|
+console.log(txt)
|
|
|
|
|
|
/* Loop */
|
|
/* Loop */
|
|
var it=0;
|
|
var it=0;
|
|
var old="";
|
|
var old="";
|
|
-while (txt!=old){
|
|
|
|
-old=txt;
|
|
|
|
-
|
|
|
|
|
|
|
|
-/* 3. REPLACE OBJECTS */
|
|
|
|
-var objs=['String','Boolean','Function','Array','Number','Date','Object','window'];
|
|
|
|
-var objs_r=['("")["constructor"]','(false)["constructor"]','[]["filter"]["constructor"]','[]["constructor"]','(0)["constructor"]','window["Date"]','(window["constructor"])["constructor"]','[]["sort"]["constructor"]("return this")()'];
|
|
|
|
|
|
|
|
-for (i=0;i<objs.length;i++){
|
|
|
|
- reg=new RegExp("([\\s()\\[\\]{};,.+])"+objs[i]+"([\\s()\\[\\]{};,.+])","g");
|
|
|
|
- txt=txt.replace(reg,"$1"+objs_r[i]+"$2");
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-/* 4. REPLACE CONSTANTS */
|
|
|
|
-var cons=['false','true','NaN','Infinity','undefined'];
|
|
|
|
-var cons_r=['![]','!![]','+[![]]','+(+!+[]+(!+[]+[])[!+[]+!+[]+!+[]]+[+!+[]]+[+[]]+[+[]]+[+[]])','[][[]]'];
|
|
|
|
-
|
|
|
|
-for (i=0;i<cons.length;i++){
|
|
|
|
- reg=new RegExp("([\\s()\\[\\]{};,.+])"+cons[i]+"([\\s()\\[\\]{};,.+])","g");
|
|
|
|
- txt=txt.replace(reg,"$1"+cons_r[i]+"$2");
|
|
|
|
-}
|
|
|
|
-txt=txt.replace(/([\(\)\[\]])("")([\(\)\[\]])/g,"$1[]+[]$3");
|
|
|
|
-txt=txt.replace(/""/g,"([]+[])");
|
|
|
|
-
|
|
|
|
-/* 5. REPLACE STRINGS */
|
|
|
|
|
|
+// /* 3. REPLACE OBJECTS */
|
|
|
|
+// var objs=['String','Boolean','Function','Array','Number','Date','Object','window'];
|
|
|
|
+// var objs_r=['("")["constructor"]','(false)["constructor"]','[]["filter"]["constructor"]','[]["constructor"]','(0)["constructor"]','window["Date"]','(window["constructor"])["constructor"]','[]["sort"]["constructor"]("return this")()'];
|
|
|
|
+//
|
|
|
|
+// for (i=0;i<objs.length;i++){
|
|
|
|
+// reg=new RegExp("([\\s()\\[\\]{};,.+])"+objs[i]+"([\\s()\\[\\]{};,.+])","g");
|
|
|
|
+// txt=txt.replace(reg,"$1"+objs_r[i]+"$2");
|
|
|
|
+// }
|
|
|
|
+//
|
|
|
|
+//
|
|
|
|
+// /* 4. REPLACE CONSTANTS */
|
|
|
|
+// var cons=['false','true','NaN','Infinity','undefined'];
|
|
|
|
+// var cons_r=['![]','!![]','+[![]]','+(+!+[]+(!+[]+[])[!+[]+!+[]+!+[]]+[+!+[]]+[+[]]+[+[]]+[+[]])','[][[]]'];
|
|
|
|
+//
|
|
|
|
+// for (i=0;i<cons.length;i++){
|
|
|
|
+// reg=new RegExp("([\\s()\\[\\]{};,.+])"+cons[i]+"([\\s()\\[\\]{};,.+])","g");
|
|
|
|
+// txt=txt.replace(reg,"$1"+cons_r[i]+"$2");
|
|
|
|
+// }
|
|
|
|
+// txt=txt.replace(/([\(\)\[\]])("")([\(\)\[\]])/g,"$1[]+[]$3");
|
|
|
|
+// txt=txt.replace(/""/g,"([]+[])");
|
|
|
|
+//
|
|
|
|
+// /* 5. REPLACE STRINGS */
|
|
txt=txt.replace(/"([^"]+)"/g,swapString);
|
|
txt=txt.replace(/"([^"]+)"/g,swapString);
|
|
-txt=txt.replace(/'([^']+)'/g,swapString);
|
|
|
|
|
|
+txt=txt.replace(/([^']+)/g,swapString);
|
|
|
|
|
|
-if (step==it)
|
|
|
|
- break;
|
|
|
|
-it++;
|
|
|
|
-}
|
|
|
|
|
|
|
|
|
|
|
|
/* 6. REPLACE NUMBERS */
|
|
/* 6. REPLACE NUMBERS */
|
|
-txt=txt.replace(/([\(\)\[\]])([0-9]+)([\(\)\[\]])/g,function(a,b,c,d){return b+makeNumberStr(c)+d;});
|
|
|
|
-txt=txt.replace(/[0-9]+/g,makeNumber);
|
|
|
|
|
|
+ txt=txt.replace(/([\(\)\[\]])([0-9]+)([\(\)\[\]])/g,function(a,b,c,d){return b+makeNumberStr(c)+d;});
|
|
|
|
+ txt=txt.replace(/[0-9]+/g,makeNumber);
|
|
|
|
|
|
document.getElementById("len").value=txt.length-2;
|
|
document.getElementById("len").value=txt.length-2;
|
|
-document.getElementById("out").value=txt.substring(1,txt.length-1);
|
|
|
|
|
|
+document.getElementById("out").value=txt;
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@@ -233,7 +234,7 @@ document.getElementById("out").value=txt.substring(1,txt.length-1);
|
|
|
|
|
|
</head>
|
|
</head>
|
|
|
|
|
|
-<body bgcolor="FFFF99" >
|
|
|
|
|
|
+<body bgcolor="FFFF99">
|
|
|
|
|
|
<p>Converts javascript command into no alnum version using only []()+! characters (unless you input extras).</p>
|
|
<p>Converts javascript command into no alnum version using only []()+! characters (unless you input extras).</p>
|
|
|
|
|
|
@@ -256,7 +257,7 @@ Example:
|
|
<p>Let me know if you find any improvements! Page tested with Firefox only.</p>
|
|
<p>Let me know if you find any improvements! Page tested with Firefox only.</p>
|
|
|
|
|
|
<br>Input:
|
|
<br>Input:
|
|
-<br><textarea id="txt" cols="80" rows="2">alert("Type your code here!")</textarea>
|
|
|
|
|
|
+<br><textarea id="txt" cols="80" rows="2">abcdefg</textarea>
|
|
<br>
|
|
<br>
|
|
<input type="button" value="Convert" onclick="step=-1;noalnum()" />
|
|
<input type="button" value="Convert" onclick="step=-1;noalnum()" />
|
|
<input type="button" value="Step" onclick="step++;noalnum()" />
|
|
<input type="button" value="Step" onclick="step++;noalnum()" />
|