I want to calculate the offset of the end of the parent locator in VHD. Here is part of the VHD header:
Cookie: cxsparse
Data offset: 0xffffffffffffffff
Table offset: 0x2000
Header version: 0x00010000
Max table entries: 10240
Block size: 0x200000
Checksum: 4294956454
Parent Unique Id: 0x9678bf077e719640b55e40826ce5d178
Parent time stamp: 525527478
Reserved: 0
Parent Unicode name:
Parent locator 1:
- platform code: 0x57326b75
- platform_data_space: 4096
- platform_data_length: 86
- reserved: 0
- platform_data_offset: 0x1000
Parent locator 2:
- platform code: 0x57327275
- platform_data_space: 65536
- platform_data_length: 34
- reserved: 0
- platform_data_offset: 0xc000
Some definitions from the specification of the format of the virtual hard disk :
"Table offset: this field stores the absolute byte offset of the block allocation table (BAT) in the file. Platform data space: this field stores the number of 512-byte sectors needed to store the parent hard drive locator. Platform data offset: this field is stored absolute file offset in bytes where the file locator data of a particular platform is stored. Platform data length. This field stores the actual length of the parent hard disk locator in bytes. "
, :
+ 512 * :
0x1000 + 512 * 4096 = 0x201000
0xc000 + 512 * 65536 = 0x200c000
+ :
0x1000 + 4096 = 0x2000 //end of parent locator 1, begin of BAT
0xc000 + 65536 = 0x1c000
: BAT (. ); BAT 0xe7 ( ), 0x1ce00 ( * 512), , 0x1c000.
+ 512 *, , , . ( , )
, ,
" : 512- , .
" : , ."?