| 389 | |
| 390 | @exceptions_handler(Exception) |
| 391 | def 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) |