(self)
Initialize ptable for ctype

        See __ctype_tolower_loc.c in libc implementation
Initialize ptable for ctype
Initialize ptable for ctype
def _initialize_tolower_loc_table(self):
        """
        Initialize ptable for ctype

        See __ctype_tolower_loc.c in libc implementation
        """
        malloc = angr.SIM_PROCEDURES['libc']['malloc']
        # 384 entries, 4 bytes each
        table = self.inline_call(malloc, 384*4).ret_expr
        table_ptr = self.inline_call(malloc, self.state.arch.bytes).ret_expr

        for pos, c in enumerate(self.state.libc.TOLOWER_LOC_ARRAY):
            self.state.memory.store(table + (pos * 4),
                                    self.state.solver.BVV(c, 32),
                                    endness=self.state.arch.memory_endness,
                                    inspect=False,
                                    disable_actions=True,
                                    )

        # Offset for negative chars: -128 index (4 bytes per index)
        table += (128 * 4)
        self.state.memory.store(table_ptr,
                                table,
                                size=self.state.arch.bytes,
                                endness=self.state.arch.memory_endness,
                                inspect=False,
                                disable_actions=True,
                                )

        self.state.libc.ctype_tolower_loc_table_ptr = table_ptr
def _initialize_tolower_loc_table ( self ) : malloc = angr . SIM_PROCEDURES [ 'libc' ] [ 'malloc' ] # 384 entries, 4 bytes each table = self . inline_call ( malloc , 384 * 4 ) . ret_expr table_ptr = self . inline_call ( malloc , self . state . arch . bytes ) . ret_expr for pos , c in enumerate ( self . state . libc . TOLOWER_LOC_ARRAY ) : self . state . memory . store ( table + ( pos * 4 ) , self . state . solver . BVV ( c , 32 ) , endness = self . state . arch . memory_endness , inspect = False , disable_actions = True , ) # Offset for negative chars: -128 index (4 bytes per index) table += ( 128 * 4 ) self . state . memory . store ( table_ptr , table , size = self . state . arch . bytes , endness = self . state . arch . memory_endness , inspect = False , disable_actions = True , ) self . state . libc . ctype_tolower_loc_table_ptr = table_ptr