diff options
| author | Brandon Miller <brandon@vector35.com> | 2025-05-20 15:49:11 -0400 |
|---|---|---|
| committer | Brandon Miller <brandon@vector35.com> | 2025-09-29 07:07:41 -0400 |
| commit | 604a22a0050c000ed4d142589c9ce0e34ee7b570 (patch) | |
| tree | a3e2df1331303be24bbb82cb6966f1604ffe0bc9 /rust/src/function.rs | |
| parent | 288edd311e3312e98c934d0d35e5980d6147b6ca (diff) | |
Rust bindings for custom basic block analysis
Diffstat (limited to 'rust/src/function.rs')
| -rw-r--r-- | rust/src/function.rs | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/rust/src/function.rs b/rust/src/function.rs index c4061328..692eb817 100644 --- a/rust/src/function.rs +++ b/rust/src/function.rs @@ -2992,3 +2992,34 @@ unsafe impl CoreArrayProviderInner for Comment { } } } + +#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq)] +pub struct ArchAndAddr { + pub arch: CoreArchitecture, + pub addr: u64, +} + +impl ArchAndAddr { + pub fn new(arch: CoreArchitecture, addr: u64) -> Self { + Self { arch, addr } + } +} + +impl From<BNArchitectureAndAddress> for ArchAndAddr { + fn from(raw: BNArchitectureAndAddress) -> Self { + unsafe { + let arch = CoreArchitecture::from_raw(raw.arch); + let addr = raw.address; + ArchAndAddr { arch, addr } + } + } +} + +impl ArchAndAddr { + pub fn into_raw(self) -> BNArchitectureAndAddress { + BNArchitectureAndAddress { + arch: self.arch.handle, + address: self.addr, + } + } +} |
