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

zip pattern: Improved fallback method for finding eocd #177

Merged
merged 1 commit into from
Oct 24, 2023

Conversation

flawwan
Copy link
Contributor

@flawwan flawwan commented Oct 21, 2023

Hi :)

I found a bug when I ran the zip pattern on some random zip file I had. In this case it was the zip of the Binwalk 2.3.4 source code. You can verify by download it from github (releases and then download (Source code(zip)). Open with imHex and select zip pattern. It will fail. I created my own zip test data to cover this bug.

The bug is when multiple signatures for the eocd are located in the last 64kb. The fallback will pick the first one, which does not always work when there might be multiple potential eocd signatures within that range.

This pull request fixes that bug and should make the fallback method more reliable. This is done by looping through all eocd signatures within the last 64kb. Invalid "eocd" signatures will be discarded and the correct eocd will be returned.

@WerWolv WerWolv merged commit a992d1b into WerWolv:master Oct 24, 2023
2 checks passed
@WerWolv
Copy link
Owner

WerWolv commented Oct 24, 2023

Thank you!

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.

2 participants