forked from enkhee-Osiris/Decoder-JSFuck
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
192 lines (177 loc) · 5.73 KB
/
index.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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
<html>
<head>
<meta charset="UTF-8">
<title>JSfuck Decoder | De-Obfuscator</title>
<meta name="description" content="JSFuck decoder, de-obfuscator" />
<meta property="og:title" content="JSFuck de-obfuscator" />
<meta property="og:type" content="article" />
<meta property="og:url" content="https://enkhee-osiris.github.io/Decoder-JSFuck/" />
<meta property="og:description" content="JSFuck decoder, de-obfuscator" />
<style type="text/css">
@import 'https://fonts.googleapis.com/css?family=Open+Sans:300';
* {
margin: 0;
padding: 0;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
body {
position: relative;
height: 100vh;
padding: 20px;
text-align: left;
font-family: Lato;
color: #fff;
background: #52B3D9;
font-family: 'Open Sans', sans-serif;
text-align: center;
}
h1 {
font-weight: 300;
font-size: 40px;
text-transform: uppercase;
text-align: center;
margin: 20px 0;
}
textarea {
display: block;
clear: both;
margin-bottom: 10px;
border-radius: 7px;
padding: 15px 10px;
font-size: 14px;
outline: none;
border: none;
background-color: #34495E;
color: #fff;
-moz-transition: all 0.2s ease-in;
-o-transition: all 0.2s ease-in;
-webkit-transition: all 0.2s ease-in;
transition: all 0.2s ease-in;
}
input {
margin: 0 auto;
position: relative;
vertical-align: top;
width: 150px;
height: 60px;
padding: 0;
font-size: 22px;
font-weight: 300;
color: white;
text-align: center;
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
background: #2980b9;
border: 0;
border-bottom: 2px solid #2475ab;
cursor: pointer;
-webkit-box-shadow: inset 0 -2px #2475ab;
box-shadow: inset 0 -2px #2475ab;
}
input:active {
top: 1px;
outline: none;
-webkit-box-shadow: none;
box-shadow: none;
}
input:-ms-input-placeholder,
textarea:-ms-input-placeholder {
color: #fff;
font-size: 20px;
font-weight: 300;
text-transform: uppercase;
}
input::-moz-placeholder,
textarea::-moz-placeholder {
color: #fff;
font-size: 20px;
font-weight: 300;
text-transform: uppercase;
}
input::-webkit-input-placeholder,
textarea::-webkit-input-placeholder {
color: #fff;
font-size: 20px;
font-weight: 300;
text-transform: uppercase;
box-shadow: none;
-webkit-appearance: none;
}
textarea:hover {
background-color: #22313F;
color: #f2f2f2;
}
textarea:focus {
background-color: #1a252f;
color: #fff;
}
textarea {
height: 550px;
}
footer {
width: calc(100% - 40px);
position: absolute;
bottom: 20px;
}
footer > p a {
color: #2980b9;
text-decoration: none;
}
</style>
</head>
<body>
<h1>Wanna decode <font color="#f0f060">JSFuck?</font></h1>
<textarea placeholder="Paste your code here!" id="code" style="width:100%;min-height:300px"></textarea>
<input type="submit" onclick="decode()" value="Decode" />
<footer>
<p align="center">Crafted with <span style="color: #2980b9">♥</span> by <a href="http://github.com/enkhee-Osiris">Osiris</a>.</p>
</footer>
</body>
<script src="https://unpkg.com/jsfuck@0.4.0/jsfuck.js"></script>
<script type="text/javascript">
function patternCreator(prefix, postfix) {
replacedPrefix = prefix.replace(/[\[\]\(\)\+\!]/g, '\\$&');
replacedPostfix = postfix.replace(/[\[\]\(\)\+\!]/g, '\\$&');
return replacedPrefix + '(.*)' + replacedPostfix;
}
function isMatching(string, pattern) {
var result = string.match(new RegExp(pattern));
if (result) return result[1];
return null;
}
function setDecoded(decodedCode) {
var code = document.querySelector('#code');
code.value = eval(decodedCode);
}
function decode() {
var code = document.querySelector('#code');
var prefix = '[][' + JSFuck.encode('fill') + ']' +
'[' + JSFuck.encode('constructor') + ']' +
'(' + JSFuck.encode('return eval') + ')()(';
var postfix = ')';
var result = isMatching(code.value, patternCreator(prefix, postfix));
if (result) {
setDecoded(result);
return;
}
prefix = '[][' + JSFuck.encode('fill') + ']' +
'[' + JSFuck.encode('constructor') + '](';
postfix = ')()';
result = isMatching(code.value, patternCreator(prefix, postfix));
if (result) {
setDecoded(result);
return;
}
prefix = '[][' + JSFuck.encode('filter') + ']' +
'[' + JSFuck.encode('constructor') + '](';
postfix = ')()';
result = isMatching(code.value, patternCreator(prefix, postfix));
if (result) {
setDecoded(result);
return;
}
setDecoded(code.value);
}
</script>
</html>