| 66 | |
| 67 | @exceptions_handler(Exception) |
| 68 | def print_sections(binary): |
| 69 | print("== Sections ==") |
| 70 | f_title = "|{:<30} | {:<18}| {:<18}| {:<18}| {:<9}|" |
| 71 | f_value = "|{:<30} | 0x{:<16x}| 0x{:<16x}| 0x{:<16x}| {:<9.2f}|" |
| 72 | print(f_title.format("Name", "File offset", "Size", "Virtual Address", "Entropy")) |
| 73 | for section in binary.sections: |
| 74 | print(f_value.format(\ |
| 75 | section.name,\ |
| 76 | section.offset,\ |
| 77 | section.size,\ |
| 78 | section.virtual_address,\ |
| 79 | section.entropy)) |
| 80 | print("") |
| 81 | |
| 82 | |
| 83 | @exceptions_handler(Exception) |