Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with miniFAT sectors when numMiniFatSectors > 1 #9

Open
adepasquale opened this issue Jun 19, 2018 · 5 comments
Open

Problem with miniFAT sectors when numMiniFatSectors > 1 #9

adepasquale opened this issue Jun 19, 2018 · 5 comments

Comments

@adepasquale
Copy link
Contributor

Hello,
I noticed an issue when parsing documents with more then one MiniFAT sectors.

version : major = 3, minor = 0x003e
sectorShift = 9
numDirectorySectors = 0
numFatSectors = 1
firstDirectorySectorLocation = 52
transactionSignatureNumber = 0
firstMiniFatSectorLocation = 55
numMiniFatSectors = 2
firstDifatSectorLocation = END
numDifatSectors = 0
difat size=1
 51
dataSize=45056(0xb000)
sectorSize=512
# of mini fat sectors = 2
exception:ms:cfb:FatSectors:bad idx:128
00000000: d0cf 11e0 a1b1 1ae1 0000 0000 0000 0000  ................
00000010: 0000 0000 0000 0000 3e00 0300 feff 0900  ........>.......
00000020: 0600 0000 0000 0000 0000 0000 0100 0000  ................
00000030: 3400 0000 0000 0000 0010 0000 3700 0000  4...........7...
00000040: 0200 0000 feff ffff 0000 0000 3300 0000  ............3...
00000050: ffff ffff ffff ffff ffff ffff ffff ffff  ................
...
000001f0: ffff ffff ffff ffff ffff ffff ffff ffff  ................

I have added a check to avoid this exception but it doesn't seem to be enough, probably because the additional MiniFAT sectors are not consecutive? I can share the sample document via email if it helps.

adepasquale@7f5c00e

I haven't been able to find documentation about the location of additional MiniFAT sectors in case there's more than one (for this sample there are two). Anyway I have identified the locations below:

  • 0x00007000 from the 0x00000037 in the header;
  • 0x00009400 by manually analysing the rest of the file.
00007000: 0100 0000 0200 0000 0300 0000 0400 0000  ................
00007010: feff ffff 0600 0000 0700 0000 0800 0000  ................
00007020: 0900 0000 0a00 0000 feff ffff 0c00 0000  ................
00007030: 0d00 0000 0e00 0000 0f00 0000 1000 0000  ................
00007040: 1100 0000 1200 0000 1300 0000 1400 0000  ................
00007050: 1500 0000 1600 0000 1700 0000 1800 0000  ................
00007060: feff ffff 1a00 0000 1b00 0000 1c00 0000  ................
00007070: 1d00 0000 1e00 0000 1f00 0000 2000 0000  ............ ...
00007080: 2100 0000 2200 0000 2300 0000 2400 0000  !..."...#...$...
00007090: 2500 0000 2600 0000 2700 0000 2800 0000  %...&...'...(...
000070a0: 2900 0000 2a00 0000 2b00 0000 2c00 0000  )...*...+...,...
000070b0: 2d00 0000 2e00 0000 2f00 0000 3000 0000  -......./...0...
000070c0: 3100 0000 3200 0000 3300 0000 3400 0000  1...2...3...4...
000070d0: 3500 0000 3600 0000 3700 0000 3800 0000  5...6...7...8...
000070e0: 3900 0000 3a00 0000 3b00 0000 3c00 0000  9...:...;...<...
000070f0: 3d00 0000 3e00 0000 3f00 0000 4000 0000  =...>...?...@...
00007100: 4100 0000 4200 0000 4300 0000 4400 0000  A...B...C...D...
00007110: feff ffff 4600 0000 4700 0000 4800 0000  ....F...G...H...
00007120: 4900 0000 4a00 0000 4b00 0000 4c00 0000  I...J...K...L...
00007130: 4d00 0000 4e00 0000 4f00 0000 5000 0000  M...N...O...P...
00007140: 5100 0000 5200 0000 5300 0000 5400 0000  Q...R...S...T...
00007150: 5500 0000 5600 0000 5700 0000 5800 0000  U...V...W...X...
00007160: 5900 0000 5a00 0000 5b00 0000 5c00 0000  Y...Z...[...\...
00007170: 5d00 0000 5e00 0000 5f00 0000 6000 0000  ]...^..._...`...
00007180: feff ffff 6200 0000 6300 0000 6400 0000  ....b...c...d...
00007190: 6500 0000 6600 0000 6700 0000 6800 0000  e...f...g...h...
000071a0: 6900 0000 6a00 0000 6b00 0000 6c00 0000  i...j...k...l...
000071b0: 6d00 0000 6e00 0000 6f00 0000 7000 0000  m...n...o...p...
000071c0: 7100 0000 feff ffff 7300 0000 7400 0000  q.......s...t...
000071d0: 7500 0000 7600 0000 7700 0000 7800 0000  u...v...w...x...
000071e0: 7900 0000 7a00 0000 7b00 0000 7c00 0000  y...z...{...|...
000071f0: 7d00 0000 7e00 0000 7f00 0000 8000 0000  }...~...........
00009400: 8100 0000 8200 0000 8300 0000 8400 0000  ................
00009410: 8500 0000 8600 0000 8700 0000 8800 0000  ................
00009420: 8900 0000 8a00 0000 8b00 0000 8c00 0000  ................
00009430: 8d00 0000 8e00 0000 8f00 0000 9000 0000  ................
00009440: 9100 0000 9200 0000 9300 0000 9400 0000  ................
00009450: 9500 0000 9600 0000 9700 0000 9800 0000  ................
00009460: 9900 0000 9a00 0000 9b00 0000 9c00 0000  ................
00009470: 9d00 0000 9e00 0000 9f00 0000 a000 0000  ................
00009480: a100 0000 a200 0000 a300 0000 a400 0000  ................
00009490: a500 0000 a600 0000 a700 0000 a800 0000  ................
000094a0: feff ffff aa00 0000 ab00 0000 ac00 0000  ................
000094b0: ad00 0000 ae00 0000 af00 0000 b000 0000  ................
000094c0: b100 0000 b200 0000 feff ffff b400 0000  ................
000094d0: feff ffff b600 0000 b700 0000 b800 0000  ................
000094e0: b900 0000 feff ffff bb00 0000 bc00 0000  ................
000094f0: bd00 0000 be00 0000 bf00 0000 c000 0000  ................
00009500: c100 0000 c200 0000 feff ffff c400 0000  ................
00009510: feff ffff c600 0000 c700 0000 c800 0000  ................
00009520: c900 0000 feff ffff cb00 0000 feff ffff  ................
00009530: ffff ffff ffff ffff ffff ffff ffff ffff  ................
...
000095f0: ffff ffff ffff ffff ffff ffff ffff ffff  ................
@herumi
Copy link
Owner

herumi commented Jun 21, 2018

Thank you for your detailed explanation and pull req.
I want to check it by the files which caused this problem if possible.
Could you mind giving me the file?

@adepasquale
Copy link
Contributor Author

adepasquale commented Jun 22, 2018

File sent to your N I F T Y dot C O M email

@herumi
Copy link
Owner

herumi commented Jun 22, 2018

Thank you. I got it and will see it.

@adepasquale
Copy link
Contributor Author

Hello, did you find some time to investigate the issue?

@herumi
Copy link
Owner

herumi commented Jul 27, 2018

I'm sorry to wait for long time. I'm now busy so can not take time to remember the specification of the file format and improve it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants