소스 검색

Add original no album

Martin Kleppe 13 년 전
부모
커밋
14dd8918d9
1개의 변경된 파일267개의 추가작업 그리고 0개의 파일을 삭제
  1. 267 0
      js-noalnum_com.html

+ 267 - 0
js-noalnum_com.html

@@ -0,0 +1,267 @@
+
+<html>
+
+<head>
+
+<script>
+
+/* Supported letters & symbols */
+var replacement_chars=[
+/* */ '(NaN+[]["filter"])[11]',
+/*!*/ 'window["atob"]("If")[0]',
+/*"*/ '("").fontcolor()[12]',
+/*#*/ 'window["atob"]("0iN")[1]',
+/*$*/ 'window["atob"]("0iT")[1]',
+/*%*/ 'window["atob"]("0iW")[1]',
+/*&*/ 'window["atob"]("0ia")[1]',
+/*'*/ 'window["atob"]("0if")[1]',
+/*(*/ '(false+[]["filter"])[20]',
+/*)*/ '(false+[]["filter"])[21]',
+/***/ 'window["atob"]("0ir")[1]',
+/*+*/ 'window["atob"]("0it")[1]',
+/*,*/ 'window["atob"]("0iy")[1]',
+/*-*/ '(NaN+window["Date"]())[31]',
+/*.*/ 'window["atob"]("1i4")[1]',
+/*/*/ '(true+("")["sub"]())[10]',
+/*0-9 ignored*/ ,,,,,,,,,,
+/*:*/ 'window["Date"]()[21]',
+/*;*/ 'window["atob"]("O0")[0]',
+/*<*/ '("")["sub"]()[0]',
+/*=*/ '("").fontcolor()[11]',
+/*>*/ '("")["sub"]()[10]',
+/*?*/ 'window["atob"]("0j9")[1]',
+/*@*/ 'window["atob"]("00A")[1]',
+/*A*/ '(+[]+[]["constructor"])[10]',
+/*B*/ '(+[]+(false)["constructor"])[10]',
+/*C*/ 'window["atob"]("00N")[1]',
+/*D*/ 'window["btoa"](00)[1]',
+/*E*/ 'window["btoa"](01)[2]',
+/*F*/ '(0+[]["filter"]["constructor"])[10]',
+/*G*/ 'window["btoa"]("0f")[1]',
+/*H*/ 'window["btoa"]("0t")[1]',
+/*I*/ '("Infinity")[0]',
+/*J*/ 'window["atob"]("00r")[1]',
+/*K*/ 'window["btoa"]("(")[0]',
+/*L*/ 'window["btoa"]("/")[0]',
+/*M*/ 'window["btoa"](0)[0]',
+/*N*/ '("NaN")[0]',
+/*O*/ 'window["btoa"](8)[0]',
+/*P*/ 'window["btoa"]("<")[0]',
+/*Q*/ 'window["btoa"]("a")[1]',
+/*R*/ 'window["atob"]("01I")[1]',
+/*S*/ 'window["btoa"]("I")[0]',
+/*T*/ 'window["btoa"]("N")[0]',
+/*U*/ 'window["atob"]("01W")[1]',
+/*V*/ 'window["atob"]("01a")[1]',
+/*W*/ '(true+window)[12]',
+/*X*/ 'window["atob"]("01i")[1]',
+/*Y*/ 'window["btoa"]("a")[0]',
+/*Z*/ 'window["btoa"]("f")[0]',
+/*[*/ '(undefined+[]["filter"])[33]',
+/*\*/ 'window["atob"]("01y")[1]',
+/*]*/ '(true+[]["filter"])[40]',
+/*^*/ 'window["atob"](014)[1]',
+/*_*/ 'window["atob"](018)[1]',
+/*`*/ 'window["atob"]("02A")[1]',
+/*a*/ '("false")[1]',
+/*b*/ '(window+[])[2]',
+/*c*/ '([]["filter"]+[])[3]',
+/*d*/ '("undefined")[2]',
+/*e*/ '("true")[3]',
+/*f*/ '("false")[0]', 
+/*g*/ '([]+("")["constructor"])[14]',
+/*h*/ 'window["atob"]("aN")[0]',
+/*i*/ '([false]+undefined)[10]',
+/*j*/ '(window+[])[3]',
+/*k*/ 'window["atob"]("a0")[0]',
+/*l*/ '("false")[2]',
+/*m*/ '(Number+[])[11]',
+/*n*/ '("undefined")[1]',
+/*o*/ '(true+[]["filter"])[10]',
+/*p*/ 'window["atob"]("cN")[0]',
+/*q*/ 'window["atob"]("cf")[0]',
+/*r*/ '("true")[1]',
+/*s*/ '("false")[3]',
+/*t*/ '("true")[0]',
+/*u*/ '("undefined")[0]',
+/*v*/ '(0+[]["filter"])[30]',
+/*w*/ '([]["sort"]["call"]()+[])[13]',
+/*x*/ 'window["atob"]("eN")[0]',
+/*y*/ '(NaN+[Infinity])[10]',
+/*z*/ 'window["atob"]("et")[0]',
+/*{*/ '(NaN+[]["filter"])[21]',
+/*|*/ 'window["atob"]("03y")[1]',
+/*}*/ '(NaN+[]["filter"])[41]',
+/*~*/ 'window["atob"](234)[1]'
+]
+
+var reg;
+var step=-1;
+
+function makeDigit(d){
+  var n=parseInt(d);
+  var res="+[]";
+  if (n>0)
+    res="+!"+res;
+  for (i=1;i<n;i++)
+    res="+!+[]"+res;
+  if (n>1)
+    res=res.substr(1);
+  return res;
+}
+function makeNumberStr(r){
+  var res=makeDigit(r[0]);
+  if (r.length>1)
+    res+="+["+makeNumberStr(r.substr(1))+"]";
+  return res;
+}
+function makeNumber(r){
+  return "+("+makeNumberStr(r)+")";
+}
+
+
+function swapString(s){
+  s=s.substring(1,s.length-1);
+  s=s.replace(/\"/g,replacement_chars[2]);
+  
+  var constr=['false','true','NaN','Infinity','undefined'];
+  var constr_r=['![]','!![]','+[![]]','+(+!+[]+(!+[]+[])[!+[]+!+[]+!+[]]+[+!+[]]+[+[]]+[+[]]+[+[]])','[][[]]'];
+
+  function swapInner(str,f){
+    if (str=="") return "";
+    var rep="";
+    var up=1;
+    var enc=true;
+    for (i=0;i<constr.length;i++)
+      if (str.indexOf(constr[i])==0){
+         rep=constr_r[i];
+         up=constr[i].length;
+         if (f&&str.length==up)
+           rep+="+[]";
+      }
+    if (rep==""){
+      rep=(/[0-9]+/).exec(str);
+      if (rep!=null && str.indexOf(rep=String(rep))==0){
+        up=rep.length;
+        rep=makeNumberStr(rep);
+      }
+      else {
+        enc=false;
+        rep=replacement_chars[str.charCodeAt(0)-32];
+      }
+    }
+    if (f)
+      enc=false;
+    return (f?"":"+")+(enc?"[":"")+rep+(enc?"]":"")+swapInner(str.substr(up),false);
+  }
+  return swapInner(s,true);
+}
+
+
+function noalnum(){
+
+txt=" "+document.getElementById("txt").value+" ";
+
+/* 1. FORMAT REFERENCES USING BRACKETS */
+txt=txt.replace(/\.([a-zA-Z0-9_$]+)/gi,"[\"$1\"]");
+
+
+/* 2. GROUND GLOBAL REFERENCES */
+txt=txt.replace(/([\s()\[\]{};+])(alert|eval|atob|btoa|document)/g,"$1(window[\"$2\"])");
+
+
+/* 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]);
+
+
+/* Loop */
+var it=0;
+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"]["call"]()'];
+
+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);
+
+if (step==it)
+  break;
+it++;
+}
+
+
+/* 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);
+
+document.getElementById("len").value=txt.length-2;
+document.getElementById("out").value=txt.substring(1,txt.length-1);
+
+}
+
+
+</script>
+
+</head>
+
+<body bgcolor="FFFF99"  >
+
+<p>Converts javascript command into no alnum version using only []()+! characters (unless you input extras).</p>
+
+<p>Intended input: one line, no whitespace, no variables, function definitions or conditionals.</p>
+
+<p>Note:
+<br>~ Some obscure letters/symbols might not be implemented (will remain as they are in the output)
+<br>~ A precise syntax is required:
+<br> - Infinity, NaN, or any number needs to be enclosed when being added to something from behind
+<br> - Numbers outside strings, ie. "abc"+123
+<br> - Strings in double quotations, not nested
+<br>~ Most problems caused by missing parentheses around strings
+</p>
+
+<p>
+Example:
+<br>alert(document.getElementById("txt").value+String.fromCharCode(33))
+</p>
+
+<p>Let me know if you find any improvements! Page tested with Firefox only.</p>
+
+<br>Input:
+<br><textarea id="txt" cols="80" rows="2">alert("Type your code here!")</textarea>
+<br>
+<input type="button" value="Convert" onclick="step=-1;noalnum()" />
+<input type="button" value="Step" onclick="step++;noalnum()" />
+<input type="button" value="eval(--v)" onclick="eval(document.getElementById('out').value);" />
+<input type="button" value="alert(eval(--v))" onclick="alert(eval(document.getElementById('out').value));" />
+<input type="button" value="Clear--^" onclick="document.getElementById('txt').value=''" />
+<input type="button" value="Clear--v" onclick="document.getElementById('out').value=''" />
+Output Length: <input type="text" size="12" id="len" />
+<br>
+<textarea id="out" cols="80" rows="30">alert("  Result shows here. ")</textarea>
+
+</body>
+</html>
+