Source for file oleread.inc
Documentation is available at oleread.inc
define('NUM_BIG_BLOCK_DEPOT_BLOCKS_POS', 0x2c);
define('SMALL_BLOCK_DEPOT_BLOCK_POS', 0x3c);
define('ROOT_START_BLOCK_POS', 0x30);
define('BIG_BLOCK_SIZE', 0x200);
define('SMALL_BLOCK_SIZE', 0x40);
define('EXTENSION_BLOCK_POS', 0x44);
define('NUM_EXTENSION_BLOCK_POS', 0x48);
define('PROPERTY_STORAGE_BLOCK_SIZE', 0x80);
define('BIG_BLOCK_DEPOT_BLOCKS_POS', 0x4c);
define('SMALL_BLOCK_THRESHOLD', 0x1000);
// property storage offsets
define('SIZE_OF_NAME_POS', 0x40);
define('START_BLOCK_POS', 0x74);
//echo 'ROOT_START_BLOCK_POS = '.ROOT_START_BLOCK_POS."\n";
//echo bin2hex($data[ROOT_START_BLOCK_POS])."\n";
//echo $data[ROOT_START_BLOCK_POS];
return ord($data[$pos]) |
(ord($data[$pos+
1]) <<
8) |
(ord($data[$pos+
2]) <<
16) |
(ord($data[$pos+
3]) <<
24);
function read($sFileName){
// check if file exist and is readable (Darko Miljanovic)
echo $this->numBigBlockDepotBlocks." ";
echo $this->sbdStartBlock." ";
echo $this->rootStartBlock." ";
echo $this->extensionBlock." ";
echo $this->numExtensionBlocks." ";
//echo "sbdStartBlock = $this->sbdStartBlock\n";
$bigBlockDepotBlocks =
array();
$bbdBlocks =
$this->numBigBlockDepotBlocks;
if ($this->numExtensionBlocks !=
0) {
for ($i =
0; $i <
$bbdBlocks; $i++
) {
for ($j =
0; $j <
$this->numExtensionBlocks; $j++
) {
$blocksToRead =
min($this->numBigBlockDepotBlocks -
$bbdBlocks, BIG_BLOCK_SIZE /
4 -
1);
for ($i =
$bbdBlocks; $i <
$bbdBlocks +
$blocksToRead; $i++
) {
$bbdBlocks +=
$blocksToRead;
if ($bbdBlocks <
$this->numBigBlockDepotBlocks) {
// var_dump($bigBlockDepotBlocks);
$this->bigBlockChain =
array();
for ($i =
0; $i <
$this->numBigBlockDepotBlocks; $i++
) {
//var_dump($this->bigBlockChain);
// readSmallBlockDepot();
$sbdBlock =
$this->sbdStartBlock;
$this->smallBlockChain =
array();
while ($sbdBlock != -
2) {
$this->smallBlockChain[$index] =
GetInt4d($this->data, $pos);
$sbdBlock =
$this->bigBlockChain[$sbdBlock];
// readData(rootStartBlock)
$block =
$this->rootStartBlock;
$pos = ($block + 1) * BIG_BLOCK_SIZE;
$this->entry = $this->entry.substr($this->data, $pos, BIG_BLOCK_SIZE);
$block = $this->bigBlockChain[$block];
//echo '==='.$this->entry."===";
//echo "pos = $pos data=$data\n";
$block =
$this->bigBlockChain[$block];
//var_dump($this->entry);
while ($offset <
strlen($this->entry)) {
//$maxBlock = strlen($d) / BIG_BLOCK_SIZE - 1;
for ($i =
0; $i <
$nameSize ; $i++
) {
'startBlock' =>
$startBlock,
if (($name ==
"Workbook") ||
($name ==
"Book")) {
$this->wrkbook =
count($this->props) -
1;
if ($name ==
"Root Entry") {
$this->rootentry =
count($this->props) -
1;
//echo "name ==$name=\n";
// getSmallBlockStream(PropertyStorage ps)
$rootdata =
$this->__readData($this->props[$this->rootentry]['startBlock']);
$block =
$this->props[$this->wrkbook]['startBlock'];
$block =
$this->smallBlockChain[$block];
if ($numBlocks ==
0) return '';
//echo "numBlocks = $numBlocks\n";
//byte[] streamData = new byte[numBlocks * BIG_BLOCK_SIZE];
//print_r($this->wrkbook);
$block =
$this->props[$this->wrkbook]['startBlock'];
$block =
$this->bigBlockChain[$block];
//echo 'stream'.$streamData;
Documentation generated on Thu, 08 Jan 2009 17:47:35 +0100 by phpDocumentor 1.4.0a2