Skip to content

Commit 72fd03f

Browse files
fix[python]: relocation API types
1 parent 210b0d5 commit 72fd03f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

python/binaryview.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3927,7 +3927,7 @@ def max_function_size_for_analysis(self) -> int:
39273927
def max_function_size_for_analysis(self, size: int) -> None:
39283928
core.BNSetMaxFunctionSizeForAnalysis(self.handle, size)
39293929

3930-
def define_relocation(self, info: 'relocation.RelocationInfo', target: 'int | _types.Symbol', reloc: int, arch: Optional['architecture.Architecture'] = None):
3930+
def define_relocation(self, info: 'relocation.RelocationInfo', target: 'int | _types.CoreSymbol', reloc: int, arch: Optional['architecture.Architecture'] = None):
39313931
if arch is None:
39323932
if self.arch is None:
39333933
raise Exception("Can not define relocation with no Architecture specified")

python/relocation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ def perform_apply_relocation(self, view: 'binaryview.BinaryView', arch: 'archite
247247

248248
return bytes(dest)
249249

250-
def perform_get_operand_for_external_relocation(self, data: bytes, addr: int, il: lowlevelil.LowLevelILFunction, reloc: Relocation) -> bool | Optional['lowlevelil.ExpressionIndex']:
250+
def perform_get_operand_for_external_relocation(self, data: bytes, addr: int, il: lowlevelil.LowLevelILFunction, reloc: Relocation) -> Optional[bool | int]:
251251
return True
252252

253253
def get_relocation_info(self, view: 'binaryview.BinaryView', arch: 'architecture.Architecture', result: List[RelocationInfo]) -> bool:
@@ -282,7 +282,7 @@ def apply_relocation(self, view: 'binaryview.BinaryView', arch: 'architecture.Ar
282282

283283
return bytes(dest)
284284

285-
def get_operand_for_external_relocation(self, data: bytes, addr: int, il: lowlevelil.LowLevelILFunction, reloc: Relocation) -> bool | Optional['lowlevelil.ExpressionIndex']:
285+
def get_operand_for_external_relocation(self, data: bytes, addr: int, il: lowlevelil.LowLevelILFunction, reloc: Relocation) -> Optional[bool | int]:
286286
buf = (ctypes.c_ubyte * len(data))()
287287
ctypes.memmove(buf, data, len(data))
288288
result = core.BNRelocationHandlerGetOperandForExternalRelocation(

0 commit comments

Comments
 (0)