Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function strToHex( $string )
- {
- $hex='';
- for ( $i=0; $i < strlen( $string ); $i++ )
- {
- $hex .= dechex( ord( $string[$i] ) );
- }
- return $hex;
- }
- function endian_swap_uint( &$x )
- {
- $x = ( $x>>24 ) |
- ( ( $x << 8 ) & 0x00FF0000 ) |
- ( ( $x >> 8 ) & 0x0000FF00 ) |
- ( $x << 24 );
- }
- endian_swap_uint( strToHex( fread( $filePointer, 4 ) ) );
- /*
- strToHex() - returns the wrong endianess but in a string.
- endian_swap_uint() - tries to straighten it out, but is just returning a NULL
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement