summaryrefslogtreecommitdiff
path: root/rust/src
diff options
context:
space:
mode:
authorMason Reed <mason@vector35.com>2026-02-05 12:03:59 -0800
committerMason Reed <35282038+emesare@users.noreply.github.com>2026-02-23 00:09:44 -0800
commitd0c590401d28d949b825cab1462549e41c1046af (patch)
tree49f2afc1bc3f3f91cea07100dbfd86e3b5f35a32 /rust/src
parentef967ae27d303bbb6f3a5ea9ff7b1bdfcf6c2637 (diff)
[Rust] Add `Symbol::ordinal`
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) }
}