From 3c88b11e5df33116580ac008e36092775df66135 Mon Sep 17 00:00:00 2001 From: Mason Reed Date: Fri, 13 Mar 2026 12:24:18 -0700 Subject: [WARP] Improved UX and API - Exposes WARP type objects directly - Adds processor API (for generating warp files directly) - Adds file and chunk API - Misc cleanup - Simplified the amount of commands - Replaced the "Create" commands with a purpose built processor dialog - Added a native QT viewer for WARP files - Simplified committing to a remote with a purpose built commit dialog --- plugins/warp/src/plugin/ffi/function.rs | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'plugins/warp/src/plugin/ffi/function.rs') diff --git a/plugins/warp/src/plugin/ffi/function.rs b/plugins/warp/src/plugin/ffi/function.rs index 138c0a7b..2eff9e4a 100644 --- a/plugins/warp/src/plugin/ffi/function.rs +++ b/plugins/warp/src/plugin/ffi/function.rs @@ -1,11 +1,11 @@ use crate::build_function; use crate::cache::{insert_cached_function_match, try_cached_function_match}; -use crate::convert::{to_bn_symbol_at_address, to_bn_type}; -use crate::plugin::ffi::{BNWARPConstraint, BNWARPFunction, BNWARPFunctionGUID}; +use crate::convert::to_bn_symbol_at_address; +use crate::plugin::ffi::{BNWARPConstraint, BNWARPFunction, BNWARPFunctionGUID, BNWARPType}; use binaryninja::function::Function; use binaryninja::rc::Ref; use binaryninja::string::BnString; -use binaryninjacore_sys::{BNFunction, BNSymbol, BNType}; +use binaryninjacore_sys::{BNFunction, BNSymbol}; use std::ffi::c_char; use std::mem::ManuallyDrop; use std::sync::Arc; @@ -111,19 +111,14 @@ pub unsafe extern "C" fn BNWARPFunctionGetSymbolName(function: *mut BNWARPFuncti } #[no_mangle] -pub unsafe extern "C" fn BNWARPFunctionGetType( - function: *mut BNWARPFunction, - analysis_function: *mut BNFunction, -) -> *mut BNType { - let analysis_function = Function::from_raw(analysis_function); +pub unsafe extern "C" fn BNWARPFunctionGetType(function: *mut BNWARPFunction) -> *mut BNWARPType { // We do not own function so we should not drop. let function = ManuallyDrop::new(Arc::from_raw(function)); match &function.ty { Some(func_ty) => { - let arch = analysis_function.arch(); - let function_type = to_bn_type(Some(arch), func_ty); - // NOTE: The type ref has been pre-incremented for the caller. - unsafe { Ref::into_raw(function_type) }.handle + let arc_func_ty = Arc::new(func_ty.clone()); + // NOTE: Freed by BNWARPFreeTypeReference + Arc::into_raw(arc_func_ty) as *mut BNWARPType } None => std::ptr::null_mut(), } -- cgit v1.3.1