summaryrefslogtreecommitdiff
path: root/python/architecture.py
diff options
context:
space:
mode:
authorJosh Ferrell <josh@vector35.com>2024-06-05 22:59:31 -0400
committerJosh Ferrell <josh@vector35.com>2024-06-05 22:59:31 -0400
commit75787e706c877a34a68c23c0d4f90ec5ff1e830c (patch)
treeaa78ff05b52bb7e998d225518f30c3374246b86c /python/architecture.py
parent8aacc0b27554ddf039b2199e6af0fb34e5c4841d (diff)
Add support for getting/setting default calling conventions in python
Diffstat (limited to 'python/architecture.py')
-rw-r--r--python/architecture.py36
1 files changed, 36 insertions, 0 deletions
diff --git a/python/architecture.py b/python/architecture.py
index 87fe3ee9..8c118c44 100644
--- a/python/architecture.py
+++ b/python/architecture.py
@@ -2049,6 +2049,42 @@ class Architecture(metaclass=_ArchitectureMetaClass):
"""
core.BNRegisterCallingConvention(self.handle, cc.handle)
+ def get_default_calling_convention(self) -> 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'):
+ core.BNSetArchitectureDefaultCallingConvention(self.handle, cc.handle)
+
+ def get_cdecl_calling_convention(self) -> 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'):
+ core.BNSetArchitectureCdeclCallingConvention(self.handle, cc.handle)
+
+ def get_stdcall_calling_convention(self) -> 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'):
+ core.BNSetArchitectureStdcallCallingConvention(self.handle, cc.handle)
+
+ def get_fastcall_calling_convention(self) -> 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'):
+ core.BNSetArchitectureFastcallCallingConvention(self.handle, cc.handle)
+
_architecture_cache = {}