From 8d621c51b2797fda7b1dc22243dde611cfc04f68 Mon Sep 17 00:00:00 2001 From: Rusty Wagner Date: Tue, 23 Dec 2025 13:12:02 -0700 Subject: Refactor calling conventions to support correct representation of structures --- rust/src/confidence.rs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'rust/src/confidence.rs') diff --git a/rust/src/confidence.rs b/rust/src/confidence.rs index f8745180..31ce7582 100644 --- a/rust/src/confidence.rs +++ b/rust/src/confidence.rs @@ -3,11 +3,11 @@ use crate::architecture::{Architecture, CoreArchitecture}; use crate::calling_convention::CoreCallingConvention; use crate::rc::{Ref, RefCountable}; -use crate::types::Type; +use crate::types::{Type, ValueLocation}; use binaryninjacore_sys::{ BNBoolWithConfidence, BNCallingConventionWithConfidence, BNGetCallingConventionArchitecture, BNInlineDuringAnalysis, BNInlineDuringAnalysisWithConfidence, BNOffsetWithConfidence, - BNTypeWithConfidence, + BNTypeWithConfidence, BNValueLocation, BNValueLocationWithConfidence, }; use std::fmt; use std::fmt::{Debug, Display, Formatter}; @@ -225,6 +225,19 @@ impl Conf> { } } +impl Conf { + pub(crate) fn into_rust_raw(value: Self) -> BNValueLocationWithConfidence { + BNValueLocationWithConfidence { + location: ValueLocation::into_rust_raw(&value.contents), + confidence: value.confidence, + } + } + + pub(crate) fn free_rust_raw(value: BNValueLocationWithConfidence) { + ValueLocation::free_rust_raw(value.location); + } +} + impl Conf> { pub(crate) fn from_raw(value: &BNCallingConventionWithConfidence) -> Self { let arch = unsafe { -- cgit v1.3.1