MCPcopy Create free account
hub / github.com/lief-project/LIEF / print_function_starts

Function print_function_starts

api/python/examples/macho_reader.py:373–388  ·  view source on GitHub ↗
(binary)

Source from the content-addressed store, hash-verified

371
372@exceptions_handler(Exception)
373def print_function_starts(binary):
374 format_str = "{:<13} {:<30}"
375 format_hex = "{:<13} 0x{:<28x}"
376 format_dec = "{:<13} {:<30d}"
377
378 print("== Function Starts ==")
379
380 fstarts = binary.function_starts
381
382 print(format_hex.format("Offset:", fstarts.data_offset))
383 print(format_hex.format("Size:", fstarts.data_size))
384 print("Functions: ({:d})".format(len(fstarts.functions)))
385 for idx, address in enumerate(fstarts.functions):
386 print(" [{:d}] __TEXT + 0x{:x}".format(idx, address))
387
388 print("")
389
390@exceptions_handler(Exception)
391def print_data_in_code(binary):

Callers 1

mainFunction · 0.85

Calls 2

printFunction · 0.50
formatMethod · 0.45

Tested by

no test coverage detected