![]() |
|
Welcome to the Computer Webmaster Gaming Console Graphics Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
| |||||||
| PHP PHP for some can be one of the hardest website programming codes, so do you need help on your PHP script, if it is php4, php5 or lower this is the place for you for any PHP help. |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | #1 | ||
| I'm writting a bunch of standards for interpreting net communication, and built my first icmp echo request interpreter, and wanted to release it to the public, it may be of some use to someone... I will post back the entire class, but this was just a quick sandbox code I wrote up just to understand the protocol standard... <?php $data = "\x08\x00\x19\x2f\x00\x00\x00\x00\x70\x69\x6e\x67" ; /* 8 bits in a byte strlen() returns length of a string in bytes. */ //$data = "\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ; echo 'String $data is ' . strlen($data) . ' bytes in size, or ' . (strlen($data) * 8) . ' bits in size' . "\n"; var_dump($data); var_dump(unpack("Ctype/Ccode/Cchecksum/nidentifier/nsequenceNumber/ Ndata", $data)); print_r(unpack("Ctype/Ccode/Cchecksum/nidentifier/nsequenceNumber/ Ndata", $data)); echo implode(' ', unpack('C*', $data)) . "\n"; foreach (unpack("Ctype/Ccode/Cchecksum/nidentifier/nsequenceNumber/@8/ c*data", $data) as $key => $string) { echo $key . ' => '. str_pad(dechex($string), 2, '0', STR_PAD_LEFT) . "\n"; } ?> Comments are welcome... please! | |||
| Featured Websites | ||||
|
![]() |
| Tags: packet, parsing |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| Featured Websites | ||||
|