!C99Shell v. 1.0 pre-release build #13!

Software: Apache. PHP/5.5.15 

uname -a: Windows NT SVR-DMZ 6.1 build 7600 (Windows Server 2008 R2 Enterprise Edition) i586 

SYSTEM 

Safe-mode: OFF (not secure)

C:\dmz\php\pear\phing\system\io\   drwxrwxrwx
Free 4.11 GB of 39.52 GB (10.4%)
Detected drives: [ a ] [ c ] [ d ] [ e ] [ f ]
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     BufferedReader.php (5.34 KB)      -rw-rw-rw-
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
/*
 *  $Id: BufferedReader.php 557 2009-08-29 13:54:38Z mrook $
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 * This software consists of voluntary contributions made by many individuals
 * and is licensed under the LGPL. For more information please see
 * <http://phing.info>.
*/

include_once 'phing/system/io/Reader.php';

/**
 * Convenience class for reading files.
 *
 * @author    <a href="mailto:yl@seasonfive.com">Yannick Lecaillez</a>
 * @version   $Revision: 557 $ $Date: 2009-08-29 15:54:38 +0200 (Sat, 29 Aug 2009) $
 * @access    public
 * @see       FilterReader
 * @package   phing.system.io
 */
class BufferedReader extends Reader {

    private 
$bufferSize 0;
    private 
$buffer     null;
    private 
$bufferPos  0;
    
    
/**
     * The Reader we are buffering for.
     */
    
private $in;
    
    
/**
     * 
     * @param object $reader The reader (e.g. FileReader).
     * @param integer $buffsize The size of the buffer we should use for reading files.
     *                             A large buffer ensures that most files (all scripts?) are parsed in 1 buffer.
     */     
    
function __construct(Reader $reader$buffsize 65536) {
        
$this->in $reader;
        
$this->bufferSize $buffsize;
    }

    
/**
     * Reads and returns a chunk of data.
     * @param int $len Number of bytes to read.  Default is to read configured buffer size number of bytes.
     * @return mixed buffer or -1 if EOF.
     */
    
function read($len null) {
        
        
// if $len is specified, we'll use that; otherwise, use the configured buffer size.
        
if ($len === null$len $this->bufferSize
        
        if ( (
$data $this->in->read($len)) !== -) {
        
            
// not all files end with a newline character, so we also need to check EOF
            
if (!$this->in->eof()) {
            
                
$notValidPart strrchr($data"\n");
                
$notValidPartSize strlen($notValidPart);
            
                if ( 
$notValidPartSize ) {
                    
// Block doesn't finish on a EOL
                    // Find the last EOL and forget all following stuff
                    
$dataSize strlen($data);
                    
$validSize $dataSize $notValidPartSize 1;
                
                    
$data substr($data0$validSize);
    
                    
// Rewind to the begining of the forgotten stuff.
                    
$this->in->skip(-$notValidPartSize+1);
                }
                
            } 
// if !EOF
        
}
        return 
$data;
    }
    
    function 
skip($n) {
        return 
$this->in->skip($n);
    }
    
    function 
reset() {
        return 
$this->in->reset();
    }
    
    function 
close() {
        return 
$this->in->close();
    }
    
    function 
open() {
        return 
$this->in->open();
    }
    
    
/**
     * Read a line from input stream.
     */
    
function readLine() {
        
$line null;
        while ( (
$ch $this->readChar()) !== -) {
            if ( 
$ch === "\n" ) {
                break;
            }
            
$line .= $ch;
        }

        
// Warning : Not considering an empty line as an EOF
        
if ( $line === null && $ch !== -)
            return 
"";

        return 
$line;
    }
    
    
/**
     * Reads a single char from the reader.
     * @return string single char or -1 if EOF.
     */
    
function readChar() {        

        if ( 
$this->buffer === null ) {
            
// Buffer is empty, fill it ...
            
$read $this->in->read($this->bufferSize);
            if (
$read === -1) {
                
$ch = -1;
            } else {
                
$this->buffer $read;
                return 
$this->readChar(); // recurse
            
}
        } else {            
            
// Get next buffered char ...
            // handle case where buffer is read-in, but is empty.  The next readChar() will return -1 EOF,
            // so we just return empty string (char) at this point.  (Probably could also return -1 ...?)
            
$ch = ($this->buffer !== "") ? $this->buffer{$this->bufferPos} : '';
            
$this->bufferPos++;
            if ( 
$this->bufferPos >= strlen($this->buffer) ) {
                
$this->buffer null;
                
$this->bufferPos 0;
            }
        }

        return 
$ch;
    }
    
    
/**
     * Returns whether eof has been reached in stream.
     * This is important, because filters may want to know if the end of the file (and not just buffer)
     * has been reached.
     * @return boolean
     */ 
    
function eof() {
        return 
$this->in->eof();
    }

    function 
getResource() {
        return 
$this->in->getResource();
    }    
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 1.0 pre-release build #13 powered by Captain Crunch Security Team | http://ccteam.ru | Generation time: 0.0312 ]--