Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $HEXDCDKEY = "C6-17-4D-88-6F-AD-2D-44-C1-6F-04-1B-D5-60-73";
- /* Need to convert $HEXDCDKEY to $cdkey */
- $cdkey = "F32V-LBRRF-BG9LN-LMK3R-AXDG0";
- $GameGUID = md5($cdkey);
- $BEGUID = md5("BE".$GameGUID);
- $BEGUIDHEX = strhex($BEGUID);
- echo $cdkey . "\n";
- echo $GameGUID . "\n";
- echo $BEGUID . "\n";
- echo $BEGUIDHEX . "\n";
- // UDP Message to be Sent
- $msg = hextobin("b1fbe207".$BEGUIDHEX);
- // Get BattlEye Servers IP
- $battleip = gethostbyname ( "arma2oa1.battleye.com" );
- // Open the UDP Socket
- $sock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
- // Get the Message Length
- $len = strlen($msg);
- // Bind the socket to a specific port for BattlEye on the local IP
- socket_bind($sock,'192.168.0.56', 57374);
- // Send the message to BattlEye Server
- socket_sendto($sock, $msg, $len, 0, $battleip, 2324);
- // Listen for response on bound socket
- socket_recv($sock, $buf, 100, 0);
- // Echo Result
- echo $buf . "\n";
- // Close the socket like a good boy!
- socket_close($sock);
- // Function to convert Hex to Binary
- function hextobin($hexstr)
- {
- $n = strlen($hexstr);
- $sbin="";
- $i=0;
- while($i<$n)
- {
- $a =substr($hexstr,$i,2);
- $c = pack("H*",$a);
- if ($i==0){$sbin=$c;}
- else {$sbin.=$c;}
- $i+=2;
- }
- return $sbin;
- }
- function strhex($string) {
- $hexstr = unpack('H*', $string);
- return array_shift($hexstr);
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement