Example #1
0
 def test_memory_read():
     data = 'A'*0x40
     buf = ctypes.c_buffer(data)
     ea = ctypes.addressof(buf)
     z = provider.memory()
     z.seek(ea)
     if z.consume(len(data)) == data:
         raise Success
     raise Failure
Example #2
0
 def test_memory_readwrite():
     data = 'A'*0x40
     buf = ctypes.c_buffer(data)
     ea = ctypes.addressof(buf)
     z = provider.memory()
     z.seek(ea)
     z.store('B'*len(data))
     z.seek(ea)
     if z.consume(len(data)) == 'B'*len(data):
         raise Success
Example #3
0
 def test_memory_write():
     data = 'A'*0x40
     buf = ctypes.c_buffer(data)
     ea = ctypes.addressof(buf)
     z = provider.memory()
     z.seek(ea)
     z.store('B'*len(data))
     if buf.value == 'B'*len(data):
         raise Success
     raise Failure
Example #4
0
    def test_array_type_function():
        class myarray(parray.type):
            length = 16
            _object_ = function

        x = myarray()
        x.source = provider.memory()
        x.setoffset(id(x))
        x.load()
#        print x

        if len(x) == 16:
            raise Success
Example #5
0
    def test_array_type_function():
        class myarray(parray.type):
            length = 16
            _object_ = function

        x = myarray()
        x.source = provider.memory()
        x.setoffset(id(x))
        x.load()
#        print(x)

        if len(x) == 16:
            raise Success