Пример #1
0
 /**
  * @abstract returns a FileReader-Object of the uncompressed FileReader-Data-Object  
  * @return clFileReader object Instanz of class clFileReader
  */
 private function BlockUncompress($data, $info_blockID = '')
 {
     $data->setOffset(0);
     $size = $data->len() - 4;
     $file = new clFile();
     if ($size < 2) {
         $this->m_error->addError('unable to decompress section [#' . $info_blockID . ']: block-size-error - size: ' . $size);
         return $file->getFileReader();
         //- empty File
     }
     $usize = $data->readInt(4);
     if ($usize + 30 < $size || $usize > $size * 10) {
         $this->m_error->addError('unable to decompress section [#' . $info_blockID . ']: uncompress-size-error - size: ' . $size . ' - uncompress-size:' . $usize);
         return $file->getFileReader();
         //- empty File
     }
     $ucdata = @gzuncompress($data->readStr($size));
     if (strlen($ucdata) < 1) {
         $this->m_error->addError('unable to decompress section [#' . $info_blockID . ']: gzuncompress-error');
         return $file->getFileReader();
         //- empty File
     }
     $file->readFromString($ucdata);
     return $file->getFileReader();
 }
Пример #2
0
<?php

function getgetVar($varname, $default = '')
{
    if (isset($_GET[$varname])) {
        return $_GET[$varname];
    }
    return $default;
}
//------------------------------------//
include_once 'clFile.php';
include_once 'cllabview.php';
$filename_in = 'myFile.vi';
$filename_out = 'out.vi';
$newPassword = '******';
$file = new clFile();
$file->readFromFile($filename_in);
//- open File
$FReader = $file->getFileReader();
//- create a Labview class to controle the process
$LV = new clLabView($FReader);
//- read .VI File
if ($LV->readVI()) {
    //- Password
    $BDPW = $LV->getBDPW();
    $BDPW->setPassword($newPassword);
    //- set the new password
    //- Version + Library Password
    $LVSR = $LV->getLVSR();
    $LVSR->setLibraryPassword($newPassword);
    //- set the new Library Password