BytestringToGUID example

        // Object Size QWORD 64 // size of header object, including 30 bytes of Header Object header         // Number of Header Objects DWORD 32 // number of objects in header object         // Reserved1 BYTE 8 // hardcoded: 0x01         // Reserved2 BYTE 8 // hardcoded: 0x02
        $info['fileformat'] = 'asf';

        $this->fseek($info['avdataoffset']);
        $HeaderObjectData = $this->fread(30);

        $thisfile_asf_headerobject['objectid']      = substr($HeaderObjectData, 0, 16);
        $thisfile_asf_headerobject['objectid_guid'] = $this->BytestringToGUID($thisfile_asf_headerobject['objectid']);
        if ($thisfile_asf_headerobject['objectid'] != GETID3_ASF_Header_Object) {
            unset($info['fileformat']$info['asf']);
            return $this->error('ASF header GUID {'.$this->BytestringToGUID($thisfile_asf_headerobject['objectid']).'} does not match expected "GETID3_ASF_Header_Object" GUID {'.$this->BytestringToGUID(GETID3_ASF_Header_Object).'}');
        }
        $thisfile_asf_headerobject['objectsize']    = getid3_lib::LittleEndian2Int(substr($HeaderObjectData, 16, 8));
        $thisfile_asf_headerobject['headerobjects'] = getid3_lib::LittleEndian2Int(substr($HeaderObjectData, 24, 4));
        $thisfile_asf_headerobject['reserved1']     = getid3_lib::LittleEndian2Int(substr($HeaderObjectData, 28, 1));
        $thisfile_asf_headerobject['reserved2']     = getid3_lib::LittleEndian2Int(substr($HeaderObjectData, 29, 1));

        $NextObjectOffset = $this->ftell();
        $ASFHeaderData = $this->fread($thisfile_asf_headerobject['objectsize'] - 30);
        
Home | Imprint | This part of the site doesn't use cookies.