VanGans

Hex str

Feb 10th, 2019
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.60 KB | None | 0 0
  1. <?php
  2. // Coded By VanGand - AnarchoXploit
  3. // Str To Hex & Hex To Str
  4. // Char Code Tools
  5. // http://bukanakumas.com
  6. error_reporting(0);
  7. function strToHex($str){
  8. $hex='';
  9. for ($i=0; $i < strlen($str); $i++){
  10. $hex .= "\x".dechex(ord($str[$i]));
  11. }
  12. return $hex;
  13. }
  14. function hexToStr($hex){
  15. $str='';
  16. for ($i=0; $i < strlen($hex)-1; $i+=2){
  17. $str .= chr(hexdec($hex[$i].$hex[$i+1]));
  18. }
  19. return $str;
  20. }
  21. if($argv[1] == "hex"){
  22. $gzin = $argv[2];
  23. $char = strToHex($gzin);
  24. echo "\n$char\n";
  25. }
  26. if($argv[1] == "unhex"){
  27. $buff = str_replace('\x',"",$argv[2]);
  28. $char = hexToStr($buff);
  29. echo "\n$char\n";
  30. }
  31. ?>
Advertisement
Add Comment
Please, Sign In to add comment