hi all , may i have an question ! .
I use Winhex to analyze Logic Disk C (FAT32 - 8 sectors/cluster , sector size = 512 bytes).
First go to Root Directory Template and get an entry , for example i get a file name abc.txt (size=1000 bytes , 32 bit clusters# = 393248 , so i think this file will start at sector : = 393248*8 = 3145984 . but use "go to sector" of Winhex i get the result = 3155520 . why they are different ?

Posted on 2006-09-08 11:41:45 by secmask
Hi! you may!  :)

Clusters start from after the File Allocation Tables, which start a certain number of sectors from the beginning of the partition (well, a number of sectors that is specified in the partition's boot sector data).  It looks like there must be 3155520-3145984 = 9536 sectors on the partition (possibly including the few sectors before the partition) before the clusters start on the partition.  From that, I can estimate that your partition is roughly 4.6GB (calculated from the number of FAT entries that you could fit into a bit less than 9536 sectors and the 4KB/cluster you indicated with 8 sectors/cluster).  Actually, it could be 2.3GB, 'cause I seem to recall that there are usually 2 FATs in case of emergency.  Just a little fun with numbers  ;)  Anyway, you should be able to find out where the start of the clusters are by looking at the partition boot sector (sector 0 of the partition):

First Sector of clusters = ReservedSectors + NumberOfFATs*SectorsPerFAT

ReservedSectors is a word at offset 0Eh, NumberOfFATs is a byte at offset 10h, and SectorsPerFAT is a word at offset 16h, all in the partition boot sector.

Good luck!
Posted on 2006-09-09 00:07:38 by hackulous
thank for your help, hackulous . It's ok now !
Posted on 2006-09-09 03:51:54 by secmask