MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / on_matched_function

Function on_matched_function

plugins/warp/src/plugin.rs:40–62  ·  view source on GitHub ↗

What happens to the function when it is matched. TODO: add user: bool TODO: Rename to markup_function or something.

(function: &Function, matched: &WarpFunction)

Source from the content-addressed store, hash-verified

38// TODO: add user: bool
39// TODO: Rename to markup_function or something.
40pub fn on_matched_function(function: &Function, matched: &WarpFunction) {
41 let view = function.view();
42 // TODO: Using user symbols here is problematic
43 // TODO: For one they queue up a bunch of main thread actions
44 // TODO: Secondly by queueing up those main thread actions if you attempt to save the file
45 // TODO: Before the undo actions are done completing
46 view.define_user_symbol(&to_bn_symbol_at_address(
47 &view,
48 &matched.symbol,
49 function.symbol().address(),
50 ));
51 function.set_user_type(&to_bn_type(&function.arch(), &matched.ty));
52 // TODO: Add metadata. (both binja metadata and warp metadata)
53 function.add_tag(
54 &get_warp_tag_type(&view),
55 matched.guid.to_string(),
56 None,
57 true,
58 None,
59 );
60 // Seems to be the only way to get the analysis update to work correctly.
61 function.mark_updates_required(FunctionUpdateType::FullAutoFunctionUpdate);
62}
63
64struct DebugFunction;
65

Callers 1

match_functionMethod · 0.85

Calls 11

to_bn_symbol_at_addressFunction · 0.85
to_bn_typeFunction · 0.85
get_warp_tag_typeFunction · 0.85
viewMethod · 0.45
define_user_symbolMethod · 0.45
addressMethod · 0.45
symbolMethod · 0.45
set_user_typeMethod · 0.45
archMethod · 0.45
add_tagMethod · 0.45
mark_updates_requiredMethod · 0.45

Tested by

no test coverage detected