<commit_before>import logging
import networkx
import string

import claripy

l = logging.getLogger(name="angr.functionmanager")

class Function(object):
    '''
    A representation of a function and various information about it.
    '''
    def __init__(self, function_manager, addr, name=None, syscall=False):
        '''
        Function constructor

        @param addr             The address of the function
        @param name             (Optional) The name of the function
        @param syscall          (Optional) Whether this function is a sycall or not
        '''
        self._transition_graph = networkx.DiGraph()
        self._local_transition_graph = None

        self._ret_sites = set()
        self._call_sites = {}
        self._retn_addr_to_call_site = {}
        self._addr = addr
        self._function_manager = function_manager
        self.name = name
        self.is_syscall = syscall

        if self.name is None:
            # Try to get a name from project.loader
            self.name = self._function_manager._project.loader.find_symbol_name(addr)
            if self.name is None:
                self.name = 'sub_%x' % addr

        # Register offsets of those arguments passed in registers
        self._argument_registers = []
        # Stack offsets of those arguments passed in stack variables
        self._argument_stack_variables = []

        # These properties are set by VariableManager
        self._bp_on_stack = False
        self._retaddr_on_stack = False

        self._sp_delta = 0

        # Calling convention
        self.cc = None

        # Whether this function returns or not. `None` means it's not determined yet
        self.returning = None

        self.prepared_registers = set()
        self.prepared_stack_variables = set()<commit_msg>Try to find PLT stub addresses in function manager<commit_after>import logging
import networkx
import string

import claripy

l = logging.getLogger(name="angr.functionmanager")

class Function(object):
    '''
    A representation of a function and various information about it.
    '''
    def __init__(self, function_manager, addr, name=None, syscall=False):
        '''
        Function constructor

        @param addr             The address of the function
        @param name             (Optional) The name of the function
        @param syscall          (Optional) Whether this function is a sycall or not
        '''
        self._transition_graph = networkx.DiGraph()
        self._local_transition_graph = None

        self._ret_sites = set()
        self._call_sites = {}
        self._retn_addr_to_call_site = {}
        self._addr = addr
        self._function_manager = function_manager
        self.name = name
        self.is_syscall = syscall

        if self.name is None:
            # Try to get a name from project.loader
            self.name = self._function_manager._project.loader.find_symbol_name(addr)
        if self.name is None:
            self.name = self._function_manager._project.loader.find_plt_stub_name(addr)
            if self.name is not None:
                self.name = 'plt.' + self.name
        if self.name is None:
            self.name = 'sub_%x' % addr

        # Register offsets of those arguments passed in registers
        self._argument_registers = []
        # Stack offsets of those arguments passed in stack variables
        self._argument_stack_variables = []

        # These properties are set by VariableManager
        self._bp_on_stack = False
        self._retaddr_on_stack = False

        self._sp_delta = 0

        # Calling convention
        self.cc = None

        # Whether this function returns or not. `None` means it's not determined yet
        self.returning = None

        self.prepared_registers = set()
        self.prepared_stack_variables = set()
{'fraction_non_alphanumeric': 0.07012513034410844, 'fraction_numerical': 0.0005213764337851929, 'mean_word_length': 2.181592039800995, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6778605', 'n_tokens_mistral': 1028, 'n_tokens_neox': 972, 'n_words': 311}