helperFunctions.hash module

helperFunctions.hash.get_hash(hash_function, binary)

Hashes binary with hash_function.

Parameters:
  • hash_function – The hash function to use. See hashlib for more

  • binary – The data to hash, either as string or array of Integers

Returns:

The hash as hexstring

helperFunctions.hash.get_imphash(file_object)

Generates and returns the md5 hash of the (sorted) imported functions of an ELF file represented by file_object. Returns None if there are no imports or if an exception occurs.

Parameters:

file_object (FileObject) – The FileObject of which the imphash shall be computed

Return type:

str | None

helperFunctions.hash.get_md5(code)
helperFunctions.hash.get_sha256(code)
helperFunctions.hash.get_ssdeep(code)
helperFunctions.hash.get_tlsh(code)
helperFunctions.hash.get_tlsh_comparison(first, second)
helperFunctions.hash.normalize_lief_items(functions)

Shorthand to convert a list of objects to a list of strings