x3frepair

Download:

<?php
/*
	Note: This only work on x3f files which got deleted and restored from a
	flash drive (e.g. with testdisk).

	x3frepair v0.1.0
	Usage: php x3frepair /path/to/broken/files/ /path/to/store/repaired/files/
*/
echo "\r\n";
$x = 0;
$dir = $argv[1];
$odir = $argv[2];
if (is_dir($dir)) {
	if ($dh = opendir($dir)) {
		while (($file = readdir($dh)) !== false) {
			if ($file != "." && $file != ".." && substr($file, -4) == ".x3f"){
				$files[$x++] = $file;
				}
			}
		closedir($dh);
		}
	}
$w = count($files);
for ($y = 0; $y < $w; $y++){
	$tmp00 = file_get_contents($dir.$files[$y]);
	$tmp01 = explode("SECd", $tmp00);
	$tmp02 = substr($tmp01[1], 0, 72);
	$tmp03 = $tmp01[0]."SECd".$tmp02;
	file_put_contents($odir.$files[$y], $tmp03);
	echo "processing: ".($y+1)."/".$w."\r\n";
	}
?>

documentation.txt -> unavailable, yet. Please be patient.
license.txt

This product includes/requires PHP software, freely available from
http://www.php.net/software/

<<< back