- Joined
- Aug 14, 2009
- Messages
- 2,304
- Reaction score
- 1,189
$ip = '127.0.0.1';
$queryport = 34005;
$socket = [USER=493081]fsockopen[/USER]("udp://".$ip, $queryport , $errno, $errstr, 1);
stream_set_timeout($socket, 1);
stream_set_blocking($socket, TRUE);
fwrite($socket, "\xFF\xFF\xFF\xFF\x56\x00\x00\x00\x1");
$response = fread($socket, 4096);
@fclose($socket);
header('Content-type: text/plain');
hex_dump($response);
ID = -1
Header = 0x56 / 86 (int)
SuperID = 1
3452816641 (ulong / DWORD) / cdcdcd01 (Hex)
struct A2S_SUPERINFO
{
long id;
BYTE header;
DWORD superId;
};
fwrite($socket, "\xFF\xFF\xFF\xFF\x56\x00\x00\x00\x1\x00\x00\x00");
fwrite($socket, "\xFF\xFF\xFF\xFF\x56\x1\x00\x00\x00");
3452816640 / cdcdcd00
printf("%lu / %lx\n", p->superId, p->superId);
struct A2S_SUPERINFO
{
long id;
BYTE header;
BYTE padding0;
BYTE padding1;
BYTE padding2;
DWORD superId;
};
[COLOR=#848A91]#pragma[/COLOR][COLOR=#2E3133] pack[/COLOR][COLOR=#2E3133]([/COLOR][COLOR=#2E3133]push[/COLOR][COLOR=#2E3133],[/COLOR][COLOR=#6B291B]1[/COLOR][COLOR=#2E3133])
[/COLOR][COLOR=#00008B]struct[/COLOR][COLOR=#2E3133] foo [/COLOR][COLOR=#2E3133]{[/COLOR][COLOR=#2E3133]
[/COLOR][COLOR=#848A91]// etc..[/COLOR][COLOR=#2E3133]
[/COLOR][COLOR=#2E3133]};[/COLOR][COLOR=#2E3133]
[/COLOR][COLOR=#848A91]#pragma[/COLOR][COLOR=#2E3133] pack[/COLOR][COLOR=#2E3133]([/COLOR][COLOR=#2E3133]pop[/COLOR][COLOR=#2E3133])
[/COLOR]