コード例 #1
0
 function ReadFunction()
 {
     global $handle;
     $buffer = ord(fread($handle, 1));
     $buffer += ord(fread($handle, 1)) << 8;
     $strlenght = $buffer;
     if ($strlenght > 0) {
         for ($i = 0; $i < $strlenght; $i++) {
             $final_str[] = ord(fread($handle, 1));
         }
         $final_text = fdetokenize($final_str);
     } else {
         $final_text = "";
     }
     return $final_text;
 }
コード例 #2
0
ファイル: 82y-txt-converter.php プロジェクト: ZeWaren/TI_PHP
                    }
                }
            }
        }
    }
    fseek($handle, 69);
    $contents = fread($handle, 1);
    fseek($handle, 68);
    $buffer = ord(fread($handle, 1));
    $buffer += ord(fread($handle, 1)) << 8;
    $strlenght = $buffer;
    fseek($handle, 72);
    for ($i = 0; $i < $strlenght - 2; $i++) {
        $final_str[] = ord(fread($handle, 1));
    }
    $final_text = fdetokenize($final_str);
}
$text = $final_text;
$_SESSION["text"] = $text;
$_SESSION["name"] = $TIName;
$_SESSION["comment"] = $TIComment;
$_SESSION["storetype"] = isset($TIStoreType) ? $TIStoreType : 'RAM';
echo '<a href="index.php">Back to main menu</a>';
echo '<h2>Open a file</h2>';
echo '<form enctype="multipart/form-data" action="82y-txt-converter.php" method="post">';
echo '<input type="hidden" name="MAX_FILE_SIZE" value="5000000" />';
echo 'Open a TI Equation File (82y): <input name="userfile" type="file" /> <input type="submit" value="Open">';
echo '</form>';
echo '<h2>File Information</h2>';
echo '<h3>On Computer:</h3><ul>';
echo '<li>FileName: <font color="DimGray">"' . $_FILES['userfile']['name'] . '"</font></li>';
コード例 #3
0
ファイル: 83p--txt-converter.php プロジェクト: ZeWaren/TI_PHP
$contents = fread($handle, 40);
$TIComment = VireZeroTerminaux($contents);
fseek($handle, 60);
$contents = fread($handle, 8);
$TIName = VireZeroTerminaux($contents);
fseek($handle, 69);
$contents = fread($handle, 1);
$TIStoreType = ord($contents) == 128 ? "Archive" : "RAM";
$i = 0;
fseek($handle, 74);
while (!feof($handle)) {
    $Bytes[$i] = ord(fread($handle, 1));
    //      echo $Bytes[$i];
    $i++;
}
$text = fdetokenize($Bytes);
$_SESSION["text"] = $text;
$_SESSION["name"] = $TIName;
$_SESSION["comment"] = $TIComment;
$_SESSION["storetype"] = $TIStoreType;
echo '<a href="index.php">Back to main menu</a>';
echo '<h2>Open a file</h2>';
echo '<form enctype="multipart/form-data" action="83p--txt-converter.php" method="post">';
echo '<input type="hidden" name="MAX_FILE_SIZE" value="5000000" />';
echo 'Open a TI Program File (83p): <input name="userfile" type="file" /> <input type="submit" value="Open">';
echo '</form>';
echo '<h2>File Information</h2>';
echo '<h3>On Computer:</h3><ul>';
echo '<li>FileName: <font color="DimGray">"' . $_FILES['userfile']['name'] . '"</font></li>';
echo '<li>File Size: <font color="DimGray">' . FormatFileSize(filesize($uploadDir . $ffilename)) . '</font></li>';
echo '</ul>';