Am 23.02.2011 09:45, schrieb Bao, Zheng:
The code between 465 and 467 is confusing. Why doesn't it align to alignment? What if we delete these 3 lines?
The kind of alignment that cbfstool seeks is, for alignment "ALIGN", look for an address so that the file data is inside a block sized ALIGN, aligned to ALIGN granularity, with enough space before it so that the header fits.
So if you look for a suitable location for a file of 99192 bytes, that has to be inside a 0x80000 block, aligned to 0x80000, 0xf380 is okay:
The block in question starts at 0x0 and ends at 0x7ffff. The file starts at 0xf380, and ends at 0x276f8.
Where am I wrong in the whole analysis?
We have a less strict requirement than the one you assumed (that the file must start at the beginning of such a block)
Regards, Patrick