Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Copyright (c) 2020 Ramdhan Firmansyah
- * File : encode.php
- * @author : Cvar1984 <gedzsarjuncomuniti@gmail.com>
- * Date : 28.04.2020
- * Last Modified Date: 28.04.2020
- * Last Modified By : Cvar1984 <gedzsarjuncomuniti@gmail.com>
- */
- while (!file_exists($fileName)) {
- $fileName = readline('File Name : ');
- $fileName = trim($fileName);
- }
- $outputName = readline('Output Name : ');
- $outputName = trim($outputName);
- $fileContents = file_get_contents($fileName);
- $fileContents = base64_encode(gzdeflate($fileContents));
- $fileContents = '<?php eval(\'?>\' . gzinflate(base64_decode(\'' . $fileContents . '\')));';
- if (file_put_contents($outputName, $fileContents)) {
- echo 'Original Size : ' . filesize($fileName) . ' Bytes' . PHP_EOL;
- echo 'Encoded Size : ' . filesize($outputName) . ' Bytes' . PHP_EOL;
- } else {
- echo 'Can\'t write output permission denied' . PHP_EOL;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement