PHP code example of mervick / javascript-unpacker

1. Go to this page and download the library: Download mervick/javascript-unpacker library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

mervick / javascript-unpacker example snippets


echo JavaScriptUnpacker::unpack(file_get_contents('/path/to/packed.js'));

$js =<<<JS
eval(function(p,a,c,k,e,r){e=String;if(!''.replace(/^/,String)){while(c--)r[c]=k[c]||c;k=[function(e){return r[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}('0.1(\'2 3!\');',4,4,'console|log|Hello|world'.split('|'),0,{}));
JS;

echo JavaScriptUnpacker::unpack($js);
// output: console.log('Hello world!');;