diff options
| author | Xusheng <xusheng@vector35.com> | 2020-09-18 18:35:27 +0800 |
|---|---|---|
| committer | Xusheng <xusheng@vector35.com> | 2020-10-15 12:50:02 +0800 |
| commit | cbe3ded641a0ce4b50ae447a4426b71f3e0f0119 (patch) | |
| tree | 339cff6f061f89a49a78f82626dd5601c448bf05 /python | |
| parent | d77c63efc16070868bf6eb87d274bf846f4440f7 (diff) | |
edit current line in linear view
add CanAssemble() to architectures
Diffstat (limited to 'python')
| -rw-r--r-- | python/architecture.py | 5 | ||||
| -rw-r--r-- | python/binaryview.py | 16 |
2 files changed, 21 insertions, 0 deletions
diff --git a/python/architecture.py b/python/architecture.py index bb1f17db..0c5f816d 100644 --- a/python/architecture.py +++ b/python/architecture.py @@ -453,6 +453,11 @@ class Architecture(with_metaclass(_ArchitectureMetaClass, object)): core.BNFreeTypeLibraryList(handles, count.value) return result + @property + def can_assemble(self): + """returns if the architecture can assemble instructions (read-only)""" + return core.BNCanArchitectureAssemble(self.handle) + def _init(self, ctxt, handle): self.handle = handle diff --git a/python/binaryview.py b/python/binaryview.py index 7c0ac0c2..7e893ab2 100644 --- a/python/binaryview.py +++ b/python/binaryview.py @@ -3853,6 +3853,22 @@ class BinaryView(object): """ core.BNRemoveAutoDataTag(self.handle, addr, tag.handle) + def can_assemble(self, arch=None): + """ + ``can_assemble`` queries the architecture plugin to determine if the architecture can assemble instructions. + + :return: True if the architecture can assemble, False otherwise + :rtype: bool + :Example: + + >>> bv.can_assemble() + True + >>> + """ + if arch is None: + arch = self.arch + return core.BNCanAssemble(self.handle, arch.handle) + def is_never_branch_patch_available(self, addr, arch=None): """ ``is_never_branch_patch_available`` queries the architecture plugin to determine if the instruction at the |
