summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/binaryview.py41
-rw-r--r--python/lineardisassembly.py2
-rw-r--r--python/typelibrary.py36
3 files changed, 45 insertions, 34 deletions
diff --git a/python/binaryview.py b/python/binaryview.py
index d9d8f0b8..7e7e323b 100644
--- a/python/binaryview.py
+++ b/python/binaryview.py
@@ -3430,7 +3430,7 @@ class BinaryView(object):
:Example:
>>> tt = bv.create_tag_type("Crabby Functions", "🦀")
- >>> current_function.create_user_address_tag(here, tt, "Get Crabbed")
+ >>> bv.create_user_data_tag(here, tt, "Get Crabbed")
>>>
"""
tag_type = TagType(core.BNCreateTagType(self.handle, name, icon))
@@ -3476,7 +3476,8 @@ class BinaryView(object):
def create_tag(self, type, data, user=True):
"""
- ``create_tag`` creates a new Tag object but does not add it anywhere
+ ``create_tag`` creates a new Tag object but does not add it anywhere.
+ Use :py:meth:`create_user_data_tag` to create and add in one step.
:param TagType type: The Tag Type for this Tag
:param str data: Additional data for the Tag
@@ -3556,8 +3557,13 @@ class BinaryView(object):
def create_user_data_tag(self, addr, type, data, unique=False):
"""
- ``create_user_data_tag`` creates and adds a Tag object at a data address.
- Since this adds a user tag, it will be added to the current undo buffer.
+ ``create_user_data_tag`` creates and adds a Tag object at a data
+ address. Since this adds a user tag, it will be added to the current
+ undo buffer.
+
+ This API is appropriate for generic data tags, for functions,
+ consider using :meth:`create_user_function_tag <binaryninja.function.Function.create_user_function_tag>` or for
+ specific addresses inside of functions: :meth:`create_user_address_tag <binaryninja.function.Function.create_user_address_tag>`.
:param int addr: Address at which to add the tag
:param TagType type: Tag Type for the Tag that is created
@@ -3565,6 +3571,11 @@ class BinaryView(object):
:param bool unique: If a tag already exists at this location with this data, don't add another
:return: The created Tag
:rtype: Tag
+ :Example:
+
+ >>> tt = bv.tag_types["Crashes"]
+ >>> bv.create_user_data_tag(here, tt, "String data to associate with this tag")
+ >>>
"""
if unique:
tags = self.get_data_tags_at(addr)
@@ -4254,7 +4265,7 @@ class BinaryView(object):
def get_linear_disassembly_position_at(self, addr, settings):
"""
- ``get_linear_disassembly_position_at`` instantiates a :py:class:`LinearDisassemblyPosition` object for use in
+ ``get_linear_disassembly_position_at`` instantiates a :py:class:`LinearDisassemblyPosition <binaryninja.lineardisassembly.LinearDisassemblyPosition>` object for use in
:py:meth:`get_previous_linear_disassembly_lines` or :py:meth:`get_next_linear_disassembly_lines`.
:param int addr: virtual address of linear disassembly position
@@ -4690,8 +4701,8 @@ class BinaryView(object):
the event of a name conflict. To aid in this, the :py:Class:`Type` object returned is a `NamedTypeReference` to
the deconflicted name used.
- :param QualifiedName name
- :param TypeLibrary lib
+ :param QualifiedName name:
+ :param TypeLibrary lib:
:return: a `NamedTypeReference` to the type, taking into account any renaming performed
:rtype: Type
"""
@@ -4711,8 +4722,8 @@ class BinaryView(object):
This may have the impact of loading other type libraries as dependencies on other type libraries are lazily resolved
when references to types provided by them are first encountered.
- :param QualifiedName name
- :param TypeLibrary lib
+ :param QualifiedName name:
+ :param TypeLibrary lib:
:return: the object type, with any interior `NamedTypeReferences` renamed as necessary to be appropriate for the current view
:rtype: Type
"""
@@ -4730,9 +4741,9 @@ class BinaryView(object):
As other referenced types are encountered, they are either copied into the destination type library or
else the type library that provided the referenced type is added as a dependency for the destination library.
- :param TypeLibrary lib
- :param QualifiedName name
- :param Type type_obj
+ :param TypeLibrary lib:
+ :param QualifiedName name:
+ :param Type type_obj:
:rtype: None
"""
if not isinstance(name, types.QualifiedName):
@@ -4750,9 +4761,9 @@ class BinaryView(object):
As other referenced types are encountered, they are either copied into the destination type library or
else the type library that provided the referenced type is added as a dependency for the destination library.
- :param TypeLibrary lib
- :param QualifiedName name
- :param Type type_obj
+ :param TypeLibrary lib:
+ :param QualifiedName name:
+ :param Type type_obj:
:rtype: None
"""
if not isinstance(name, types.QualifiedName):
diff --git a/python/lineardisassembly.py b/python/lineardisassembly.py
index a48ce81b..87dd656e 100644
--- a/python/lineardisassembly.py
+++ b/python/lineardisassembly.py
@@ -24,7 +24,7 @@ class LinearDisassemblyPosition(object):
``class LinearDisassemblyPosition`` is a helper object containing the position of the current Linear Disassembly
.. note:: This object should not be instantiated directly. Rather call \
- :py:meth:`get_linear_disassembly_position_at` which instantiates this object.
+ :py:meth:`get_linear_disassembly_position_at <binaryninja.binaryview.BinaryView.get_linear_disassembly_position_at>` which instantiates this object.
"""
def __init__(self, func, block, addr):
self._function = func
diff --git a/python/typelibrary.py b/python/typelibrary.py
index d4e5b0a2..6463590e 100644
--- a/python/typelibrary.py
+++ b/python/typelibrary.py
@@ -53,8 +53,8 @@ class TypeLibrary(object):
Creates an empty type library object with a random GUID and
the provided name.
- :param Architecture arch
- :param str name
+ :param Architecture arch:
+ :param str name:
:rtype: TypeLibrary
"""
handle = core.BNNewTypeLibrary(arch.handle, name)
@@ -65,7 +65,7 @@ class TypeLibrary(object):
"""
Loads a finalized type library instance from file
- :param str path
+ :param str path:
:rtype: TypeLibrary
"""
handle = core.BNLoadTypeLibraryFromFile(path)
@@ -77,7 +77,7 @@ class TypeLibrary(object):
"""
Saves a finalized type library instance to file
- :param str path
+ :param str path:
:rtype: None
"""
core.BNWriteTypeLibraryToFile(self.handle, path)
@@ -88,8 +88,8 @@ class TypeLibrary(object):
`from_name` looks up the first type library found with a matching name. Keep
in mind that names are not necessarily unique.
- :param Architecture arch
- :param str name
+ :param Architecture arch:
+ :param str name:
:rtype: TypeLibrary
"""
handle = core.BNLookupTypeLibraryByName(arch.handle, name)
@@ -103,8 +103,8 @@ class TypeLibrary(object):
`from_guid` attempts to grab a type library associated with the provided
Architecture and GUID pair
- :param Architecture arch
- :param str guid
+ :param Architecture arch:
+ :param str guid:
:rtype: TypeLibrary
"""
handle = core.BNLookupTypeLibraryByGuid(arch.handle, guid)
@@ -276,11 +276,11 @@ class TypeLibrary(object):
through NamedTypeReferences are already appropriately prepared.
To add types and objects from an existing BinaryView, it is recommended to use
- :py:meth:`BinaryView.export_object_to_library`, which will automatically pull in
+ :py:meth:`export_object_to_library <binaryninja.binaryview.BinaryView.export_object_to_library>`, which will automatically pull in
all referenced types and record additional dependencies as needed.
- :param QualifiedName name
- :param Type t
+ :param QualifiedName name:
+ :param Type t:
:rtype: None
"""
if not isinstance(name, types.QualifiedName):
@@ -296,11 +296,11 @@ class TypeLibrary(object):
through NamedTypeReferences are already appropriately prepared.
To add types and objects from an existing BinaryView, it is recommended to use
- :py:meth:`BinaryView.export_type_to_library`, which will automatically pull in
+ :py:meth:`export_type_to_library <binaryninja.binaryview.BinaryView.export_type_to_library>`, which will automatically pull in
all referenced types and record additional dependencies as needed.
- :param QualifiedName name
- :param Type t
+ :param QualifiedName name:
+ :param Type t:
:rtype: None
"""
if not isinstance(name, types.QualifiedName):
@@ -313,9 +313,9 @@ class TypeLibrary(object):
"""
`get_named_object` direct extracts a reference to a contained object -- when
attempting to extract types from a library into a BinaryView, consider using
- :py:meth:`BinaryView.import_library_object` instead.
+ :py:meth:`import_library_object <binaryninja.binaryview.BinaryView.import_library_object>` instead.
- :param QualifiedName name
+ :param QualifiedName name:
:rtype: Type
"""
if not isinstance(name, types.QualifiedName):
@@ -329,9 +329,9 @@ class TypeLibrary(object):
"""
`get_named_type` direct extracts a reference to a contained type -- when
attempting to extract types from a library into a BinaryView, consider using
- :py:meth:`BinaryView.import_library_type` instead.
+ :py:meth:`import_library_type <binaryninja.binaryview.BinaryView.import_library_type>` instead.
- :param QualifiedName name
+ :param QualifiedName name:
:rtype: Type
"""
if not isinstance(name, types.QualifiedName):