PHP Base64 Decode Loop?

Discussion in 'PHP' started by thesurface, Dec 12, 2013.

  1. #1
    Hello, anyone know how in php i can decode "loop" which is base64ed or gzinflated etc ...

    Sample:
    http://www.unphp.net/
    http://ddecode.com/phpdecoder/

    Thanks.
     
    thesurface, Dec 12, 2013 IP
  2. AlbCoder

    AlbCoder Well-Known Member

    Messages:
    126
    Likes Received:
    1
    Best Answers:
    1
    Trophy Points:
    163
    #2
    Use a base64 decoder there are many sites wich are free on the internet
    http://www.tareeinternet.com/scripts/decrypt.php
     
    AlbCoder, Dec 12, 2013 IP
  3. thesurface

    thesurface Active Member

    Messages:
    260
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    73
    #3
    That wont help, i said with "loop" or "iteration", what if script is encoded 100x, i dont want to do it manually ;)
     
    thesurface, Dec 12, 2013 IP
  4. Andrei_RO

    Andrei_RO Well-Known Member

    Messages:
    86
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    130
    #4
    Just adjust the $contents variable to your need. also if it's just a base64 decode, adjust the preg_match
    echo "1. Reading coded.txt\n";
    $contents = "eval(gzinflate(base64_decode('FZzFcuRaFkU/p98LDcQUPRIzsyYdYlaKIb++01OHnXD')));";
    echo "2. Decoding\n";
    $i=0;
    while (preg_match("/eval\(gzinflate/",$contents)) {
      $contents=preg_replace("/<\?|\?>/", "", $contents);
      eval(preg_replace("/eval/", "\$contents=", $contents));
      echo $i++,'<br>';
    }
    echo "3. Writing decoded.txt\n";
    $fp2 = fopen("decoded.txt","w");
    fwrite($fp2, trim($contents));
    fclose($fp2);
    
    PHP:
     
    Andrei_RO, Dec 12, 2013 IP
    EvcRo likes this.
  5. andrewhoward123

    andrewhoward123 Active Member

    Messages:
    149
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    50
    #5
    First of define autoload in php..
     
    andrewhoward123, Dec 15, 2013 IP
  6. Andrei_RO

    Andrei_RO Well-Known Member

    Messages:
    86
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    130
    #6
    What do you mean? the guy asked for an iteration that decodes some base64...
     
    Andrei_RO, Dec 16, 2013 IP