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

Function print_data_in_code

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

Source from the content-addressed store, hash-verified

389
390@exceptions_handler(Exception)
391def print_data_in_code(binary):
392 format_str = "{:<13} {:<30}"
393 format_hex = "{:<13} 0x{:<28x}"
394 format_dec = "{:<13} {:<30d}"
395
396 print("== Data In Code ==")
397
398 datacode = binary.data_in_code
399
400 print(format_hex.format("Offset:", datacode.data_offset))
401 print(format_hex.format("Size:", datacode.data_size))
402 print("")
403 for entry in datacode.entries:
404 type_str = str(entry.type).split(".")[-1]
405 print("- {:<14}: 0x{:x} ({:d} bytes)".format(type_str, entry.offset, entry.length))
406 print("")
407
408
409@exceptions_handler(Exception)

Callers 1

mainFunction · 0.85

Calls 2

printFunction · 0.50
formatMethod · 0.45

Tested by

no test coverage detected