diff options
Diffstat (limited to 'rust')
| -rw-r--r-- | rust/src/platform.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/rust/src/platform.rs b/rust/src/platform.rs index 43548032..46129b81 100644 --- a/rust/src/platform.rs +++ b/rust/src/platform.rs @@ -165,6 +165,12 @@ impl Platform { unsafe { CoreArchitecture::from_raw(BNGetPlatformArchitecture(self.handle)) } } + /// Get the address size of the platform, this is typically the same as the architecture's address size, + /// but some platforms like Linux x86_64 x32 ABI have differing address sizes from architecture. + pub fn address_size(&self) -> usize { + unsafe { BNGetPlatformAddressSize(self.handle) } + } + pub fn type_container(&self) -> TypeContainer { let type_container_ptr = NonNull::new(unsafe { BNGetPlatformTypeContainer(self.handle) }); // NOTE: I have no idea how this isn't a UAF, see the note in `TypeContainer::from_raw` |
