(self, state, current_run, func, sp_addr, accessed_registers)
For a given state and current location of of execution, will update a function by adding the offets of
        appropriate actions to the stack variable or argument registers for the fnc.

        :param SimState state: upcoming state.
        :param SimSuccessors current_run: possible result states.
        :param knowledge.Function func: current function.
        :param int sp_addr: stack pointer address.
        :param set accessed_registers: set of before accessed registers.
For a given state and current location of of execution, will update a function by adding the offets of
        appropriate actions to the stack variable or argument registers for the fnc.
For a given state and current location of of execution will update a function by adding the offets of appropriate actions to the stack variable or argument registers for the fnc .
def _handle_actions(self, state, current_run, func, sp_addr, accessed_registers):
        """
        For a given state and current location of of execution, will update a function by adding the offets of
        appropriate actions to the stack variable or argument registers for the fnc.

        :param SimState state: upcoming state.
        :param SimSuccessors current_run: possible result states.
        :param knowledge.Function func: current function.
        :param int sp_addr: stack pointer address.
        :param set accessed_registers: set of before accessed registers.
        """
        se = state.solver

        if func is not None and sp_addr is not None:

            # Fix the stack pointer (for example, skip the return address on the stack)
            new_sp_addr = sp_addr + self.project.arch.call_sp_fix

            actions = [a for a in state.history.recent_actions if a.bbl_addr == current_run.addr]

            for a in actions:
                if a.type == "mem" and a.action == "read":
                    try:
                        addr = se.eval_one(a.addr.ast, default=0)
                    except (claripy.ClaripyError, SimSolverModeError):
                        continue
                    if (self.project.arch.call_pushes_ret and addr >= new_sp_addr) or \
                            (not self.project.arch.call_pushes_ret and addr >= new_sp_addr):
                        # TODO: What if a variable locates higher than the stack is modified as well? We probably want
                        # TODO: to make sure the accessing address falls in the range of stack
                        offset = addr - new_sp_addr
                        func._add_argument_stack_variable(offset)
                elif a.type == "reg":
                    offset = a.offset
                    if a.action == "read" and offset not in accessed_registers:
                        func._add_argument_register(offset)
                    elif a.action == "write":
                        accessed_registers.add(offset)
        else:
            l.error(
                "handle_actions: Function not found, or stack pointer is None. It might indicates unbalanced stack.")
def _handle_actions ( self , state , current_run , func , sp_addr , accessed_registers ) : se = state . solver if func is not None and sp_addr is not None : # Fix the stack pointer (for example, skip the return address on the stack) new_sp_addr = sp_addr + self . project . arch . call_sp_fix actions = [ a for a in state . history . recent_actions if a . bbl_addr == current_run . addr ] for a in actions : if a . type == "mem" and a . action == "read" : try : addr = se . eval_one ( a . addr . ast , default = 0 ) except ( claripy . ClaripyError , SimSolverModeError ) : continue if ( self . project . arch . call_pushes_ret and addr >= new_sp_addr ) or ( not self . project . arch . call_pushes_ret and addr >= new_sp_addr ) : # TODO: What if a variable locates higher than the stack is modified as well? We probably want # TODO: to make sure the accessing address falls in the range of stack offset = addr - new_sp_addr func . _add_argument_stack_variable ( offset ) elif a . type == "reg" : offset = a . offset if a . action == "read" and offset not in accessed_registers : func . _add_argument_register ( offset ) elif a . action == "write" : accessed_registers . add ( offset ) else : l . error ( "handle_actions: Function not found, or stack pointer is None. It might indicates unbalanced stack." )