Skip to content

Commit f55366e

Browse files
committed
Bug fix from review comments
Signed-off-by: Prabhu Subramanian <[email protected]>
1 parent 804143b commit f55366e

File tree

2 files changed

+21
-13
lines changed

2 files changed

+21
-13
lines changed

blint/binary.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,15 @@ def parse_strings(parsed_obj):
218218

219219

220220
def ignorable_symbol(symbol_name: str | None) -> bool:
221+
"""
222+
Determines if a symbol is ignorable.
223+
224+
Args:
225+
symbol_name (str): The name of the symbol to check.
226+
227+
Returns:
228+
bool: True if the symbol is ignorable, False otherwise.
229+
"""
221230
if not symbol_name:
222231
return True
223232
for pref in ("$f64.", "__"):
@@ -901,7 +910,6 @@ def parse_overlay(parsed_obj: lief.Binary) -> dict[str, dict]:
901910
.replace("\0", "")
902911
.replace("\n", "")
903912
.replace(" ", ""))
904-
print (overlay_str)
905913
if overlay_str.find('{"runtimeTarget') > -1:
906914
start_index = overlay_str.find('{"runtimeTarget')
907915
end_index = overlay_str.rfind('}}}')
@@ -911,7 +919,7 @@ def parse_overlay(parsed_obj: lief.Binary) -> dict[str, dict]:
911919
# If all is good, deps should have runtimeTarget, compilationOptions, targets, and libraries
912920
# Use libraries to construct BOM components and targets for the dependency tree
913921
deps = json.loads(overlay_str)
914-
except json.DecodeError:
922+
except json.JSONDecodeError:
915923
pass
916924
return deps
917925

@@ -964,7 +972,7 @@ def add_pe_metadata(exe_file, metadata, parsed_obj):
964972
metadata["exception_functions"] = parse_functions(parsed_obj.exception_functions)
965973
# Detect if this PE might be dotnet
966974
for i, dd in enumerate(parsed_obj.data_directories):
967-
if i == 14 and isinstance(dd, lief.PE.DataDirectory.TYPES.CLR_RUNTIME_HEADER):
975+
if i == 14 and type(dd) == "CLR_RUNTIME_HEADER":
968976
metadata["is_dotnet"] = True
969977
metadata["dotnet_dependencies"] = parse_overlay(parsed_obj)
970978
tls = parsed_obj.tls

poetry.lock

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)