(self)
The major analysis routine.
The major analysis routine.
The major analysis routine .
def _analyze(self):
        """
        The major analysis routine.
        """

        if self._function.is_simprocedure:
            self.cc = self._function.calling_convention
            self.prototype = self._function.prototype
            if self.cc is None:
                callsite_facts = self._analyze_callsites(max_analyzing_callsites=1)
                cc = DefaultCC[self.project.arch.name](self.project.arch)
                prototype = self._adjust_prototype(self.prototype, callsite_facts,
                                                   update_arguments=UpdateArgumentsOption.AlwaysUpdate)
                self.cc = cc
                self.prototype = prototype
            return
        if self._function.is_plt:
            r = self._analyze_plt()
            if r is not None:
                self.cc, self.prototype = r
            return

        r = self._analyze_function()
        if r is None:
            l.warning('Cannot determine calling convention for %r.', self._function)
        else:
            # adjust prototype if needed
            cc, prototype = r
            if self.analyze_callsites:
                # only take the first 3 because running reaching definition analysis on all functions is costly
                callsite_facts = self._analyze_callsites(max_analyzing_callsites=3)
                prototype = self._adjust_prototype(prototype, callsite_facts,
                                                   update_arguments=UpdateArgumentsOption.UpdateWhenCCHasNoArgs)

            self.cc = cc
            self.prototype = prototype
def _analyze ( self ) : if self . _function . is_simprocedure : self . cc = self . _function . calling_convention self . prototype = self . _function . prototype if self . cc is None : callsite_facts = self . _analyze_callsites ( max_analyzing_callsites = 1 ) cc = DefaultCC [ self . project . arch . name ] ( self . project . arch ) prototype = self . _adjust_prototype ( self . prototype , callsite_facts , update_arguments = UpdateArgumentsOption . AlwaysUpdate ) self . cc = cc self . prototype = prototype return if self . _function . is_plt : r = self . _analyze_plt ( ) if r is not None : self . cc , self . prototype = r return r = self . _analyze_function ( ) if r is None : l . warning ( 'Cannot determine calling convention for %r.' , self . _function ) else : # adjust prototype if needed cc , prototype = r if self . analyze_callsites : # only take the first 3 because running reaching definition analysis on all functions is costly callsite_facts = self . _analyze_callsites ( max_analyzing_callsites = 3 ) prototype = self . _adjust_prototype ( prototype , callsite_facts , update_arguments = UpdateArgumentsOption . UpdateWhenCCHasNoArgs ) self . cc = cc self . prototype = prototype