(self)
return name
Determine the most suitable name of the function.

        :return:    The initial function name.
        :rtype:     string
Determine the most suitable name of the function.
Determine the most suitable name of the function .
def _get_initial_name(self):
        """
        Determine the most suitable name of the function.

        :return:    The initial function name.
        :rtype:     string
        """

        name = None
        addr = self.addr

        self.is_default_name = False
        # Try to get a name from existing labels
        if self._function_manager is not None:
            if addr in self._function_manager._kb.labels:
                name = self._function_manager._kb.labels[addr]

        # try to get the name from a hook
        if name is None and self.project is not None:
            project = self.project
            if project.is_hooked(addr):
                hooker = project.hooked_by(addr)
                name = hooker.display_name
            elif project.simos.is_syscall_addr(addr):
                syscall_inst = project.simos.syscall_from_addr(addr)
                name = syscall_inst.display_name

        # generate an IDA-style sub_X name
        if name is None:
            self.is_default_name = True
            name = 'sub_%x' % addr

        return name
def _get_initial_name ( self ) : name = None addr = self . addr self . is_default_name = False # Try to get a name from existing labels if self . _function_manager is not None : if addr in self . _function_manager . _kb . labels : name = self . _function_manager . _kb . labels [ addr ] # try to get the name from a hook if name is None and self . project is not None : project = self . project if project . is_hooked ( addr ) : hooker = project . hooked_by ( addr ) name = hooker . display_name elif project . simos . is_syscall_addr ( addr ) : syscall_inst = project . simos . syscall_from_addr ( addr ) name = syscall_inst . display_name # generate an IDA-style sub_X name if name is None : self . is_default_name = True name = 'sub_%x' % addr return name