Advertisement
secondcoming

calculate guid

Jul 6th, 2016
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.62 KB | None | 0 0
  1. <?php
  2.  
  3. //echo "".PHP_INT_MAX."<br>";
  4.  
  5. date_default_timezone_set('Europe/London');
  6.  
  7. include "includes/header.php";
  8.  
  9. if ((!isset($_POST['steamid']) && !isset($_POST['submitok'])) || $_POST['steamid'] == "")
  10. {
  11.     echo '<div style="float:left;padding:20px;">';
  12.     echo '  <form method="post" action="lookup.php" name="myform">
  13.                <p style="width:100%;padding-top:5px;padding-bottom:5px">
  14.                    <label>Steam64ID:</label><br>
  15.                    <input type="text" name="steamid" size=45 id="steamid"></input>
  16.                    <input type="hidden" name="submitok" value="true">
  17.                    <input type="submit">
  18.                </p>
  19.            </form>
  20.            <script language="Javascript"  type="text/javascript"><!--
  21.            document.myform.steamID.focus();
  22.            //-->
  23.            </script>
  24.        </div>';    
  25. }
  26. else
  27. {
  28.     $steamid = $_POST['steamid'];
  29.     $guid = getGUID($steamid);
  30.  
  31.     $temp = '';
  32.     for ($i = 0; $i < 8; $i++) {
  33.             $temp .= chr($steamid & 0xFF);
  34.             $steamid >>= 8;
  35.     }
  36.     $return = md5('BE' . $temp);
  37.  
  38.     echo '<div style="float:left;padding:20px;">';
  39.     echo "<hr>steam64ID: ".$_POST['steamid']."<br>guid: $return<hr>";
  40.     echo '</div>';
  41.    
  42. }
  43.  
  44. function A2S($steamid)
  45. {
  46.     return bcadd($steamid,'76561197960265728');
  47. }
  48.  
  49. function S2A($steamid)
  50. {
  51.     return bcsub($steamid,'76561197960265728');
  52. }
  53.  
  54. function getGUID($steamid)
  55. {
  56.     $temp = '';
  57.     for ($i = 0; $i < 8; $i++) {
  58.             $temp .= chr($steamid & 0xFF);
  59.             $steamid >>= 8;
  60.     }
  61.     $return = md5('BE' . $temp);    
  62. }
  63.  
  64. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement