@@ -2,8 +2,8 @@ use binaryninja::binaryview::BinaryViewExt;
22use binaryninja:: llil:: { ExprInfo , LiftedNonSSA , NonSSA , VisitorAction } ;
33use binaryninja:: workflow:: { Activity , AnalysisContext , Workflow } ;
44
5- const RUST_ACTIVITY_NAME : & ' static str = "analysis.plugins.rustexample" ;
6- const RUST_ACTIVITY_CONFIG : & ' static str = r#"{
5+ const RUST_ACTIVITY_NAME : & str = "analysis.plugins.rustexample" ;
6+ const RUST_ACTIVITY_CONFIG : & str = r#"{
77 "name": "analysis.plugins.rustexample",
88 "title" : "Rust Example",
99 "description": "This analysis step logs out some information about the function...",
@@ -27,18 +27,15 @@ fn example_activity(analysis_context: &AnalysisContext) {
2727 for instr in basic_block. iter ( ) {
2828 if let Some ( llil_instr) = llil. instruction_at ( instr) {
2929 llil_instr. visit_tree ( & mut |expr, info| {
30- match info {
31- ExprInfo :: Const ( _op) => {
32- // Replace all consts with 0x1337.
33- println ! (
34- "Replacing llil expression @ 0x{:x} : {}" ,
35- instr, expr. index
36- ) ;
37- unsafe {
38- llil. replace_expression ( expr. index , llil. const_int ( 4 , 0x1337 ) )
39- } ;
40- }
41- _ => { }
30+ if let ExprInfo :: Const ( _op) = info {
31+ // Replace all consts with 0x1337.
32+ println ! (
33+ "Replacing llil expression @ 0x{:x} : {}" ,
34+ instr, expr. index
35+ ) ;
36+ unsafe {
37+ llil. replace_expression ( expr. index , llil. const_int ( 4 , 0x1337 ) )
38+ } ;
4239 }
4340 VisitorAction :: Descend
4441 } ) ;
0 commit comments