diff options
| author | Peter LaFosse <peter@vector35.com> | 2022-01-26 10:44:52 -0500 |
|---|---|---|
| committer | Peter LaFosse <peter@vector35.com> | 2022-01-26 10:54:03 -0500 |
| commit | e25d8896b6306cb6f984964c77b6a670a39cd11d (patch) | |
| tree | cd963d42a49354fc09d51ef7559a0e425836a86c /python/function.py | |
| parent | 344b7f695aeb333bd86a56029799ceef122b947d (diff) | |
Convert SizeWithConfidence to OffsetWithConfidence and remove
Diffstat (limited to 'python/function.py')
| -rw-r--r-- | python/function.py | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/python/function.py b/python/function.py index e328fd04..a16fc6e4 100644 --- a/python/function.py +++ b/python/function.py @@ -1145,13 +1145,13 @@ class Function: core.BNSetUserFunctionHasVariableArguments(self.handle, bc) @property - def stack_adjustment(self) -> 'types.SizeWithConfidence': + def stack_adjustment(self) -> 'types.OffsetWithConfidence': """Number of bytes removed from the stack after return""" result = core.BNGetFunctionStackAdjustment(self.handle) - return types.SizeWithConfidence(result.value, confidence = result.confidence) + return types.OffsetWithConfidence(result.value, confidence = result.confidence) @stack_adjustment.setter - def stack_adjustment(self, value:'types.SizeWithConfidence') -> None: + def stack_adjustment(self, value:'types.OffsetWithConfidence') -> None: oc = core.BNOffsetWithConfidence() oc.value = int(value) if hasattr(value, 'confidence'): @@ -2414,10 +2414,10 @@ class Function: bc.confidence = core.max_confidence core.BNSetAutoFunctionCanReturn(self.handle, bc) - def set_auto_stack_adjustment(self, value:Union[int, 'types.SizeWithConfidence']) -> None: + def set_auto_stack_adjustment(self, value:Union[int, 'types.OffsetWithConfidence']) -> None: oc = core.BNOffsetWithConfidence() oc.value = int(value) - if isinstance(value, types.SizeWithConfidence): + if isinstance(value, types.OffsetWithConfidence): oc.confidence = value.confidence else: oc.confidence = core.max_confidence @@ -2661,14 +2661,14 @@ class Function: result = core.BNGetFunctionRegisterValueAtExit(self.handle, self.arch.get_reg_index(reg)) return variable.RegisterValue.from_BNRegisterValue(result, self.arch) - def set_auto_call_stack_adjustment(self, addr:int, adjust:Union[int, 'types.SizeWithConfidence'], + def set_auto_call_stack_adjustment(self, addr:int, adjust:Union[int, 'types.OffsetWithConfidence'], arch:Optional['architecture.Architecture']=None) -> None: if arch is None: if self.arch is None: raise ValueError(f"Can't call {_function_name_()} for function with no architecture specified") arch = self.arch - if not isinstance(adjust, types.SizeWithConfidence): - adjust = types.SizeWithConfidence(adjust) + if not isinstance(adjust, types.OffsetWithConfidence): + adjust = types.OffsetWithConfidence(adjust) core.BNSetAutoCallStackAdjustment(self.handle, arch.handle, addr, adjust.value, adjust.confidence) def set_auto_call_reg_stack_adjustment(self, addr:int, adjust:Mapping['architecture.RegisterStackName', int], @@ -2715,14 +2715,14 @@ class Function: tc = adjust_type._to_core_struct() core.BNSetUserCallTypeAdjustment(self.handle, arch.handle, addr, tc) - def set_call_stack_adjustment(self, addr:int, adjust:Union[int, 'types.SizeWithConfidence'], + def set_call_stack_adjustment(self, addr:int, adjust:Union[int, 'types.OffsetWithConfidence'], arch:Optional['architecture.Architecture']=None): if arch is None: if self.arch is None: raise ValueError(f"Can't call {_function_name_()} for function with no architecture specified") arch = self.arch - if not isinstance(adjust, types.SizeWithConfidence): - adjust = types.SizeWithConfidence(adjust) + if not isinstance(adjust, types.OffsetWithConfidence): + adjust = types.OffsetWithConfidence(adjust) core.BNSetUserCallStackAdjustment(self.handle, arch.handle, addr, adjust.value, adjust.confidence) def set_call_reg_stack_adjustment(self, addr:int, @@ -2767,13 +2767,13 @@ class Function: platform = self.platform return types.Type.create(core.BNNewTypeReference(result.type), platform = platform, confidence = result.confidence) - def get_call_stack_adjustment(self, addr:int, arch:Optional['architecture.Architecture']=None) -> 'types.SizeWithConfidence': + def get_call_stack_adjustment(self, addr:int, arch:Optional['architecture.Architecture']=None) -> 'types.OffsetWithConfidence': if arch is None: if self.arch is None: raise ValueError(f"Can't call {_function_name_()} for function with no architecture specified") arch = self.arch result = core.BNGetCallStackAdjustment(self.handle, arch.handle, addr) - return types.SizeWithConfidence(result.value, confidence = result.confidence) + return types.OffsetWithConfidence(result.value, confidence = result.confidence) def get_call_reg_stack_adjustment(self, addr:int, arch:Optional['architecture.Architecture']=None) -> \ Dict['architecture.RegisterStackName', 'types.RegisterStackAdjustmentWithConfidence']: |
