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

7z: skip unsupported headers #2086

Closed

Conversation

mehrabiworkmail
Copy link

@mehrabiworkmail mehrabiworkmail commented Mar 8, 2024

7z doesn't support kAdditionalStreamInfo which causes it to not extract anything from files that contain this header. This patch enables libarchive to skip unsupported headers and still extract data.

Fixes #2076

@mehrabiworkmail mehrabiworkmail changed the title 7z: Improved sfx extraction 7z: Improved sfx header search Mar 8, 2024
@mehrabiworkmail
Copy link
Author

mehrabiworkmail commented Mar 8, 2024

Without applying the fix, libarchive fails 2 of the 3 new test cases (the vanilla 7z SFX ELF and the modified 7z SFX PE).

{
const void *h;
const char *p, *q;
size_t skip, offset;
ssize_t bytes, window;

/*
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This had to be modified because find_pe_overlay and find_elf_data_sec may read or seek the archive, hence bytes_avail is no longer reliable.

@mehrabiworkmail mehrabiworkmail changed the title 7z: Improved sfx header search 7z: Improved sfx header search, also skip unsupported headers Mar 8, 2024
@mehrabiworkmail
Copy link
Author

Appologies for creating duplicate pull requests. This one had my fixes both for issues #2075 and #2076. I have closed it for now and created a separate one for #2075. Will re-open this if/when we reach consencus on the solution for #2076

@mehrabiworkmail mehrabiworkmail changed the title 7z: Improved sfx header search, also skip unsupported headers 7z: skip unsupported headers Mar 8, 2024
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

Successfully merging this pull request may close these issues.

7z: failed extraction due to unsupported header/data type
1 participant