Code: Select all
andCode: Select all
tags where appropriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
Hello,
I am reading a file and trying to decifer individual bytes in a shockwave file and having a great deal of success. I'm having problems decoding an example.
The file is a compressed file and I can read most of the header information w/ no problem.
I encounter a bit of difficulty w/ this line of code:Code: Select all
$buffer = fread($fp, $this->size ) ;
$buffer = gzuncompress($buffer, $this->size);
$this->fps = Array() ;
for( $i=0; $i<2; $i++ )
{
$t = substr($buffer,0,1 ); #take the first byte in front
$t = ord($t) ;
$buffer = substr($buffer,1) ;
$this->fps[] = $t ;
}the hex dump for the 2 bytes are: C0 C0
I know the bytes are being swapped somehow but I do not really understand how.
Any ideas?
Jcart | Please use
Code: Select all
andCode: Select all
tags where appropriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]