Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if (PHP_SAPI !== 'cli') exit();
- if ($argc !== 3 || in_array($argv[1], ['--help', '-h'])) {
- echo "Usage: {$argv[0]} INFILE OUTFILE", PHP_EOL;
- exit();
- }
- $in = fopen($argv[1], 'r');
- $out = fopen($argv[2], 'w');
- $m = 0x80;
- for ( ; false !== ($c = fgetc($in)); $m++) {
- if ($m == 0xff) $m = 0x80;
- fwrite($out, chr(ord($c) ^ $m));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement