diff options
| author | Peter LaFosse <peter@vector35.com> | 2021-12-03 15:38:16 -0500 |
|---|---|---|
| committer | Peter LaFosse <peter@vector35.com> | 2021-12-03 15:38:32 -0500 |
| commit | 810e54963af76ed5d5e5c5e79cd747550d48296d (patch) | |
| tree | 1510a17247bd15652737f3f99e2a6111653199a7 /python | |
| parent | 4aeb55836f26dc9614264bb3b3ce48a8ba5122e8 (diff) | |
Fix type hint for get_instruction_low_level_il
Diffstat (limited to 'python')
| -rw-r--r-- | python/architecture.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/python/architecture.py b/python/architecture.py index a72760ae..7e74d702 100644 --- a/python/architecture.py +++ b/python/architecture.py @@ -2294,7 +2294,7 @@ class CoreArchitecture(Architecture): core.BNFreeInstructionText(tokens, count.value) return result, result_length - def get_instruction_low_level_il(self, data:bytes, addr:int, il:lowlevelil.LowLevelILFunction) -> int: + def get_instruction_low_level_il(self, data:bytes, addr:int, il:lowlevelil.LowLevelILFunction) -> Optional[int]: """ ``get_instruction_low_level_il`` appends lowlevelil.ExpressionIndex objects to ``il`` for the instruction at the given virtual address ``addr`` with data ``data``. @@ -2306,14 +2306,15 @@ class CoreArchitecture(Architecture): :param int addr: virtual address of bytes in ``data`` :param LowLevelILFunction il: The function the current instruction belongs to :return: the length of the current instruction - :rtype: int + :rtype: Optional[int] """ length = ctypes.c_ulonglong() length.value = len(data) buf = (ctypes.c_ubyte * len(data))() ctypes.memmove(buf, data, len(data)) - core.BNGetInstructionLowLevelIL(self.handle, buf, addr, length, il.handle) - return length.value + if core.BNGetInstructionLowLevelIL(self.handle, buf, addr, length, il.handle): + return length.value + return None def get_flag_write_low_level_il(self, op:LowLevelILOperation, size:int, write_type:FlagWriteTypeName, flag:FlagType, operands:List['lowlevelil.ILRegisterType'], il:'lowlevelil.LowLevelILFunction') -> 'lowlevelil.ExpressionIndex': |
