summaryrefslogtreecommitdiff
path: root/python/architecture.py
diff options
context:
space:
mode:
authorMason Reed <mason@vector35.com>2024-07-09 08:55:44 -0400
committermason <35282038+emesare@users.noreply.github.com>2024-07-09 17:21:46 +0000
commite6560f0cd26a865401808de3de2f304841f3a482 (patch)
tree05d1fbcf8d0caf0b4d59b3684209ca28a31b6919 /python/architecture.py
parent08f8f0bfcd51f6127783ce6154abcb19c53210e8 (diff)
Refactor architecture calling convention python api
Diffstat (limited to 'python/architecture.py')
-rw-r--r--python/architecture.py60
1 files changed, 52 insertions, 8 deletions
diff --git a/python/architecture.py b/python/architecture.py
index 8c118c44..c3b0f705 100644
--- a/python/architecture.py
+++ b/python/architecture.py
@@ -2049,40 +2049,84 @@ class Architecture(metaclass=_ArchitectureMetaClass):
"""
core.BNRegisterCallingConvention(self.handle, cc.handle)
- def get_default_calling_convention(self) -> Optional['callingconvention.CallingConvention']:
+ @property
+ def default_calling_convention(self):
+ """
+ Default calling convention.
+
+ .. note:: Make sure the calling convention has been registered with `Architecture.register_calling_convention`.
+
+ :getter: returns a CallingConvention object for the default calling convention, if one exists.
+ :setter: sets the default calling convention
+ :type: Optional['callingconvention.CallingConvention']
+ """
cc_handle = core.BNGetArchitectureDefaultCallingConvention(self.handle)
if cc_handle is None:
return None
return callingconvention.CallingConvention(handle=cc_handle)
- def set_default_calling_convention(self, cc: 'callingconvention.CallingConvention'):
+ @default_calling_convention.setter
+ def default_calling_convention(self, cc: 'callingconvention.CallingConvention'):
core.BNSetArchitectureDefaultCallingConvention(self.handle, cc.handle)
- def get_cdecl_calling_convention(self) -> Optional['callingconvention.CallingConvention']:
+ @property
+ def cdecl_calling_convention(self):
+ """
+ Cdecl calling convention.
+
+ .. note:: Make sure the calling convention has been registered with `Architecture.register_calling_convention`.
+
+ :getter: returns a CallingConvention object for the cdecl calling convention, if one exists.
+ :setter: sets the cdecl calling convention
+ :type: Optional['callingconvention.CallingConvention']
+ """
cc_handle = core.BNGetArchitectureCdeclCallingConvention(self.handle)
if cc_handle is None:
return None
return callingconvention.CallingConvention(handle=cc_handle)
- def set_cdecl_calling_convention(self, cc: 'callingconvention.CallingConvention'):
+ @cdecl_calling_convention.setter
+ def cdecl_calling_convention(self, cc: 'callingconvention.CallingConvention'):
core.BNSetArchitectureCdeclCallingConvention(self.handle, cc.handle)
- def get_stdcall_calling_convention(self) -> Optional['callingconvention.CallingConvention']:
+ @property
+ def stdcall_calling_convention(self):
+ """
+ Stdcall calling convention.
+
+ .. note:: Make sure the calling convention has been registered with `Architecture.register_calling_convention`.
+
+ :getter: returns a CallingConvention object for the stdcall calling convention, if one exists.
+ :setter: sets the stdcall calling convention
+ :type: Optional['callingconvention.CallingConvention']
+ """
cc_handle = core.BNGetArchitectureStdcallCallingConvention(self.handle)
if cc_handle is None:
return None
return callingconvention.CallingConvention(handle=cc_handle)
- def set_stdcall_calling_convention(self, cc: 'callingconvention.CallingConvention'):
+ @stdcall_calling_convention.setter
+ def stdcall_calling_convention(self, cc: 'callingconvention.CallingConvention'):
core.BNSetArchitectureStdcallCallingConvention(self.handle, cc.handle)
- def get_fastcall_calling_convention(self) -> Optional['callingconvention.CallingConvention']:
+ @property
+ def fastcall_calling_convention(self):
+ """
+ Fastcall calling convention.
+
+ .. note:: Make sure the calling convention has been registered with `Architecture.register_calling_convention`.
+
+ :getter: returns a CallingConvention object for the fastcall calling convention, if one exists.
+ :setter: sets the fastcall calling convention
+ :type: Optional['callingconvention.CallingConvention']
+ """
cc_handle = core.BNGetArchitectureFastcallCallingConvention(self.handle)
if cc_handle is None:
return None
return callingconvention.CallingConvention(handle=cc_handle)
- def set_fastcall_calling_convention(self, cc: 'callingconvention.CallingConvention'):
+ @fastcall_calling_convention.setter
+ def fastcall_calling_convention(self, cc: 'callingconvention.CallingConvention'):
core.BNSetArchitectureFastcallCallingConvention(self.handle, cc.handle)