Skip to content

Instantly share code, notes, and snippets.

@JavaScript-Packer
JavaScript-Packer / string2binary.js
Created April 30, 2015 23:55
Convert a string of text to Base2 binary (with spacing as delimiter)
var Δ='JavaScript Packer';
function str2bin(Δ, w, o) {
w = [];
for (o in Δ) {
w.push(Δ.charCodeAt(o).toString(2));
}
return w.join(" ");
}
alert(str2bin(Δ));
@JavaScript-Packer
JavaScript-Packer / wow.js
Created May 1, 2015 00:01
Crazy ways to obfuscate JavaScript functions/commands
// I still can't get over how I can obfuscate alert(69) to
\u0061\u006c\u0065\u0072\u0074(69)
// and it will still work (in JavaScript)
@JavaScript-Packer
JavaScript-Packer / bookmarklet-collection.txt
Created May 1, 2015 06:59
Largest collection of bookmarklet tools on the internet... A little of everything...
http://jsfiddle.net/nh8e22r4/show/ - 2,500 bookmarklets 
@JavaScript-Packer
JavaScript-Packer / replace-all.js
Created May 1, 2015 07:26
My favorite function for search and replace in JavaScript
function replaceAllExact(str,find,replace){
return str.split(find).join(replace)
};
alert(replaceAllExact('Google VS. www.google.com','google','seekfreak'));
//minified
//function i(i,a,e){return i.split(a).join(e)}alert(i("Google VS. www.google.com","google","seekfreak"))
@JavaScript-Packer
JavaScript-Packer / smiley-obfuscator.js
Created May 1, 2015 11:29
Here is a complete web app called The Smiley Face Script Generator I made. It takes your JavaScript source code and then encodes it with smiley faces. It packs it up with the decoder built in so it is auto running code still. A demo of the generator on http://jsfiddle.net/tppzgm5e/show/
function smilies(e){var r,n,t,R='\x72\x65\x70\x6c\x61\x63\x65',a="";
for(r=0;r<e.length;r++)n=e.\u0063\u0068\u0061\u0072\u0043\u006f\u0064\u0065\u0041\u0074(r).\u0074\u006f\u0053\u0074\u0072\u0069\u006e\u0067(4),t=n[R](/0/g,":(")[R](/1/g,":)")[R](/2/g,":P")[R](/3/g,":D"),a+=t+" ";
var p1="\x76\x61\x72\x20\x7a\x3d\x27\\\n\\\n",p3="\\\n\\\n',u=\\u0052\\u0065\\u0067\\u0045\\u0078\\u0070,\\u0072,\\u006e,\\u0074,\\u0061='',\\u006f=\\u007a['\\x73\\x70\\x6c\\x69\\x74'](' ');for(\\u0072=0;\\u0072<\\u006f['\\x6c\\x65\\x6e\\x67\\x74\\x68'];\\u0072++)\\u006e=\\u006f[\\u0072],\\u0074=\\u006e[x='\\x72\\x65\\x70\\x6c\\x61\\x63\\x65'](u(':\\\\(','g'),'0')[x](u(':\\\\)','g'),'1')[x](/:P/g,'2')[x](/:D/g,'3'),\\u0061+=\\u0053\\u0074\\u0072\\u0069\\u006e\\u0067['\\x66\\x72\\x6f\\x6d\\x43\\x68\\x61\\x72\\x43\\x6f\\x64\\x65'](\\u0070\\u0061\\u0072\\u0073\\u0065\\u0049\\u006e\\u0074(\\u0074,4));\\u0065\\u0076\\u0061\\u006c(\\u0061[x](/\\0/g,''));\x2f\x2a\x20\x77\x77\x77\x2e\x57\x48\x41\x4b\x2e\x63\x61\x20\x2a\x2f";
\u0073\u006d\u0
@JavaScript-Packer
JavaScript-Packer / blank-spaces-encoding.js
Last active August 29, 2015 14:20
Encode text to spaces (zerowidth, etc), it will appear invisible until you decode it. Complete web app in JavaScript. Live demo on http://www.whak.ca/invisible-encoder.htm
function whak(e) {
var r, n, t, a = "";
for (r = 0; r < e.length; r++) n = e.charCodeAt(r).toString(10), t = n[R = "replace"](/0/g, " ")[R](/1/g, "‌")[R](/2/g, "‍")[R](/3/g, "‎")[R](/4/g, "‏")[R](/5/g, " ")[R](/6/g, " ")[R](/7/g, " ")[R](/8/g, " ")[R](/9/g, " "),
a += t + "​";
return a;}
function unwhak(o, r, n, t, a) {
a = "";
o = o.split("​");
for (r = 0; r < o.length; r++) n = o[r], t = n[R = "replace"](/ /g, "0")[R](/‌/g, "1")[R](/‍/g, "2")[R](/‎/g, "3")[R](/‏/g, "4")[R](/ /g, "5")[R](/ /g, "6")[R](/ /g, "7")[R](/ /g, "8")[R](/ /g, "9"),
a += String.fromCharCode(parseInt(t, 10));
@JavaScript-Packer
JavaScript-Packer / decombine.js
Created May 3, 2015 11:06
Seperate combining characters, break out to individual characters. Demo on http://jsfiddle.net/j91k1x46/
//uncombine combined combiners
function Δ(n, t, r, o) {
for (o = [], t = 0, r = n.length; r > t; ++t) {
o.push(n.charAt(t));
}
return o.join(" ");
}
alert(Δ("S̨̥̫͎̭ͯ̿̔̀ͅ"));
@JavaScript-Packer
JavaScript-Packer / hidden-eval.js
Last active August 29, 2015 14:20
Command Runner Function - Highly obfuscated eval because some sites do not allow it (usually confuse it with PHP's evil eval)... Live demo on http://jsfiddle.net/rb46a1rr/1/
/* 348 bytes command runner AKA hidden eval, I modfied code from aemkei */
function command2(run) {
ウ = "", ア = !ウ + ウ, ネ = !ア + ウ, ホ = ウ + {}, ヌ = ア[ウ++], セ = ア[ミ = ウ], ハ = ++ミ + ウ,
ヘ = ホ[ミ + ハ], ア[ヘ += ホ[ウ] + (ホ.ホ + ホ)[ウ] + ネ[ハ] + ヌ + セ + ア[ミ] + ヘ + ヌ + ホ[ウ] +
セ][ヘ](ア[ハ] + "v" + ネ[ウ] + ネ[ミ] + "(" + run + ")")();
}
//command2("alert('WHAK.com'),alert(9)"); //semicolons will break it
// minified version to 256 bytes
/*
@JavaScript-Packer
JavaScript-Packer / 8bit-binary-combinations.js
Created May 3, 2015 15:22
Get all possible combinations and permutations for 8-bit binary. Live demo on http://jsfiddle.net/eur7o7eL/
function possible(e, n, t, r, W) {
if (0 === e.length) {
return [];
}
if (1 === e.length) {
return e[0];
}
n = [], t = possible(e.slice(1));
for (r in t) {
for (W = 0; W < e[0].length; W++) {
@JavaScript-Packer
JavaScript-Packer / replace-variable.js
Created May 4, 2015 00:54
Function to replace global using regex/regexp. Live demo on http://jsfiddle.net/v6f4nbhL/
function replacer(W, H, A, K) {
K = W.replace(new RegExp(H, "g"), A);
return K;
}
var str = "WHom";
var find = "Ho";
var r3plac3 = "HAK\u002eco";
alert(replacer(str, find, r3plac3));