On Friday 24 August 2018 08:51:33 Phillip Susi wrote: > On 8/24/2018 3:29 AM, Pali Rohár wrote: > > No, offset where VRS starts is fixed to 32kB, independently of block > > size. > > I thought it was 32kb + x * block size, where x is 0..63? > > > For UDF block size 512 - 2048, size of VSD blocks in VRS is always 2048. > > Size, yes. I'm talking about the location. It can be in blocks 0..63, > so it's exact offset depends on the block size does it not? Except of > course for block zero since zero * any block size is still zero.
VRS starts always at location 32kB. VRS contains sequence of VSDs and every VSD has size min(2048, block size). It has same format as ISO9660 file system. There may be some BEA, TEA, NSR (and other descriptors). VRS by definition is terminated by unrecorded block (which has no meaning for HDD or SSD) or unknown data. There is no limit how long VRS can be, but I added limit to 64 VSD to prevent scanning whole disk. So VRS needs to be scanned, VSD by VSD. Once we found unknown data stop scanning -- it is not UDF. And once we found NSR, it is marker that there is UDF file system (ISO 13346). But there may be also ISO 9660 file system present when there is CD001. Which means that only existence of NSR on 0..63 is not enough. All VSDs before NSR must be known/valid too. > > Yes, probe for VSD with 2048 VSD length, and check for AVDP with UDF > > block size 512, 1024 and 2048. > > Again, there is a difference between the length of the VRS itself, and > where it is located. For a block size of 512, the VRS could be located > in block 5, which would put it between bytes 2560 and 2560+2048-1. > > >> So you are trying to check only the most common anchor position first > >> for each detected block size so that if one or two vrs checks were false > >> positives, you don't waste as much time checking the other 3 anchor > >> locations? > > > > No, I'm checking for all possible location. But for "most common" > > location (AVDP at 256) is checked as the first. Later (in the last > > loop) are checked other AVDP locations. > > Yes, that's what I said. > > > Why not? For valid UDF filesystem we finish detection as early as > > possible. > > Because 99% of the time you won't be looking at a valid UDF filesystem > so 99% of the time, this optimization isn't helping. So what you suggest? For block sizes < 2048 there is need for special handling... -- Pali Rohár [email protected]
