Reza Fahmi Reza Fahmi - 5 months ago 11
Javascript Question

I can't execute unpacked javascript

I can't execute this javascript after I unpacked, anything wrong?

<script>
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('$(1f).1i(6(){$("#j").17(6(){$.E({o:\'5/O\',G:l,I:\'H\',Y:\'X\',m:6(8){$("#j").h("3","3");$("#k").h("3","3");11(8.16){$("#O").7(8.O);$("#C").7(\'<i 1="4 4-1a-14"></i> 1c: \'+8.C);$("#5").7(\'<0 1="g-e-12"><0 1="2 2-m"><0 1="2-f"><0 1="2-d">q 1d</0></0><0 1="2-9">\'+8.v+\'</0></0></0>\')}1b $("#5").7(\'<0 1="g-e-12"><0 1="2 2-t"><0 1="2-f"><0 1="2-d">q..</0></0><0 1="2-9">\'+8.v+\'</0></0></0>\')},K:6(a,b,c){$("#j").h("3","3");$("#k").h("3","3");$("#5").7(\'<0 1="g-e-12"><0 1="2 2-t"><0 1="2-f"><0 1="2-d">q..</0></0><0 1="2-9">\'+c+\'</0></0></0>\')},z:6(){$("#j").r("3","3");$("#k").r("3","3");$("#5").7(\'<0 1="g-e-12"><0 1="2 2-Q"><0 1="2-f"><0 1="2-d">R..</0></0><0 1="2-9"><0 1="T"><0 1="u-U"><p><i 1="4 4-P 4-A 4-y 4-D x-B"></i></p><n S="L-N">M 19 15 O J..</n></0></0></0></0></0>\')}});w l});$("#k").17(6(){$.E({o:\'5/V\',G:l,I:\'H\',m:6(8){$("#j").h("3","3");$("#k").h("3","3");$("#5").7(\'<0 1="g-e-12"><0 1="2 2-m"><0 1="2-f"><0 1="2-d">W 13</0></0><0 1="2-9">\'+8+\'</0></0></0>\')},K:6(a,b,c){$("#j").h("3","3");$("#k").h("3","3");$("#5").7(\'<0 1="g-e-12"><0 1="2 2-t"><0 1="2-f"><0 1="2-d">q..</0></0><0 1="2-9">\'+c+\'</0></0></0>\')},z:6(){$("#j").r("3","3");$("#k").r("3","3");$("#5").7(\'<0 1="g-e-12"><0 1="2 2-Q"><0 1="2-f"><0 1="2-d">R..</0></0><0 1="2-9"><0 1="T"><0 1="u-U"><p><i 1="4 4-P 4-A 4-y 4-D x-B"></i></p><n S="L-N">M Z s-s J..</n></0></0></0></0></0>\')}});w l})});6 1h(o,F,18){$.E({o:o,10:18+\'=\'+F,G:l,I:\'H\',m:6(8){$("#5").7(\'<0 1="g-e-12"><0 1="2 2-m"><0 1="2-f"><0 1="2-d">W 13</0></0><0 1="2-9">\'+8+\'</0></0></0>\')},K:6(a,b,c){$("#5").1e(o)},z:6(){$("#5").7(\'<0 1="g-e-12"><0 1="2 2-Q"><0 1="2-f"><0 1="2-d">R..</0></0><0 1="2-9"><0 1="T"><0 1="u-U"><p><i 1="4 4-P 4-A 4-y 4-D x-B"></i></p><n S="L-N">M Z s-s J..</n></0></0></0></0></0>\')}});w l}6 V(F){$.E({o:\'5/V\',10:\'1g=\'+F,G:l,I:\'H\',Y:\'X\',m:6(8){$("#j").h("3","3");$("#k").h("3","3");11(8.16){$("#C").7(\'<i 1="4 4-1a-14"></i> 1c: \'+8.C);$("#5").7(\'<0 1="g-e-12"><0 1="2 2-m"><0 1="2-f"><0 1="2-d">q 1d</0></0><0 1="2-9">\'+8.v+\'</0></0></0>\')}1b $("#5").7(\'<0 1="g-e-12"><0 1="2 2-t"><0 1="2-f"><0 1="2-d">q..</0></0><0 1="2-9">\'+8.v+\'</0></0></0>\')},K:6(a,b,c){$("#j").h("3","3");$("#k").h("3","3");$("#5").7(\'<0 1="g-e-12"><0 1="2 2-t"><0 1="2-f"><0 1="2-d">q..</0></0><0 1="2-9">\'+c+\'</0></0></0>\')},z:6(){$("#j").r("3","3");$("#k").r("3","3");$("#5").7(\'<0 1="g-e-12"><0 1="2 2-Q"><0 1="2-f"><0 1="2-d">R..</0></0><0 1="2-9"><0 1="T"><0 1="u-U"><p><i 1="4 4-P 4-A 4-y 4-D x-B"></i></p><n S="L-N">M 19 15 V 1j s J..</n></0></0></0></0></0>\')}});w l}',62,82,'div|class|panel|disabled|fa|menu|function|html|hasil|body||||title|md|heading|col|removeAttr||getfollowers|getlikes|false|success|span|url||Hasil|attr|foto|warning|text|content|return|margin|3x|beforeSend|pulse|bottom|point|fw|ajax|id|timeout|POST|type|anda|error|help|Sedang|block|followers|spinner|info|Loading|clas|row|center|likes|Pilih|JSON|dataType|memuat|data|if||Foto|card|penambahan|result|click|add|memproses|credit|else|Poin|Coy|load|document|media_id|loadmore_|ready|pada'.split('|'),0,{}))
</script>


And this is the unpacked version after I am beautifuer it...

$("#getlikes").click(function () {
$.ajax({
url: 'menu/likes',
timeout: false,
type: 'POST',
success: function (hasil) {
$("#getfollowers").removeAttr("disabled", "disabled");
$("#getlikes").removeAttr("disabled", "disabled");
$("#menu").html('<div class="col-md-12"><div class="panel panel-success"><div class="panel-heading"><div class="panel-title">Pilih Foto</div></div><div class="panel-body">' + hasil + '</div></div></div>')
},
error: function (a, b, c) {
$("#getfollowers").removeAttr("disabled", "disabled");
$("#getlikes").removeAttr("disabled", "disabled");
$("#menu").html('<div class="col-md-12"><div class="panel panel-warning"><div class="panel-heading"><div class="panel-title">Hasil..</div></div><div class="panel-body">' + c + '</div></div></div>')
},
beforeSend: function () {
$("#getfollowers").attr("disabled", "disabled");
$("#getlikes").attr("disabled", "disabled");
$("#menu").html('<div class="col-md-12"><div class="panel panel-info"><div class="panel-heading"><div class="panel-title">Loading..</div></div><div class="panel-body"><div class="row"><div class="text-center"><p><i class="fa fa-spinner fa-pulse fa-3x fa-fw margin-bottom"></i></p><span clas="help-block">Sedang memuat foto-foto anda..</span></div></div></div></div></div>')
}
}


Any help?

Answer

Syntax

The unpacked code seems to have a few syntax errors, i think i've fixed all of them in the function below.

For the future I recomend running your code trough a syntax validator like this.

 $("#getlikes").click(function () {
    $.ajax({
        url: 'menu/likes',
        timeout: false,
        type: 'POST',
        success: function (hasil) {
            $("#getfollowers").removeAttr("disabled", "disabled");
            $("#getlikes").removeAttr("disabled", "disabled");
            $("#menu").html('<div class="col-md-12"><div class="panel panel-success"><div class="panel-heading"><div class="panel-title">Pilih Foto</div></div><div class="panel-body">' + hasil + '</div></div></div>');
        },
        error: function (a, b, c) {
            $("#getfollowers").removeAttr("disabled", "disabled");
            $("#getlikes").removeAttr("disabled", "disabled");
            $("#menu").html('<div class="col-md-12"><div class="panel panel-warning"><div class="panel-heading"><div class="panel-title">Hasil..</div></div><div class="panel-body">' + c + '</div></div></div>');
        },
        beforeSend: function () {
            $("#getfollowers").attr("disabled", "disabled");
            $("#getlikes").attr("disabled", "disabled");
            $("#menu").html('<div class="col-md-12"><div class="panel panel-info"><div class="panel-heading"><div class="panel-title">Loading..</div></div><div class="panel-body"><div class="row"><div class="text-center"><p><i class="fa fa-spinner fa-pulse fa-3x fa-fw margin-bottom"></i></p><span clas="help-block">Sedang memuat foto-foto anda..</span></div></div></div></div></div>');
        }
    });
}

I hope this solves your problem!

edit: now it should work, i made a small mistake myself, but i fixed it.