:)
ale nie da się wykorzystać, możesz parsować wyniki z jakiegoś skryptu, albo użyć np tego poniżej tylko dziwnie działa, bo nie zawsze działa i zwraca status nie tak jak tamten skrypt i w dodatku nie pamiętam autora [wstyd] ale na pewno na bazie skryptu był z gg.wha.la
function oblicz_hash ($haslo, $klucz)
{
$x0=0; $x1=0; $y0=0; $y1=0; $z=0; $tmp=0;
$y0 = ($klucz << 16) >> 16; $y1 = $klucz >> 16 ;
for ($i=0; $i<strlen($haslo); $i++)
{
$x0 = ($x0 & 0xFF00) | ord($haslo[$i]); $x1 &= 0xFFFF;
$y0 ^= $x0; $y1 ^= $x1;
$y0 += $x0; $y1 += $x1;
$x1 <<= 8; $x1 |= ($x0 >> 8); $x0 <<= 8;
$y0 ^= $x0; $y1 ^= $x1;
$x1 <<= 8; $x1 |= ($x0 >> 8); $x0 <<= 8;
$y0 -= $x0; $y1 -= $x1;
$x1 <<= 8; $x1 |= ($x0 >> 8); $x0 <<= 8;
$y0 ^= $x0; $y1 ^= $x1;
$z = $y0 & 0x1F;
$y0 &= 0xFFFF; $y1 &= 0xFFFF;
if ($z <= 16)
{
$tmp= ($y1 << $z) | ($y0 >> (16-$z));
$y0 = ($y1 >> (16-$z)) | ($y0 << $z);
$y1 = $tmp;
}else{
$tmp= $y0 << ($z-16);
$y0 = ($y0 >> (32-$z)) | ( (($y1 << $z) >> $z) << ($z-16) );
$y1 = ($y1 >> (32-$z)) | $tmp;
}
$y0 &= 0xFFFF; $y1 &= 0xFFFF;
}
$hash = hexdec(sprintf("%04x%04x", $y1, $y0));
settype($hash, 'integer');
return $hash;
}
function statusGG($numer_gg, $haslo_gg, $szukany_numer){
function serverGG($numer_gg){
$fp=fsockopen('appmsg.gadu-gadu.pl', 80, $errno, $errmsg, 1);
$host=''; $port='';
if($fp){
$get = "GET /appsvc/appmsg.asp?fmnumber=<$numer_gg> HTTP/1.0\r\n";
$get.= "Host: appmsg.gadu-gadu.pl\r\n";
$get.= "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)\r\n";
$get.= "Pragma: no-cache\r\n\r\n";
fputs($fp, $get);
for($i=0;$i<3;$i++) $buf.=fgets($fp, 128);
preg_match("/\s([\d\.]{8,16})\:([\d]{1,5})\s/", $buf, $adres);
list($host,$port)=Array($adres[1],$adres[2]);
fclose($fp);
}
if($host=='' || $port==''){
$ip = array(85, 86, 88, 89);
return Array('217.17.41.'.$ip[rand(0,sizeof($ip)-1)],8074);
} else {
return Array($host,$port);
}
}
$error=Array(0,'',false);
$ok=false;
list($host,$port)=serverGG($numer_gg);
for($i=0;$i<2 && !$ok;$i++){
$fp=@fsockopen($host, $port, $errno, $errstr, 1);
$ok=$fp && ($data = fread($fp, 12));
}
if($ok) return $error;
$tab = unpack("Vtyp/Vrozmiar/Vklucz", $data);
$hash = oblicz_hash($haslo_gg, $tab['klucz']);
$data = pack("VVVVVVvVvVvCCa0", 0x15, 0x20,
$numer_gg, $hash, 0x02, 0x20, 0, 0, 0, 0, 0, 0x14, 0xbe , '');
fwrite($fp, $data);
if (!$data1 = fread($fp, 8)) return $error;
$tab = unpack("Vstatus/Vrozmiar", $data1);
if($tab['status'] != 0x04) return $error;
$data = pack ("VVVC", 0x10, 5, $szukany_numer, 0x03);
if(!fwrite($fp,$data)) return $error;
$data = fread($fp, 8);
$tab = unpack("Vtyp/Vrozmiar", $data);
$data = fread($fp, $tab['rozmiar']);
fclose($fp);
$t = unpack("Iuin/Cstatus/Iremoteip/Sremoteport/Cversion/Cimagesize/Cunknown/Cdescription_size/a*descr", $data);
list($t['descr'], $t['powrot'])=explode("\0", $t['descr']);
if(strlen($t['powrot'])>0){
$temp=unpack("Vpowrot",$t['powrot']);
$t['powrot']=$temp['powrot'];
} else $t['powrot']=false;
return Array($t['status'],$t['descr'],$t['powrot']);
}
potem piszesz
$status = statusGG('7300345','4programmers','8285074');
pierwszy parametr to jest numer gg z którego ma się zalogować na serwer, utwórz jakiś, drugi to hasło do tego numeru a trzeci to numer którego status chcesz sprawdzić, potem zobacz jakie to dane zwraca
print_r($status);