diff options
| author | Jordan Wiens <jordan@psifertex.com> | 2016-04-20 04:15:09 -0400 |
|---|---|---|
| committer | Jordan Wiens <jordan@psifertex.com> | 2016-04-20 04:15:09 -0400 |
| commit | 27ac9881fa35ea3f55a3ac9322a57b4fb8bb4833 (patch) | |
| tree | 4e023cf0b2ce10d18bb6a78e0b0e8a09f48d237e /python | |
| parent | 42e168dd4855735c891719a2e4265fd730f0def4 (diff) | |
expose length to python basic blocks
Diffstat (limited to 'python')
| -rw-r--r-- | python/__init__.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/python/__init__.py b/python/__init__.py index e1429bd6..f4e3214f 100644 --- a/python/__init__.py +++ b/python/__init__.py @@ -2093,6 +2093,8 @@ class BasicBlock: return core.BNGetBasicBlockStart(self.handle) elif name == "end": return core.BNGetBasicBlockEnd(self.handle) + elif name == "length": + return core.BNGetBasicBlockLength(self.handle) elif name == "outgoing_edges": count = ctypes.c_ulonglong(0) edges = core.BNGetBasicBlockOutgoingEdges(self.handle, count) @@ -2113,13 +2115,13 @@ class BasicBlock: def __setattr__(self, name, value): if ((name == "function") or (name == "arch") or (name == "start") or (name == "end") or - (name == "outgoing_edges") or (name == "has_undetermined_outgoing_edges")): + (name == "length") (name == "outgoing_edges") or (name == "has_undetermined_outgoing_edges")): raise AttributeError, "attribute '%s' is read only" % name else: self.__dict__[name] = value def __dir__(self): - return dir(self.__class__) + ["function", "arch", "start", "end", "outgoing_edges", "has_undetermined_outgoing_edges"] + return dir(self.__class__) + ["function", "arch", "start", "end", "length", "outgoing_edges", "has_undetermined_outgoing_edges"] def __len__(self): return int(core.BNGetBasicBlockLength(self.handle)) |
