-
Notifications
You must be signed in to change notification settings - Fork 562
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: more types and tests #716
Merged
decalage2
merged 15 commits into
decalage2:master
from
christian-intra2net:ftguess-more-types-and-tests
Nov 2, 2021
Merged
Ftguess: more types and tests #716
decalage2
merged 15 commits into
decalage2:master
from
christian-intra2net:ftguess-more-types-and-tests
Nov 2, 2021
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Makes people think that we detected encryption, not that function "is_encrypted" was started
File was created by myself, free to use
File type classes are all named FType_... but a few exceptions had an upper-case Y: FTYpe_Excel . Makes no sense, I guess that was a simple typo. Also, some comments in classes were only marked with a single "'", PEP requests three "'''"
Did this analogous to Word 2007+ template types, added a "content_type" field with output from "file -i". Is there a rule on how to select "name" and "long_name"? "file" does not give the same results as those in the code
Forgot to mention: this should solve issue #711 . I concur with jcmbs on to how to fix this |
Return False if OpenXML type has no known main relationship part. Otherwise recognize() will raise an error a few lines later at splitext(). This should solve issue decalage2#711 (author had suggested exactly this)
This was a TODO which kept FileTypeGuesser.is_word from working properly.
With the creation of ftguess oleid has been changed a lot, the output of its .check() method is very different. Instead of just adapting the existing unittests, I re-created the complete test, trying to make it easier to change/extend in the future.
christian-intra2net
force-pushed
the
ftguess-more-types-and-tests
branch
from
October 6, 2021 07:18
ed871d6
to
cf1532f
Compare
Fixed typo in a commit message ("pointpoint" --> "PowerPoint") |
Merged
decalage2
approved these changes
Nov 2, 2021
Thanks |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Created unittests for the latest module oletools.ftguess.
Doing that I realized that lots of types were missing from ftguess that we contain in our set of unittest samples. Extend ftguess to include at least those, so ftguess works correctly on all test samples. Also added a new test sample of type xps ("fixed page format") and fixed that one TODO about is_word()
Reallized as well that oleid was changed quite a lot when ftguess was created, so its unittests needed major changes. I re-created them from scratch to make them more easily extensible when oleid change again.
unittests work again now. In my opinion they should not ever fail on master to ensure that people relying on oletools are not unpleasantly suprised