Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- >>> import binaryninja
- >>> bv = binaryninja.BinaryViewType["Mach-O"].open("/bin/ls")
- >>> bv.update_analysis_and_wait()
- >>> t = bv.parse_type_string("int (*lol)(int one, void* two, size_t three)")
- >>> t
- (<type: int32_t (*)(int32_t one, void* two, uint64_t three)>, 'lol')
- >>> ti = t[0]
- >>> dir(ti)
- ['__class__', '__del__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattribute__', '__hash__', '__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', 'alignment', 'array', 'bool', 'calling_convention', 'can_return', 'const', 'count', 'element_type', 'enumeration', 'enumeration_type', 'float', 'function', 'get_string_after_name', 'get_string_before_name', 'handle', 'has_variable_arguments', 'int', 'modified', 'parameters', 'pointer', 'return_value', 'signed', 'structure', 'structure_type', 'target', 'type_class', 'unknown_type', 'void', 'width']
- >>> ti.return_value
- <type: int32_t ( )(int32_t one, void* two, uint64_t three)>
- >>> ti.element_type
- <type: int32_t ( )(int32_t one, void* two, uint64_t three)>
- >>> ti.type_class
- 'PointerTypeClass'
- >>> ti.return_value
- <type: int32_t ( )(int32_t one, void* two, uint64_t three)>
- >>> tip = ti.return_value
- >>> tip.type_class
- 'FunctionTypeClass'
- >>> tip.parameters
- [(<type: int32_t>, 'one'), (<type: void*>, 'two'), (<type: uint64_t>, 'three')]
- >>>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement