angr/analyses/girlscout.py
def _scan_function_prologues(self, traced_address, function_exits, initial_state):
        """
        Scan the entire program space for prologues, and start code scanning at those positions
        :param traced_address:
        :param function_exits:
        :param initial_state:
        :param next_addr:
        :returns:
        """

        # Precompile all regexes
        regexes = set()
        for ins_regex in self.project.arch.function_prologs:
            r = re.compile(ins_regex)
            regexes.add(r)

        # TODO: Make sure self._start is aligned

        # Construct the binary blob first

        for start_, bytes_ in self.project.loader.main_object.memory.backers():
            for regex in regexes:
                # Match them!
                for mo in regex.finditer(bytes):
                    position = mo.start() + start_
                    if position % self.project.arch.instruction_alignment == 0:
                        if position not in traced_address:
                            percentage = self._seg_list.occupied_size * 100.0 / (self._valid_memory_region_size)
                            l.info("Scanning %xh, progress %0.04f%%", position, percentage)

                            self._unassured_functions.add(position)

                            self._scan_code(traced_address, function_exits, initial_state, position)
                        else:
                            l.info("Skipping %xh", position)

        Scan the entire program space for prologues, and start code scanning at those positions
        :param traced_address:
        :param function_exits:
        :param initial_state:
        :param next_addr:
        :returns:
        
Scan the entire program space for prologues, and start code scanning at those positions
Scan the entire program space for prologues and start code scanning at those positions
def _scan_function_prologues(self, traced_address, function_exits, initial_state):
        regexes = set()
        for ins_regex in self.project.arch.function_prologs:
            r = re.compile(ins_regex)
            regexes.add(r)
        for start_, bytes_ in self.project.loader.main_object.memory.backers():
            for regex in regexes:
                for mo in regex.finditer(bytes):
                    position = mo.start() + start_
                    if position % self.project.arch.instruction_alignment == 0:
                        if position not in traced_address:
                            percentage = self._seg_list.occupied_size * 100.0 / (self._valid_memory_region_size)
                            l.info("Scanning %xh, progress %0.04f%%", position, percentage)
                            self._unassured_functions.add(position)
                            self._scan_code(traced_address, function_exits, initial_state, position)
                        else:
                            l.info("Skipping %xh", position)
def _scan_function_prologues ( self , traced_address , function_exits , initial_state ) : regexes = set ( ) for ins_regex in self . project . arch . function_prologs : r = re . compile ( ins_regex ) regexes . add ( r ) for start_ , bytes_ in self . project . loader . main_object . memory . backers ( ) : for regex in regexes : for mo in regex . finditer ( bytes ) : position = mo . start ( ) + start_ if position % self . project . arch . instruction_alignment == 0 : if position not in traced_address : percentage = self . _seg_list . occupied_size * 100.0 / ( self . _valid_memory_region_size ) l . info ( "Scanning %xh, progress %0.04f%%" , position , percentage ) self . _unassured_functions . add ( position ) self . _scan_code ( traced_address , function_exits , initial_state , position ) else : l . info ( "Skipping %xh" , position )
Scan the entire program space for prologues, and start code scanning at those positions
Scan the entire program space for prologues and start code scanning at those positions
"""
        Scan the entire program space for prologues, and start code scanning at those positions
        :param traced_address:
        :param function_exits:
        :param initial_state:
        :param next_addr:
        :returns:
        """ # Precompile all regexes # TODO: Make sure self._start is aligned # Construct the binary blob first # Match them!
None
self
traced_address
None
function_exits
None
initial_state
None
next_addr
None