<?
function searchKor($str){
$ga = base64_decode('6rCA');
$hinh = base64_decode('7Z6j');
$str = iconv('cp949','utf-8',$str);
$r = preg_match("/[{$ga}-{$hinh}]/m",$str);
return $r;
}
function recursive_dir($dir){
if (is_dir($dir)) {
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false) {
if($file=='.' || $file=='..'){
continue;
}
$dir_f = $dir .'/'. $file;
if(is_dir($dir_f)){
if(searchKor($dir_f)){
echo 'rm -rf "',$dir_f,'"'."\n";
break;
}
recursive_dir($dir_f);
}else{
if(searchKor($dir_f)){
echo 'rm -rf "',$dir_f,'"'."\n";
}
}
}
closedir($dh);
}
}
}
if(isset($argv[1])){
recursive_dir($argv[1]);
}
?>