These pages are written by only Japanese.
|
Namazu for hns による簡易全文検索です。 詳細は 詳細指定/ヘルプをご参照下さい。 |
||||||||||||||||||||||||||||||||||||||||||||||
php swfed\swfdump.php swfed\colorformat.swf
php swfed\swfconvertbitmapdatatojpegtag.php swfed\colorformat.swf > t.swf
<?php $size_limit = 0x200; if (($argc != 2) || (is_readable($argv[1]) === false)) { echo 'Usage: php exec_file.php <target file>'.PHP_EOL; exit (1); // failure } $data = file_get_contents($argv[1]); $len = min($size_limit, strlen($data) - 1); // 1 = very short file (no magic) for ($i = 0; $i < $len; $i++) { $ret = exec_file_command(substr($data, $i)); if ($ret === false) { echo 'failed to execute file command'.PHP_EOL; break; } if ($ret !== 'data') { printf('0x%04x: %s'.PHP_EOL, $i, $ret); } } exit (0); // success function exec_file_command($data) { $descspec = array(array('pipe', 'r'), array('pipe', 'w')); $process = proc_open('file -b -', $descspec, $pipes); if (is_resource($process) === false) { return false; // NG } fwrite($pipes[0], $data); fclose($pipes[0]); $ret = stream_get_contents($pipes[1]); fclose($pipes[1]); return trim($ret); }結構、便利。