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

Decoding of DOS Attributes in External Attributes is wrong & incomplete #18

Closed
pmqs opened this issue Apr 16, 2024 · 0 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@pmqs
Copy link
Owner

pmqs commented Apr 16, 2024

First 16 bits of the decoded External Attributes in Central header should map to DOS attributes. Decoding of this field uses an incorrect and incomplete bitmask

Code uses 0x0100 for Offline, 0x200 for Not Indexed & and 0x400 for Encrypted. Values should be 0x1000, 0x2000 and 0x4000 respectively.

The field names for the 0x0100, 0x0200, 0x0400 and 0x0800 value should be Temporary, Sparse, Reparse Point and Compressed.

In practice the 0x4000 and 0x8000 bits are used for a different purpose.

7z/p7zip uses the 0x8000 bit to signal that the high 16-bits are Unix attributes.

Mac/iOS uses 0x4000 bit for some unknown purpose.

References

@pmqs pmqs added the bug Something isn't working label Apr 16, 2024
@pmqs pmqs self-assigned this Apr 16, 2024
pmqs added a commit that referenced this issue Apr 16, 2024
Fitst 16 bits of the decoded External Attributes in Central header should map to  DOS attributes.

Code for decoding this has a few wrong (Offline, Not tIndexed & Encrypted ) plus some were missing

Also, added the 7z/p7zip flag (for 0x8000) and the mysterious bit  ( 0x4000) bit set by Mac zip files.
@pmqs pmqs closed this as completed Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant