diff options
| author | LukBukkit <luk.bukkit@gmail.com> | 2025-09-05 15:07:48 +0200 |
|---|---|---|
| committer | Mason Reed <mason@vector35.com> | 2025-09-07 18:19:40 -0400 |
| commit | 9124b7bc37b2db85b6729c616e858930a5c16493 (patch) | |
| tree | 05959e5732ec092d76f16dfe5acc426d1b152b12 /rust/src | |
| parent | 9e83ea144de09b78a696a0a9997ec28e3bc55327 (diff) | |
[Rust] Support pointer base types and offsets
Diffstat (limited to 'rust/src')
| -rw-r--r-- | rust/src/types.rs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/rust/src/types.rs b/rust/src/types.rs index ebc4328e..33a08583 100644 --- a/rust/src/types.rs +++ b/rust/src/types.rs @@ -48,6 +48,7 @@ pub type NamedTypeReferenceClass = BNNamedTypeReferenceClass; pub type MemberAccess = BNMemberAccess; pub type MemberScope = BNMemberScope; pub type IntegerDisplayType = BNIntegerDisplayType; +pub type PointerBaseType = BNPointerBaseType; #[derive(PartialEq, Eq, Hash)] pub struct TypeBuilder { @@ -95,6 +96,11 @@ impl TypeBuilder { self } + pub fn set_pointer_base(&self, base_type: PointerBaseType, base_offset: i64) -> &Self { + unsafe { BNSetTypeBuilderPointerBase(self.handle, base_type, base_offset) } + self + } + // Readable properties pub fn type_class(&self) -> TypeClass { @@ -231,6 +237,14 @@ impl TypeBuilder { unsafe { BNGetTypeBuilderStackAdjustment(self.handle).into() } } + pub fn pointer_base_type(&self) -> PointerBaseType { + unsafe { BNTypeBuilderGetPointerBaseType(self.handle) } + } + + pub fn pointer_base_offset(&self) -> i64 { + unsafe { BNTypeBuilderGetPointerBaseOffset(self.handle) } + } + // TODO : This and properties // pub fn tokens(&self) -> ? {} @@ -602,6 +616,14 @@ impl Type { } } + pub fn pointer_base_type(&self) -> BNPointerBaseType { + unsafe { BNTypeGetPointerBaseType(self.handle) } + } + + pub fn pointer_base_offset(&self) -> i64 { + unsafe { BNTypeGetPointerBaseOffset(self.handle) } + } + // TODO : This and properties // pub fn tokens(&self) -> ? {} |
