in order to scan the complete C drive i wrote a code it is scanning almost all the folders completely however it is leaving out some which can be easily (seperately) opened and sacnned using the same code........... ............... ...........
the code used is pasted below, please suggest me how to rectify my code to solve the problem and go through all the folders not some!
the code used is pasted below, please suggest me how to rectify my code to solve the problem and go through all the folders not some!
Code:
<?php function DirDisply($p) { $TrackDir=opendir($p); while ($file = readdir($TrackDir)) { if ($file == "." || $file == "..") { } else { //print "<table><tr><td>$file</td>"; //print "<td> ".filetype($file)."</td></tr></table>"; $n=$p."\\".$file; //echo"<br>$n<br>"; if( opendir($n) ) {@ DirDisply($n);} else { if(is_executable($file) ) { $handle=fopen($file, "rb"); echo("$file"); $convert=bin2hex( fread( $handle, filesize($file) ) ); $pattern="/a900003000000040/"; if(preg_match($pattern, $convert)) { echo"<b><i>VIRUS DETECTED<br></b></i>"; } else echo"YOUR COMPUTER IS RUNNING FREE OF VIRUSES"; pack( "H*", $convert ); fclose($handle); } } } } closedir($TrackDir); return; } ?> <b><font face="Verdana, Arial, Helvetica, sans-serif">Current Directory Contain Following files and Sub Directories...</font></b> <p> <?php $p="C:"; @ DirDisply($p); ?>
Comment