| 338 | |
| 339 | @exceptions_handler(Exception) |
| 340 | def print_gnu_hash(binary): |
| 341 | print("== GNU Hash ==\n") |
| 342 | |
| 343 | if not binary.use_gnu_hash: |
| 344 | return |
| 345 | |
| 346 | gnu_hash = binary.gnu_hash |
| 347 | |
| 348 | format_str = "{:<30} {}" |
| 349 | format_hex = "{:<30} 0x{:<28x}" |
| 350 | format_dec = "{:<30} {:<30d}" |
| 351 | |
| 352 | print(format_dec.format("Number of buckets:", gnu_hash.nb_buckets)) |
| 353 | print(format_dec.format("First symbol index:", gnu_hash.symbol_index)) |
| 354 | print(format_hex.format("Shift Count:", gnu_hash.shift2)) |
| 355 | print(format_str.format("Bloom filters:", gnu_hash.bloom_filters)) |
| 356 | print(format_str.format("Buckets:", gnu_hash.buckets)) |
| 357 | print(format_str.format("Hash values:", gnu_hash.hash_values)) |
| 358 | |
| 359 | |
| 360 | @exceptions_handler(Exception) |