Skip to content
This repository was archived by the owner on Feb 22, 2024. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 16 additions & 14 deletions mastiff/plugins/analysis/EXE/EXE-peinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,20 +125,22 @@ def output_file_quick(self, outdir, pe):
# http://blog.dkbza.org/2007/02/pefile-parsing-version-information-from.html
outfile.write('\nFile Information:\n')
if hasattr(pe, "FileInfo"):
for fileinfo in pe.FileInfo:
if fileinfo.Key == 'StringFileInfo':
for string_entry in fileinfo.StringTable:
for entry in string_entry.entries.items():
outfile.write("{0:20}:\t{1:40}\n".format(printable_str(entry[0]), \
printable_str(entry[1])))
if fileinfo.Key == 'VarFileInfo':
try:
for var in fileinfo.Var:
outfile.write("{0:20}:\t{1:40}\n".format(printable_str(var.entry.items()[0][0]),
printable_str(var.entry.items()[0][1])))
except:
# there are times when a VarFileInfo structure may be present, but empty
pass
for fileinfos in pe.FileInfo:
#Modified code
for fileinfo in fileinfos:
if fileinfo.Key == 'StringFileInfo':
for string_entry in fileinfo.StringTable:
for entry in string_entry.entries.items():
outfile.write("{0:20}:\t{1:40}\n".format(printable_str(entry[0]), \
printable_str(entry[1])))
if fileinfo.Key == 'VarFileInfo':
try:
for var in fileinfo.Var:
outfile.write("{0:20}:\t{1:40}\n".format(printable_str(var.entry.items()[0][0]),
printable_str(var.entry.items()[0][1])))
except:
# there are times when a VarFileInfo structure may be present, but empty
pass
else:
outfile.write('No file information present.\n')

Expand Down