summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMason Reed <mason@vector35.com>2025-11-20 17:05:58 -0500
committerMason Reed <35282038+emesare@users.noreply.github.com>2025-12-01 18:53:47 -0500
commit83f2c99693705a9fd979732898f3ef81b8ecbdfc (patch)
treec387273839ad643b506f7e75daddef5af9e24b2d
parentae7e093c4d75b6aa133753cac3911eb74908e205 (diff)
[WARP] Consult type library function objects when matched function has no explicit type
Helps with windows functions where we had previously defined the signature
-rw-r--r--plugins/warp/src/plugin/workflow.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/plugins/warp/src/plugin/workflow.rs b/plugins/warp/src/plugin/workflow.rs
index 809e5415..642a5a53 100644
--- a/plugins/warp/src/plugin/workflow.rs
+++ b/plugins/warp/src/plugin/workflow.rs
@@ -3,7 +3,7 @@ use crate::cache::{
cached_function_guid, insert_cached_function_match, try_cached_function_guid,
try_cached_function_match,
};
-use crate::convert::{platform_to_target, to_bn_type};
+use crate::convert::{platform_to_target, to_bn_symbol_at_address, to_bn_type};
use crate::matcher::{Matcher, MatcherSettings};
use crate::plugin::settings::PluginSettings;
use crate::{get_warp_ignore_tag_type, get_warp_tag_type, relocatable_regions, IGNORE_TAG_NAME};
@@ -260,6 +260,13 @@ pub fn insert_workflow() -> Result<(), ()> {
if !function.has_user_type() {
if let Some(func_ty) = &matched_function.ty {
function.set_auto_type(&to_bn_type(Some(function.arch()), func_ty));
+ } else if !function.has_explicitly_defined_type() {
+ // Attempt to retrieve the type information from the named platform functions.
+ // NOTE: We check `has_explicitly_defined_type` because after applying imported type
+ // information, that flag will be set, allowing us to avoid applying it again.
+ let bn_symbol =
+ to_bn_symbol_at_address(&view, &matched_function.symbol, function.start());
+ function.apply_imported_types(&bn_symbol, None);
}
}
if let Some(mlil) = ctx.mlil_function() {