pymhf.core.calling module#

pymhf.core.calling.call_exported(name: str, func_def: FUNCDEF, *args)#

Call a function exported by the main binary.

Parameters:
  • name – The name of the exported function. This will generally be the mangled name of the function as provided by IDA/ghidra.

  • func_def – The restype and argtypes of the function being called.

  • args – The arguments to be passed to the function being called.

pymhf.core.calling.call_function(name: str, *args, overload: str | None = None, pattern: str | None = None, func_def: FUNCDEF | None = None, offset: int | None = None, binary: str | None = None) Any#

Call a named function.

Parameters:
  • name – The name of the function to be called. For now the function signature will be looked up from the known signatures by name.

  • args – The args to pass to the function call.

  • overload – The overload name to be called if required.

  • pattern – The pattern which can be used to find where the function is. If provided this will be used instead of the offset as determined by the name.

  • offset – The offset relative to the binary. If provided it will take precedence over the pattern argument.

  • binary – The name of the binary to search for the pattern within, or to find the offset relative to. If not provided, will fallback to the name of the binary as provided by the exe config value.