summaryrefslogtreecommitdiff
path: root/rust/src
diff options
context:
space:
mode:
Diffstat (limited to 'rust/src')
-rw-r--r--rust/src/symbol.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/rust/src/symbol.rs b/rust/src/symbol.rs
index 4239dd4d..6c368f7c 100644
--- a/rust/src/symbol.rs
+++ b/rust/src/symbol.rs
@@ -267,6 +267,16 @@ impl Symbol {
unsafe { BNGetSymbolAddress(self.handle) }
}
+ /// Get the symbols ordinal, this will return `None` if the symbol ordinal is `0`.
+ pub fn ordinal(&self) -> Option<u64> {
+ let ordinal = unsafe { BNGetSymbolOrdinal(self.handle) };
+ if ordinal == u64::MIN {
+ None
+ } else {
+ Some(ordinal)
+ }
+ }
+
pub fn auto_defined(&self) -> bool {
unsafe { BNIsSymbolAutoDefined(self.handle) }
}