Skip to content

Commit

Permalink
Optimize "G", "M", "T", "J", "O"
Browse files Browse the repository at this point in the history
  • Loading branch information
hazzik committed Sep 21, 2013
1 parent dda47b0 commit 6cd7598
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 19 deletions.
45 changes: 32 additions & 13 deletions jsfuck.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,20 +56,20 @@
'D': 'Function("return escape")()("=")[2]',
'E': 'Function("return escape")()(">")[2]',
'F': '(+false+Function)[10]',
'G': USE_CHAR_CODE,
'G': '(false+Function("return Date")()())[30]',
'H': USE_CHAR_CODE,
'I': '(Infinity+"")[0]',
'J': USE_CHAR_CODE,
//'J': USE_CHAR_CODE,
'K': USE_CHAR_CODE,
'L': USE_CHAR_CODE,
'M': USE_CHAR_CODE,
'M': '(true+Function("return Date")()())[30]',
'N': '(NaN+"")[0]',
'O': USE_CHAR_CODE,
//'O': USE_CHAR_CODE,
'P': USE_CHAR_CODE,
'Q': USE_CHAR_CODE,
'R': USE_CHAR_CODE,
'S': '(+false+String)[10]',
'T': USE_CHAR_CODE,
'T': '(NaN+Function("return Date")()())[30]',
'U': USE_CHAR_CODE,
'V': USE_CHAR_CODE,
'W': USE_CHAR_CODE,
Expand All @@ -89,7 +89,7 @@
')': '(true+[]["filter"])[20]',
'*': USE_CHAR_CODE,
'+': '(+(+!+[]+(!+[]+[])[!+[]+!+[]+!+[]]+[+!+[]]+[+[]]+[+[]])+[])[2]',
',': '[[]]["concat"]([][[]])+""',
',': '[[]]["concat"]([[]])+""',
'-': '(+(.0000000001)+"")[2]',
'.': '(+(+!+[]+[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+[!+[]+!+[]]+[+[]])+[])[+!+[]]',
'/': '(false+[+false])["italics"]()[10]',
Expand Down Expand Up @@ -150,6 +150,7 @@
for (i = MIN; i <= MAX; i++){
character = String.fromCharCode(i);
value = MAPPING[character];
if(!value) {continue;}
original = value;

for (key in CONSTRUCTORS){
Expand Down Expand Up @@ -244,13 +245,31 @@
if (replacement){
output.push(replacement);
} else {
replacement =
"([]+[])[" + encode("constructor") + "]" +
"[" + encode("fromCharCode") + "]" +
"(" + encode(c.charCodeAt(0) + "") + ")";

output.push(replacement);
MAPPING[c] = replacement;
if (c === "J") {
replacement =
"([][" + encode("filter") + "]" +
"[" + encode("constructor") + "]" +
"(" + encode("return new Date(200000000)") + ")()+[])[!+[]+!+[]+!+[]+!+[]]";

output.push(replacement);
MAPPING[c] = replacement;
} else if (c === "O") {
replacement =
"([][" + encode("filter") + "]" +
"[" + encode("constructor") + "]" +
"(" + encode("return new Date(24000000000)") + ")()+[])[!+[]+!+[]+!+[]+!+[]]";

output.push(replacement);
MAPPING[c] = replacement;
} else {
replacement =
"([]+[])[" + encode("constructor") + "]" +
"[" + encode("fromCharCode") + "]" +
"(" + encode(c.charCodeAt(0) + "") + ")";

output.push(replacement);
MAPPING[c] = replacement;
}
}
}
});
Expand Down
12 changes: 6 additions & 6 deletions output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
`)` 186
`*` 8310
`+` 75
`,` 628
`,` 626
`-` 178
`.` 72
`/` 383
Expand All @@ -37,20 +37,20 @@
`D` 4813
`E` 4314
`F` 1073
`G` 8341
`G` 6300
`H` 8346
`I` 75
`J` 8320
`J` 9210
`K` 10516
`L` 8481
`M` 8327
`M` 6301
`N` 21
`O` 8318
`O` 9238
`P` 8315
`Q` 8317
`R` 8321
`S` 925
`T` 8331
`T` 6303
`U` 8336
`V` 8341
`W` 8346
Expand Down

0 comments on commit 6cd7598

Please sign in to comment.