- Registriert
- Feb. 2005
- Beiträge
- 310
Backup der Bilder gibt es leider nicht. Also ist dann wohl leider alles hinüber oder?
Folge dem Video um zu sehen, wie unsere Website als Web-App auf dem Startbildschirm installiert werden kann.
Anmerkung: Diese Funktion ist in einigen Browsern möglicherweise nicht verfügbar.
Comparing files locked-DSCI1890.JPG.eunp and LOCKED-DSCI1891.JPG.VBVG
00000004: 96 9B
00000005: C2 E6
0000010C: 3B 3D
0000010D: BC BE
000001AA: 50 46
000002BE: 9C 9A
000002BF: B7 B5
000002D2: 7B 7D
000002D3: 12 10
FF D8 FF E0
00 10 4A 46
49 46 00 01
01 01 01 2C
01 2C 00 00
<?
if(!function_exists('hex2bin')){
function hex2bin($data){
$bin = "";
$i = 0;
do{
$bin .= chr(hexdec($data{$i}.$data{($i + 1)}));
$i += 2;
} while ($i < strlen($data));
return $bin;
}
}
$filename = 'locked-DSCI1890.JPG.eunp';
$realfilename = substr($filename, 7, -5);
$file = file_get_contents($filename);
$posfound = null;
$len = strlen($file);
for($i=0; $i<$len; $i++){
$hex = bin2hex(substr($file,$i,2));
if($hex == 'ffdb'){
$posfound = $i;
echo 'Hex "'.$hex.'" fount at '.$i."<br/>";
break;
}
}
$replace = hex2bin('FFD8FFE000104A46494600010101012C012C0000');
if($posfound === null) die('Hex not found... :(');
echo file_put_contents($realfilename, $replace.substr($file, $posfound)) ? 'File rewritten' : 'File rewrite failed';
?>
<?
if(!function_exists('hex2bin')){
function hex2bin($data){
$bin = "";
$i = 0;
do{
$bin .= chr(hexdec($data{$i}.$data{($i + 1)}));
$i += 2;
} while ($i < strlen($data));
return $bin;
}
}
function repair($path, $filename){
$realfilename = substr($filename, 7, -5);
$file = file_get_contents('defekt'.$path.'/'.$filename);
$posfound = null;
$replace = '';
$len = strlen($file);
for($i=0; $i<$len; $i++){
$hex = bin2hex(substr($file,$i,4));
if($hex == 'ffd8ffe0'){
$posfound = $i;
break;
}
elseif(substr($hex,0,-2) == 'ffe10b'){
$replace = hex2bin('ffd8ffe000104a46494600010101000000000000');
$posfound = $i;
break;
}
}
if($posfound === null) return false;
else{
return file_put_contents('repaired'.$path.'/'.$realfilename, $replace.substr($file, $posfound));
}
}
function recursiveSearch($path){
if(!is_dir('repaired'.$path)) mkdir('repaired'.$path);
foreach(scandir('defekt'.$path) as $f) if($f !== '.' and $f !== '..'){
if(is_dir('defekt'.$path.'/'.$f)) recursiveSearch($path.'/'.$f);
elseif(substr($f, 0, 7) == 'locked-'){
echo '<tr><td>'.$path.'/'.$f.'</td><td> <b>'.(repair($path, $f) ? 'ok' : '').'</b></td></tr>';
}
}
}
echo '<table>';
recursiveSearch('');
echo '</table>';
?>