简体   繁体   中英

PHP encode/decode

I had this code:

eval(str_rot13('shapgvba purpx_sbbgre(){tybony $nz_bcgvba;$y=\'<n uers="uggc://jjj.penmlkugzy.pbz" gnetrg="_oynax">CFQ gb UGZY PFF</n>\';$s=GRZCYNGRCNGU.\'/sbbgre.cuc\';$sq=sbcra($s,\'e\');$p=sernq($sq,svyrfvmr($s));spybfr($sq);vs(fgecbf($p,$y)==0){rpub($nz_bcgvba[\'phfgbz\'][\'cevinpl\']);qvr;}}purpx_sbbgre();'));

I used to decode it with http://www.unphp.net/

Which became this code:

<?php function check_footer() {
    global $am_option;
    $l = '<a href="http://www.crazyxhtml.com" target="_blank">PSD to HTML CSS</a>';
    $f = TEMPLATEPATH . '/footer.php';
    $fd = fopen($f, 'r');
    $c = fread($fd, filesize($f));
    fclose($fd);
    if (strpos($c, $l) == 0) {
        echo ($am_option['custom']['privacy']);
        die;
    }
}
function check_footer() {
    global $am_option;
    $l = '<a href="http://www.crazyxhtml.com" target="_blank">PSD to HTML CSS</a>';
    $f = TEMPLATEPATH . '/footer.php';
    $fd = fopen($f, 'r');
    $c = fread($fd, filesize($f));
    fclose($fd);
    if (strpos($c, $l) == 0) {
        echo ($am_option['custom']['privacy']);
        die;
    }
}
check_footer();

Can someone help me how can I encode this back? I mean I changed somethings but dont know how to encode in similar language/code.

Thank you in advance.

Rot13 just shifts ascii letters 13 characters. Since there are 26 letters in the ASCII alphabet, this means shifting them 13 characters again will reverse the operation. Since non-ascii-letters will be ignored by the operation altogether, the reverse of rot13 is just rot13 again, as you can see below:

> $x='shapgvba purpx_sbbgre(){tybony $nz_bcgvba;$y=\'<n uers="uggc://jjj.penmlkugzy.pbz" gnetrg="_oynax">CFQ gb UGZY PFF</n>\';$s=GRZCYNGRCNGU.\'/sbbgre.cuc\';$sq=sbcra($s,\'e\');$p=sernq($sq,svyrfvmr($s));spybfr($sq);vs(fgecbf($p,$y)==0){rpub($nz_bcgvba[\'phfgbz\'][\'cevinpl\']);qvr;}}purpx_sbbgre();';
> var_dump($x === str_rot13(str_rot13($x)));
bool(true)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM