-
-
Save hartwork/1160bd55544670e39eae7915f5bbf6d7 to your computer and use it in GitHub Desktop.
Using the python pefile lib to extract version information from an exe file
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
'''Licensed under the MIT License :)''' | |
import pefile | |
import pprint | |
pe = pefile.PE('example.exe') | |
string_version_info = {} | |
for fileinfo in pe.FileInfo[0]: | |
if fileinfo.Key.decode() == 'StringFileInfo': | |
for st in fileinfo.StringTable: | |
for entry in st.entries.items(): | |
string_version_info[entry[0].decode()] = entry[1].decode() | |
pprint.pprint(string_version_info) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment