Thread: Glb
View Single Post
  #2  
Old 07-08-2017, 06:44 AM
lolfake is offline lolfake
lolfake's Avatar
Delta Team Maps

Join Date: Sep 2006
Location: LOL Not Found
Posts: 277

Cool

Ok i tested it with that glb you linked to and it did work fine. There is not many servers on but it it does work. I was able to get the php version i have to. The php version replaces the 0 charactors with a <br>. I did this well testing the format of the glb when i started to look at it. You can simply change that if you would like. Ill paste the php in this message. You can simply copy it to a file and name it anything.php If you have problems with it or it does not all copy right then let me know and ill send it to you other way.
PHP Code:
 <? 

  $fp 
fopen ("http://nw4.novaworld.net/bhd_6x.glb""rb");  

  
$str ''
  while (!
feof($fp)) { 
    
$str .= fread($fp8192); 
  } 

  
fclose ($fp); 

  echo 
DecodeGLB($str); 

Function 
DecodeGLB ($str) {   

  
$constdec[0] = 112;   
  
$constdec[1] = 222;   
  
$constdec[2] = 76;   
  
$constdec[3] = 186;   
  
$constdec[4] = 40;   
  
$constdec[5] = 150;   
  
$constdec[6] = 4;   

  
$multi 0xA0C2
  
$key "NOVAWORLD";   
  
$rconst "0";   
  
$rkey "0";   
  
$x "0";   

  
$len strlen($str);   

  for(
$i=0;$i<$len;$i++){   

    if (
$rconst 6) {   

      
$rconst "0";   
      
$x++;   
     
    } 

    if (
$rkey >= strlen($key)) $rkey "0"

    
$lowbase 0x4B05731 $multi 0xFFFF;   
    
$multi $lowbase

    
$result ord($str[$i]) - ord($key[$rkey]) + $constdec[$rconst] + ($x 2) - $lowbase 0xFF

    if (
$result != 0$gameslist .= chr($result);  
    if (
$result == 0$gameslist .= "<br>";  

    
$rkey++;   
    
$rconst++;   

  } 
   
  return 
$gameslist
__________________
Reply With Quote