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

ftguess: add strict/safe mode to match extension to file formats #848

Open
decalage2 opened this issue Mar 21, 2024 · 0 comments
Open

ftguess: add strict/safe mode to match extension to file formats #848

decalage2 opened this issue Mar 21, 2024 · 0 comments

Comments

@decalage2
Copy link
Owner

add an exefilter-like mode, to recognize file types in a stricter/safer way by matching file extension and content, and avoid issue with polyglots:

  1. if the filename has an extension, find all the formats matching that extension
  2. then check each of those formats, if they recognise the file content with a proper structure
  3. if none of the formats matches the file extension, issue a warning that the format is incorrect or not supported, or the file extension is incorrect
  4. otherwise if the filename has no extension, or a generic extension like ".bin" or an extension not known by ftguess, guess the file type with the usual ftguess algorithm (and display a warning)

With this mode, ftguess will enforce that a file has a proper extension matching its content.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant