Skip to content
Merged
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
12 changes: 12 additions & 0 deletions blint/lib/binary.py
Original file line number Diff line number Diff line change
Expand Up @@ -1648,6 +1648,18 @@ def add_mach0_functions(metadata, parsed_obj):
metadata["ctor_functions"] = parse_functions(parsed_obj.ctor_functions)
metadata["unwind_functions"] = parse_functions(parsed_obj.unwind_functions)
metadata["symtab_symbols"], exe_type = parse_macho_symbols(parsed_obj.symbols)

# Populate function info based on local symbols for .o files or others where parsed_obj.functions is empty.
if not metadata["functions"]:
metadata["functions"] = [
{
"idx": idx,
"name": symbol["name"],
"address": symbol["address"]
}
for idx, symbol in enumerate(s for s in metadata["symtab_symbols"] if s["category"] == lief.MachO.Symbol.CATEGORY.LOCAL)
]

if exe_type:
metadata["exe_type"] = exe_type
if parsed_obj.dylinker:
Expand Down
Loading