decoder.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #!/usr/bin/php
  2. <?php
  3. /*
  4. * Copyright © 2020 Anonymous
  5. * This program is free software. It comes without any warranty, to the extent permitted by applicable law. You can redistribute it and/or modify it under the
  6. * terms of the Do What The Fuck You Want To Public License, Version 2,
  7. * as published by Sam Hocevar. See the COPYING file for more details.
  8. */
  9. if ($argc != 2)
  10. {
  11. fwrite(STDERR, "Usage: decoder.php [license]" . PHP_EOL);
  12. fwrite(STDERR, "license is license to be decoded" . PHP_EOL);
  13. exit();
  14. }
  15. $license = trim($argv[1]);
  16. $p = 13;
  17. $x = 5; //rand(2, $p-1);
  18. $shift = $x;
  19. $blocks = explode(' ', $license);
  20. $res = '';
  21. foreach($blocks as $block)
  22. {
  23. $m = '';
  24. for($i = 0; $i < strlen($block); $i += 2)
  25. {
  26. $a = base_convert($block[$i], 36, 10) - ($i / 2 + $shift) % 27;
  27. $b = base_convert($block[$i + 1], 36, 10) - ($i / 2 + $shift) % 24;
  28. $m .= ($b * (pow($a, $p - $x - 5) ) ) % $p;
  29. }
  30. $m = base_convert($m, 10, 16);
  31. for ($a = 0; $a < strlen($m); $a += 2)
  32. $res .= chr(hexdec( $m{$a}.$m{ $a+1 }) );
  33. $shift += $x;
  34. }
  35. $key = explode('#', $res, 3);
  36. $key[0] = explode(',', $key[0]);
  37. print_r($key);
  38. print PHP_EOL;