This repository has been archived by the owner on Oct 31, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathxorgen.html
executable file
·97 lines (82 loc) · 2.19 KB
/
xorgen.html
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<HTML>
<HEAD>
<SCRIPT language=JavaScript>
var symbols = " !\"#$%&'()*+'-./0123456789:;<=>?@";
function toAscii (xx)
{
var loAZ = "abcdefghijklmnopqrstuvwxyz";
symbols+= loAZ.toUpperCase();
symbols+= "[\\]^_`";
symbols+= loAZ;
symbols+= "{|}~";
var loc;
loc = symbols.indexOf(xx);
if (loc >-1)
{
Ascii_Decimal = 32 + loc;
return (32 + loc);
}
return(0); // If not in range 32-126 return ZERO
}
function Dec2Hex(Decimal)
{
var hexChars = "0123456789ABCDEF";
var a = Decimal % 16;
var b = (Decimal - a)/16;
hex = "" + hexChars.charAt(b) + hexChars.charAt(a);
L = hexChars.charAt(a);
H = hexChars.charAt(b);
return hex;
}
function randByte() { return Math.floor(Math.random()*256%256); }
function blub(form)
{
s1 = form.inp.value;
xvaluestart = randByte();
xrefkill = "0x" + Dec2Hex(randByte()) + Dec2Hex(randByte()) + Dec2Hex(randByte()) + Dec2Hex(randByte());
finallen = s1.length+1;
hexsequence = '&"';
xvalue = xvaluestart;
for(i=0;i<s1.length;i++)
{
ch = s1.substr(i,1);
var chval;
if(ch=="\\"){
i++;
ch = s1.substr(i,1);
if(ch=="0") { chval = 0; }
else if(ch=="n") { chval = 10; }
else if(ch=="\\") { chval = toAscii("\\"); }
else if(ch=="r") { chval = 13; }
else { javascript:alert("invalid control sequence: \\"+ch); }
--finallen;
}
else if(ch=="|"){
chval=0;
}
else {
chval = toAscii(ch);
if(chval==0) { form.ans.value = "invalid character: "+ch; return; }
}
chval ^=xvalue;
xvalue += 1;
xvalue %= 256;
hexsequence += "\\x"+ Dec2Hex(chval);
}
hexsequence += '"[0]';
s2 = "/*"+s1+"*/XorStr<0x" + Dec2Hex(xvaluestart) + "," + finallen + ","+xrefkill+'>('
s2 += hexsequence + "+" + xrefkill + ").s";
form.ans.value = s2;
form.ans.focus();
form.ans.select();
}
</SCRIPT>
</HEAD>
<BODY background="../imgs/bg.gif">
<CENTER>
<FORM name=formx>
<INPUT name=inp size=20 value="IsDebuggerPresent"> <br><br>
<INPUT onclick=blub(this.form) type=button value="****** CONVERT TO XOR STRING ******"><br>
<INPUT name=ans size=220 ?number?>
</FORM>
</CENTER>