ebourg commented on PR #182:
URL: https://github.com/apache/poi/pull/182#issuecomment-2490698050

   I created a test file with 8 mini FAT sectors:
   * Sector 1 is unallocated
   * Sector 2 has 8 unallocated mini sectors at the beginning
   * Sector 3 has 4 unallocated mini sectors in the middle
   * Sector 4 is unallocated
   * Sector 5 has 32 unallocated mini sectors at the end
   * Sector 6 has 64 unallocated sectors at the beginning and 16 unallocated 
mini sectors at the end
   * Sector 7 is unallocated
   * Sector 8 is unallocated
   
   With this layout POI 5.3 computes a root size of 29696 bytes, that is (0 + 
128 + 128 + 0 + (128-32) + (128-16) + 0 + 0) x 64.
   
   After signing the file with signtool:
   * The first 2 mini sectors of the first mini FAT sector have been allocated 
(for the MsiDigitalSignatureEx entry)
   * The empty mini FAT sectors 4, 7 and 8 were not removed
   * The size field of the root entry is 48128 bytes, that's (5 x 128 + (128 - 
16)) x 64
   
   So the right method to compute the size is to find the absolute index of the 
last allocated mini sector, add one and multiply by 64.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org

Reply via email to