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
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
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
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
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