pub fn reanalysis(&mut self, rfn_addr: &u64) {
        // Sort operands for commutative opcode first.
        {
            let rfn = self.rmod.functions.get_mut(rfn_addr);
            if rfn.is_none() {
                radeco_err!("RadecoFunction Not Found!");
                return;
            };
            let rfn = rfn.unwrap();
            radeco_trace!("CallFixer|RadecoFunction: {:?}", rfn.name);
            let ssa = rfn.ssa_mut();
            let mut sorter = Sorter::new(ssa);
            sorter.run();
        }

        let (entry_store, exit_load) = {
            let rfn = self.rmod.functions.get(rfn_addr).unwrap();
            let ssa = rfn.ssa();
            let sp_name = self.sp_name.clone().unwrap_or(String::new());
            let bp_name = self.bp_name.clone().unwrap_or(String::new());
            let stack_offset = digstack::rounded_analysis(&ssa, sp_name, bp_name);
            // Here, we check the assumption we made in first analysis.
            // If the SP is not balanced, we will throw a WARN or PANIC.
            // TODO: if the SP is not balanced, please UNDO the fix.
            radeco_trace!("CallFixer|Global stack_offset: {:?}", stack_offset);
            let sp_offset_opt = self.sp_offsets.get(rfn_addr).unwrap_or_else(|| {
                radeco_err!("sp_offsets.get({:?}) == None", rfn_addr);
                &None
            });
            if let &Some(sp_offset) = sp_offset_opt {
                let mut max_offset: i64 = 0;
                // The last SP offset should be the biggest
                for offset in &stack_offset {
                    radeco_trace!(
                        "CallFixer|{:?} with {:?}: {}",
                        offset.0,
                        ssa.node_data(*offset.0),
                        offset.1
                    );
                    if offset.1 > &max_offset {
                        max_offset = *offset.1;
                    }
                }
                if max_offset != sp_offset {
                    radeco_warn!(
                        "Stack is not Balanced in fn_addr {:?}! First analysis {:?} with seconde \
                         analysis {:?}",
                        rfn_addr,
                        sp_offset,
                        max_offset
                    );
                    println!(
                        "  [*] WARN: Stack is not Balanced in function @ {:#}! Output analysis \
                         may be not accurate",
                        rfn_addr
                    );
                }
            }
            (
                self.analysis_entry_store(ssa, stack_offset.clone()),
                self.analysis_exit_load(ssa, stack_offset),
            )
        };
        radeco_trace!("CallFixer|Entry_store {:?}", entry_store);
        radeco_trace!("CallFixer|Exit_load {:?}", exit_load);

        self.mark_preserved(rfn_addr, entry_store, exit_load);
    }
// Second analysis, at this point, we have at least BP for every callee, now, we could
// do a global search for all the nodes' stack offset. Then, we could make a more accurate
// preserved fix.
Second analysis, at this point, we have at least BP for every callee, now, we could
do a global search for all the nodes' stack offset. Then, we could make a more accurate
preserved fix.
Second analysis at this point we have at least BP for every callee now we could do a global search for all the nodes ' stack offset . Then we could make a more accurate preserved fix .
pub fn reanalysis(&mut self, rfn_addr: &u64) {
        // Sort operands for commutative opcode first.
        {
            let rfn = self.rmod.functions.get_mut(rfn_addr);
            if rfn.is_none() {
                radeco_err!("RadecoFunction Not Found!");
                return;
            };
            let rfn = rfn.unwrap();
            radeco_trace!("CallFixer|RadecoFunction: {:?}", rfn.name);
            let ssa = rfn.ssa_mut();
            let mut sorter = Sorter::new(ssa);
            sorter.run();
        }
        let (entry_store, exit_load) = {
            let rfn = self.rmod.functions.get(rfn_addr).unwrap();
            let ssa = rfn.ssa();
            let sp_name = self.sp_name.clone().unwrap_or(String::new());
            let bp_name = self.bp_name.clone().unwrap_or(String::new());
            let stack_offset = digstack::rounded_analysis(&ssa, sp_name, bp_name);
            // Here, we check the assumption we made in first analysis.
            // If the SP is not balanced, we will throw a WARN or PANIC.
            // TODO: if the SP is not balanced, please UNDO the fix.
            radeco_trace!("CallFixer|Global stack_offset: {:?}", stack_offset);
            let sp_offset_opt = self.sp_offsets.get(rfn_addr).unwrap_or_else(|| {
                radeco_err!("sp_offsets.get({:?}) == None", rfn_addr);
                &None
            });
            if let &Some(sp_offset) = sp_offset_opt {
                let mut max_offset: i64 = 0;
                // The last SP offset should be the biggest
                for offset in &stack_offset {
                    radeco_trace!(
                        "CallFixer|{:?} with {:?}: {}",
                        offset.0,
                        ssa.node_data(*offset.0),
                        offset.1
                    );
                    if offset.1 > &max_offset {
                        max_offset = *offset.1;
                    }
                }
                if max_offset != sp_offset {
                    radeco_warn!(
                        "Stack is not Balanced in fn_addr {:?}! First analysis {:?} with seconde \
                         analysis {:?}",
                        rfn_addr,
                        sp_offset,
                        max_offset
                    );
                    println!(
                        "  [*] WARN: Stack is not Balanced in function @ {:#}! Output analysis \
                         may be not accurate",
                        rfn_addr
                    );
                }
            }
            (
                self.analysis_entry_store(ssa, stack_offset.clone()),
                self.analysis_exit_load(ssa, stack_offset),
            )
        };
        radeco_trace!("CallFixer|Entry_store {:?}", entry_store);
        radeco_trace!("CallFixer|Exit_load {:?}", exit_load);
        self.mark_preserved(rfn_addr, entry_store, exit_load);
    }
pub fn reanalysis ( & mut self , rfn_addr : & u64 ) { // Sort operands for commutative opcode first. { let rfn = self . rmod . functions . get_mut ( rfn_addr ) ; if rfn . is_none ( ) { radeco_err ! ( " " ) ; return ; } ; let rfn = rfn . unwrap ( ) ; radeco_trace ! ( " " rfn name ) ; let ssa = rfn . ssa_mut ( ) ; let mut sorter = Sorter :: new ( ssa ) ; sorter . run ( ) ; } let ( entry_store , exit_load ) = { let rfn = self . rmod . functions . get ( rfn_addr ) . unwrap ( ) ; let ssa = rfn . ssa ( ) ; let sp_name = self . sp_name . clone ( ) . unwrap_or ( String :: new ( ) ) ; let bp_name = self . bp_name . clone ( ) . unwrap_or ( String :: new ( ) ) ; let stack_offset = digstack :: rounded_analysis ( & ssa , sp_name , bp_name ) ; // Here, we check the assumption we made in first analysis. // If the SP is not balanced, we will throw a WARN or PANIC. // TODO: if the SP is not balanced, please UNDO the fix. radeco_trace ! ( " " stack_offset ) ; let sp_offset_opt = self . sp_offsets . get ( rfn_addr ) . unwrap_or_else ( | | { radeco_err ! ( " " rfn_addr ) ; & None } ) ; if let & Some ( sp_offset ) = sp_offset_opt { let mut max_offset : i64 = 0 ; // The last SP offset should be the biggest for offset in & stack_offset { radeco_trace ! ( " " offset 0 ssa node_data ( offset 0 ) offset 1 ) ; if offset . 1 > & max_offset { max_offset = * offset . 1 ; } } if max_offset != sp_offset { radeco_warn ! ( " \
 " rfn_addr sp_offset max_offset ) ; println ! ( " \
 " rfn_addr ) ; } } ( self . analysis_entry_store ( ssa , stack_offset . clone ( ) ) , self . analysis_exit_load ( ssa , stack_offset ) , ) } ; radeco_trace ! ( " " entry_store ) ; radeco_trace ! ( " " exit_load ) ; self . mark_preserved ( rfn_addr , entry_store , exit_load ) ; }
Second analysis, at this point, we have at least BP for every callee, now, we could
do a global search for all the nodes' stack offset.
Second analysis at this point we have at least BP for every callee now we could do a global search for all the nodes ' stack offset .
&mut self
rfn_addr
&u64
&mut self
rfn_addr
&u64