diff options
Diffstat (limited to 'rust/src/types.rs')
| -rw-r--r-- | rust/src/types.rs | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/rust/src/types.rs b/rust/src/types.rs index 7adc449e..29cdb2d3 100644 --- a/rust/src/types.rs +++ b/rust/src/types.rs @@ -24,6 +24,7 @@ use crate::{ callingconvention::CallingConvention, filemetadata::FileMetadata, function::Function, + mlil::MediumLevelILFunction, rc::*, string::{raw_to_string, BnStrCompatible, BnString}, symbol::Symbol, @@ -51,6 +52,8 @@ pub type TypeClass = BNTypeClass; pub type NamedTypeReferenceClass = BNNamedTypeReferenceClass; pub type MemberAccess = BNMemberAccess; pub type MemberScope = BNMemberScope; +pub type ILBranchDependence = BNILBranchDependence; +pub type DataFlowQueryOption = BNDataFlowQueryOption; //////////////// // Confidence @@ -1442,6 +1445,41 @@ impl SSAVariable { } } +impl CoreArrayProvider for SSAVariable { + type Raw = usize; + type Context = Variable; + type Wrapped<'a> = Self; +} + +unsafe impl CoreArrayProviderInner for SSAVariable { + unsafe fn free(raw: *mut Self::Raw, _count: usize, _context: &Self::Context) { + BNFreeILInstructionList(raw) + } + + unsafe fn wrap_raw<'a>(raw: &'a Self::Raw, context: &'a Self::Context) -> Self::Wrapped<'a> { + SSAVariable::new(*context, *raw) + } +} + +impl CoreArrayProvider for Array<SSAVariable> { + type Raw = BNVariable; + type Context = Ref<MediumLevelILFunction>; + type Wrapped<'a> = Self; +} + +unsafe impl CoreArrayProviderInner for Array<SSAVariable> { + unsafe fn free(raw: *mut Self::Raw, _count: usize, _context: &Self::Context) { + BNFreeVariableList(raw) + } + + unsafe fn wrap_raw<'a>(raw: &'a Self::Raw, context: &'a Self::Context) -> Self::Wrapped<'a> { + let mut count = 0; + let versions = + unsafe { BNGetMediumLevelILVariableSSAVersions(context.handle, raw, &mut count) }; + Array::new(versions, count, Variable::from_raw(*raw)) + } +} + /////////////// // NamedVariable |
