Skip to content

Commit 8b38d0f

Browse files
authored
Added a check to the process_pe_resources function
Issue existed with how the process_pe_resources function handles lief.lief_errors when processing version information, which could lead to an AttributeErrors. Fixed it by adding a check to ensure version_info is not a lief.lief_errors object before trying to access its attributes. Signed-off-by: Tune <67398331+to-curiosity@users.noreply.github.com>
1 parent c750590 commit 8b38d0f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

blint/lib/binary.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,8 @@ def process_pe_resources(parsed_obj):
396396
version_metadata = {}
397397
version_info = rm.version if rm.has_version else None
398398
if isinstance(version_info, list) and len(version_info):
399-
version_info = version_info[0]
399+
if not isinstance(version_info[0], lief.lief_errors):
400+
version_info = version_info[0]
400401
if version_info and hasattr(version_info, "string_file_info"):
401402
string_file_info: lief.PE.ResourceStringFileInfo = version_info.string_file_info
402403
for lc_item in string_file_info.children:

0 commit comments

Comments
 (0)