-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathhtml-ninja.js
55 lines (46 loc) · 1.03 KB
/
html-ninja.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
function decrypt()
{
var retstring = "";
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari, SeaMonkey
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
retstring = xmlhttp.responseText;
}
}
xmlhttp.open("GET", document.location, false);
xmlhttp.send();
src = retstring;
var prevchar = "nil";
var bits = "";
var char = "";
for (var i = 0, len = src.length; i < len; i++) {
char = src.charAt(i);
if (prevchar === " "){
if (char === " "){
bits = bits + "1";
char = "nil";
}else{
bits = bits + "0";
char = "nil";
}
}
prevchar = char;
}
bits = bits.replace(/(\S{8})/g,"$1 ");
var binString = '';
bits.split(' ').map(function(bin) {
binString += String.fromCharCode(parseInt(bin, 2));
});
return binString;
}
var output = decrypt();
btoa(output); // if you want to use this data in some misterious ways ;)