int read_memory_func(long address, IntPtr data, int size)
{
try {
TargetAddress location = new TargetAddress (
memory.AddressDomain, address);
byte[] buffer = memory.ReadBuffer (location, size);
Marshal.Copy (buffer, 0, data, size);
} catch (Exception e) {
memory_exception = e;
return 1;
}
return 0;
}