-
Notifications
You must be signed in to change notification settings - Fork 20
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
Malformed FAT entries mismatch #41
Comments
@tgross35 hello! Could you send a file? |
Er... Unfortunately not this specific one since it's a work thing, but I'm trying to get a minimal reproduction that I will send. The file is pretty large (>10MB) and is produced by Altium (not that that helps on its own). |
Hey @ikrivosheev I never got a minified file but here are two header & footer dumps: File 1, 9539584 bytes (9.1M), produces `io error: Malformed FAT (FAT has 30208 entries, but file has only 18631 sectors).` :
File 2, 1387520 bytes (1.4M), produces `io error: Malformed FAT (FAT has 30208 entries, but file has only 14524 sectors).` :
Is this enough to go off of? I need to try to get a minified file that I can share still, but it only happens with fairly large files so it's not easy to make a sample. |
@tgross35 I reproduced your problem and found a sample. But it's malware file... Well, I will try to fix it. |
Well, now I understand what happens with python implementation. It skips continue parsing: https://github.com/decalage2/olefile/blob/master/olefile/olefile.py#L903C1-L903C92 @mdsteele what can we do with this problem? Maybe on |
I think I'm encountering the same issue with Altium as @tgross35, PR #58 should fix that. For an example file in the wild see the 19.7 MB MB-Q-RK3588-V10_Library.SchLib. Other than the zero padding in the DIFAT sector, the only strict violation in these files is a non-zero storage start sector, so I don't think fixing this specific issue will require allowing file truncation as in #44. As I noted in the PR, a simpler fix would be to just truncate the DIFAT to |
Thanks very much for the quick turnaround! @tgross35, I wanted to check with you: You mentioned there was a 1.4M "File 2" with the issue, I wouldn't expect it then unless the FAT was excessively padded (as I did for the unit test). The error gives a sector count that indicates a file around 7M, and the header dump describes 0 DIFAT sectors so I wouldn't expect it to have this issue. My guess is that the dump, size, and error were from different files. But I could be mistaken; have you ever seen this error on a < 7M file? |
Is it possible that #1 regressed at some point? I am getting:
I intend to try this with a few different versions but have not yet had the opportunity
The text was updated successfully, but these errors were encountered: