angr/engines/soot/values/thisref.py
def new_object(cls, state, type_, symbolic=False, init_object=False, init_class=False):
        """
        Creates a new object reference.
        :param state: State associated to the object.
        :param type_: Class of the object.
        :param init_object: Whether the objects initializer method should be run.
        :param init_class: Whether the class initializer method should be run.
        :return: Reference to the new object.
        """
        # create reference
        obj_ref = cls(heap_alloc_id=state.memory.get_new_uuid(), type_=type_, symbolic=symbolic)
        # run initializer
        if init_object:
            l.info(">" * 15 + " Initialize object %r ... " + ">" * 15, obj_ref)
            # find initializer method
            # TODO: add support for non-default initializing methods
            init_method = resolve_method(state, '<init>', type_, init_class=init_class).address()

            # setup init state
            args = [SootArgument(obj_ref, obj_ref.type, is_this_ref=True)]
            init_state = state.project.simos.state_call(init_method, *args,
                                                        base_state=state,
                                                        ret_addr=SootAddressTerminator())
            # run init state
            simgr = state.project.factory.simgr(init_state)
            simgr.run()
            # copy results from initialization to the state
            state.memory.vm_static_table = simgr.deadended[0].memory.vm_static_table.copy()
            state.memory.heap = simgr.deadended[0].memory.heap.copy()
            l.debug("<" * 15 + " Initialize object %r ... done " + "<" * 15, obj_ref)
        return obj_ref

        Creates a new object reference.
        :param state: State associated to the object.
        :param type_: Class of the object.
        :param init_object: Whether the objects initializer method should be run.
        :param init_class: Whether the class initializer method should be run.
        :return: Reference to the new object.
        
Creates a new object reference.
Creates a new object reference .
def new_object(cls, state, type_, symbolic=False, init_object=False, init_class=False):
        obj_ref = cls(heap_alloc_id=state.memory.get_new_uuid(), type_=type_, symbolic=symbolic)
        if init_object:
            l.info(">" * 15 + " Initialize object %r ... " + ">" * 15, obj_ref)
            init_method = resolve_method(state, '<init>', type_, init_class=init_class).address()
            args = [SootArgument(obj_ref, obj_ref.type, is_this_ref=True)]
            init_state = state.project.simos.state_call(init_method, *args,
                                                        base_state=state,
                                                        ret_addr=SootAddressTerminator())
            simgr = state.project.factory.simgr(init_state)
            simgr.run()
            state.memory.vm_static_table = simgr.deadended[0].memory.vm_static_table.copy()
            state.memory.heap = simgr.deadended[0].memory.heap.copy()
            l.debug("<" * 15 + " Initialize object %r ... done " + "<" * 15, obj_ref)
        return obj_ref
def new_object ( cls , state , type_ , symbolic = False , init_object = False , init_class = False ) : obj_ref = cls ( heap_alloc_id = state . memory . get_new_uuid ( ) , type_ = type_ , symbolic = symbolic ) if init_object : l . info ( ">" * 15 + " Initialize object %r ... " + ">" * 15 , obj_ref ) init_method = resolve_method ( state , '<init>' , type_ , init_class = init_class ) . address ( ) args = [ SootArgument ( obj_ref , obj_ref . type , is_this_ref = True ) ] init_state = state . project . simos . state_call ( init_method , * args , base_state = state , ret_addr = SootAddressTerminator ( ) ) simgr = state . project . factory . simgr ( init_state ) simgr . run ( ) state . memory . vm_static_table = simgr . deadended [ 0 ] . memory . vm_static_table . copy ( ) state . memory . heap = simgr . deadended [ 0 ] . memory . heap . copy ( ) l . debug ( "<" * 15 + " Initialize object %r ... done " + "<" * 15 , obj_ref ) return obj_ref
Creates a new object reference.
Creates a new object reference .
"""
        Creates a new object reference.
        :param state: State associated to the object.
        :param type_: Class of the object.
        :param init_object: Whether the objects initializer method should be run.
        :param init_class: Whether the class initializer method should be run.
        :return: Reference to the new object.
        """ # create reference # run initializer # find initializer method # TODO: add support for non-default initializing methods # setup init state # run init state # copy results from initialization to the state
Reference to the new object.
Reference to the new object .
cls
state
State associated to the object.
State associated to the object .
type_
Class of the object.
Class of the object .
symbolic
init_object
Whether the objects initializer method should be run.
Whether the objects initializer method should be run .
init_class
Whether the class initializer method should be run.
Whether the class initializer method should be run .