Code Sample |
block.c //Just after the #includes: FILE* AccessLog; //In raw_open: int64_t size; char logfile[1024]; sprintf(&logfile[0],"%s.log",filename); AccessLog=fopen(&logfile[0],"wb"); fd = open(filename, O_RDWR | O_BINARY | O_LARGEFILE); // raw_read: int ret; fprintf(AccessLog,"Disk read at sector %x\n", sector_num/4); lseek(s->fd, sector_num * 512, SEEK_SET); //finally, last line of raw_close: fclose(AccessLog); |
Code Sample |
<?php function isogettoc($isofile) { $tocdata=file($isofile); echo sizeof($tocdata)." entries found..."; $listmat="/Directory listing of ([^\s]*)/i"; $cwd="/"; $ret=Array(); for ($i=0; $i<sizeof($tocdata); $i++) { $line=$tocdata[$i]; if (strtolower(substr($line,0,9))=="directory") { $cwd=trim(substr($line,21)); continue; } if (strlen($line)>10) { $size=trim(substr($line,25,15)); $loc=trim(substr($line,54,7)); $name=trim(substr($line,67,12)); if (($name!=".")&&($name!="..")) $ret[$loc]=$cwd."$name"; } } echo "\n"; $ret[0]="!preboot"; return $ret; } function getOrder($access, $iso) { $accessdata=file("access.log"); $id=isogettoc($iso); $ct=0; for ($i=0; $i<sizeof($accessdata); $i++) { $a=$accessdata[$i]; if (strtolower(substr($a,5,4))=="read") { $sector=hexdec(trim(substr($a,20)))*1; $fd=""; $s=$sector; while ($fd=="") { if (!empty($id[$s])) $fd=$id[$s]; else $s--; } if ($fd!="") { if ($fd=="!preboot") continue; if (empty($GotitArray[$fd])) { $GotitArray[$fd]=1; echo str_replace("/", "\\", $fd." ".(9999-$ct)."\n"); $ct++; } } } } } $ret=getOrder("access.log", "isodata.txt"); ?> |
Code Sample |
\BOOT\ISOLINUX\BOOT.CAT 9998 \BOOT\ISOLINUX\ISOLINUX.BIN 9997 \BOOT 9996 \BOOT\ISOLINUX 9995 \BOOT\ISOLINUX\ISOLINUX.CFG 9994 \BOOT\ISOLINUX\BOOT.MSG 9993 \BOOT\ISOLINUX\LOGO.16 9992 \BOOT\ISOLINUX\LINUX24 9991 \BOOT\ISOLINUX\MINIRT24.GZ 9990 \KNOPPIX 9989 \KNOPPIX\KNOPPIX 9988 |