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

Function print_gnu_hash

api/python/examples/elf_reader.py:340–357  ·  view source on GitHub ↗
(binary)

Source from the content-addressed store, hash-verified

338
339@exceptions_handler(Exception)
340def 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)

Callers 1

mainFunction · 0.85

Calls 2

printFunction · 0.50
formatMethod · 0.45

Tested by

no test coverage detected