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

Use pecoff4j to read dll/exe version information metadata on windows #2446

Closed
wants to merge 2 commits into from

Conversation

pscamodio
Copy link
Contributor

@pscamodio pscamodio commented Jan 24, 2020

Fixes Issue

Dll and exe on windows that are not .NET assembly are only analyzed by the filename.
This is often not good enough because the filename can contain other numbers (x86, x64, ...) other than the version.

Description of Change

To improve the situation I've reduced the confidence of the filename parsed version and created a new analyzer
The FileVersionAnalyzer use the pecoff4j library to extract, if possible, the version from the file metadata

Have test cases been added to cover the new functionality?

no

Dll and exe on windows that are not .NET assembly are only analyzed by the filename.
This is often not good enough because the filename can contain other numbers (x86, x64, ...) other than the version.
To improve the situation I've reduced the confidence of the filename parsed version and created a new analyzer
The FileVersionAnalyzer use the pecoff4j library to extract, if possible, the version from the file metadata
@boring-cyborg boring-cyborg bot added core changes to core utils changes to utils labels Jan 24, 2020
@pscamodio
Copy link
Contributor Author

About the testing, it would require to add a .dll or .exe file with some metadata to the repo. I could reuse a publicy available dll or forge a minimal one, Do you want me to add this to have this merged?

jeremylong added a commit that referenced this pull request Jan 25, 2020
…ieving more than just the version number from the PE Headers
@jeremylong jeremylong mentioned this pull request Jan 25, 2020
@jeremylong
Copy link
Owner

@pscamodio thank you for this PR! As you can see I've expanded on it with PR #2448. For the test case I just used one of the existing DLLs that is used in testing of the AssemblyAnalyzer. Let's move the conversation and any additional updates to the new PR.

@jeremylong jeremylong closed this Jan 25, 2020
jeremylong added a commit that referenced this pull request Feb 1, 2020
* Use pecoff4j to read dll/exe version information metadata on windows

Dll and exe on windows that are not .NET assembly are only analyzed by the filename.
This is often not good enough because the filename can contain other numbers (x86, x64, ...) other than the version.
To improve the situation I've reduced the confidence of the filename parsed version and created a new analyzer
The FileVersionAnalyzer use the pecoff4j library to extract, if possible, the version from the file metadata

* updated PR #2446 to move this to a more full fledged PE Analyzer retrieving more than just the version number from the PE Headers

Co-authored-by: Amodio <pscamodio@gmail.com>
@lock lock bot locked and limited conversation to collaborators Apr 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
core changes to core utils changes to utils
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants