#!/usr/bin/php -q php readfat.php {path to image} [output file] * * @author Bernd Holzmueller * @license http://creativecommons.org/licenses/by-sa/3.0/de/ Creative Commons Attribution-Share Alike 3.0 Germany * @copyright Copyright © 2010 tiggersWelt.net **/ require ('loadfat.php'); if (!is_object ($Image)) die ('Something went wrong...' . "\n"); // Load the FAT from the image $FAT = $Image->getRawFAT ($fatIndex); if ($FAT === false) die ('Could not load FAT' . "\n"); // Do the output if (isset ($argv [1])) { if (!is_resource ($o = fopen ($argv [1], 'wb'))) die ('Could not open output-file' . "\n"); fwrite ($o, $FAT); fclose ($o); } else echo $FAT; ?>