Advertisement
Guest User

Untitled

a guest
Jul 10th, 2013
343
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.59 KB | None | 0 0
  1. <?php
  2. $HEXDCDKEY = "C6-17-4D-88-6F-AD-2D-44-C1-6F-04-1B-D5-60-73";
  3.  
  4. /* Need to convert $HEXDCDKEY to $cdkey */
  5.  
  6. $cdkey = "F32V-LBRRF-BG9LN-LMK3R-AXDG0";
  7. $GameGUID = md5($cdkey);
  8. $BEGUID = md5("BE".$GameGUID);
  9.  
  10. $BEGUIDHEX = strhex($BEGUID);
  11.  
  12. echo $cdkey . "\n";
  13. echo $GameGUID . "\n";
  14. echo $BEGUID . "\n";
  15. echo $BEGUIDHEX . "\n";
  16.  
  17. // UDP Message to be Sent
  18. $msg = hextobin("b1fbe207".$BEGUIDHEX);
  19.  
  20. // Get BattlEye Servers IP
  21. $battleip = gethostbyname ( "arma2oa1.battleye.com" );
  22.  
  23. // Open the UDP Socket
  24. $sock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
  25.  
  26. // Get the Message Length
  27. $len = strlen($msg);
  28.  
  29. // Bind the socket to a specific port for BattlEye on the local IP
  30. socket_bind($sock,'192.168.0.56', 57374);
  31.  
  32. // Send the message to BattlEye Server
  33. socket_sendto($sock, $msg, $len, 0, $battleip, 2324);
  34.  
  35.  
  36. // Listen for response on bound socket
  37. socket_recv($sock, $buf, 100, 0);
  38.  
  39. // Echo Result
  40. echo $buf . "\n";
  41.  
  42. // Close the socket like a good boy!
  43. socket_close($sock);
  44.  
  45. // Function to convert Hex to Binary
  46. function hextobin($hexstr)
  47. {
  48. $n = strlen($hexstr);
  49. $sbin="";
  50. $i=0;
  51. while($i<$n)
  52. {
  53. $a =substr($hexstr,$i,2);
  54. $c = pack("H*",$a);
  55. if ($i==0){$sbin=$c;}
  56. else {$sbin.=$c;}
  57. $i+=2;
  58. }
  59. return $sbin;
  60. }
  61.  
  62. function strhex($string) {
  63. $hexstr = unpack('H*', $string);
  64. return array_shift($hexstr);
  65. }
  66. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement