Skip to content

Commit dc9ddca

Browse files
committed
Python: Report get_instruction_start returns InstructionIndex
1 parent 1e23ec1 commit dc9ddca

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

python/lowlevelil.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3784,13 +3784,13 @@ def ssa_vars_without_versions(self) -> List[Union[SSARegister, SSARegisterStack,
37843784
`LowLevelILFunction.ssa_reg_stacks_without_versions`, and `LowLevelILFunction.ssa_flags_without_versions`"""
37853785
return self.ssa_regs_without_versions + self.ssa_reg_stacks_without_versions + self.ssa_flags_without_versions
37863786

3787-
def get_instruction_start(self, addr: int, arch: Optional['architecture.Architecture'] = None) -> Optional[int]:
3787+
def get_instruction_start(self, addr: int, arch: Optional['architecture.Architecture'] = None) -> Optional[InstructionIndex]:
37883788
if arch is None:
37893789
arch = self.arch
37903790
result = core.BNLowLevelILGetInstructionStart(self.handle, arch.handle, addr)
37913791
if result >= core.BNGetLowLevelILInstructionCount(self.handle):
37923792
return None
3793-
return result
3793+
return InstructionIndex(result)
37943794

37953795
def clear_indirect_branches(self) -> None:
37963796
core.BNLowLevelILClearIndirectBranches(self.handle)

python/mediumlevelil.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3490,7 +3490,7 @@ def high_level_il(self) -> Optional[highlevelil.HighLevelILFunction]:
34903490
def hlil(self) -> Optional[highlevelil.HighLevelILFunction]:
34913491
return self.high_level_il
34923492

3493-
def get_instruction_start(self, addr: int, arch: Optional['architecture.Architecture'] = None) -> Optional[int]:
3493+
def get_instruction_start(self, addr: int, arch: Optional['architecture.Architecture'] = None) -> Optional[InstructionIndex]:
34943494
_arch = arch
34953495
if _arch is None:
34963496
if self._arch is None:
@@ -3499,7 +3499,7 @@ def get_instruction_start(self, addr: int, arch: Optional['architecture.Architec
34993499
result = core.BNMediumLevelILGetInstructionStart(self.handle, _arch.handle, addr)
35003500
if result >= core.BNGetMediumLevelILInstructionCount(self.handle):
35013501
return None
3502-
return result
3502+
return InstructionIndex(result)
35033503

35043504
def expr(
35053505
self, operation: MediumLevelILOperation, a: int = 0, b: int = 0, c: int = 0, d: int = 0, e: int = 0,

0 commit comments

Comments
 (0)