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

When using file signature to ID file types, ran into a collision which mis-identified a file type. #18

Open
Quade3699 opened this issue Apr 4, 2023 · 0 comments

Comments

@Quade3699
Copy link

I had a multifile RAR set that refused to decode. It failed while opening the first archive. I troubleshot it down to where it picked which codec to use. It found a "BD" in the data for a two character signature and then picked the wrong codec which failed to open the archive.

I changed the code to require that both the signature and extension match. It works but it defeats the purpose of using signature only. My suggestion is sort the signatures in "length of signature" order so the long signatures get checked before the short signatures. Every byte of additional signature that matches increases the confidence in the signature match.

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

1 participant