A question before the code:
What are the differences between T32_ReadMemory and T32_ReadMemoryObj and in which cases should I prefer one over the other? As far as I can tell from the API PDF the 'Obj' version is more advanced and has more access options and access to 64 bit addresses, but there is no flaw in the regular version so if it works I can use it, am I right?
And for the code:
localBuffer = (ctypes.c_uint8 * size)()
myBufferHandle = ?
myAddressHandle32 = ?
t32api.T32_RequestBufferObj(ctypes.byref(myBufferHandle), 0)
t32api.T32_RequestAddressObjA32(ctypes.byref(myAddressHandle32), addr)
t32api.T32_ReadMemoryObj(myBufferHandle, myAddressHandle32, size)
t32api.T32_CopyDataFromBufferObj(localBuffer, size, myBufferHandle)
t32api.T32_ReleaseBufferObj(ctypes.byref(myBufferHandle))
This is an attempt to "translate" to python the following code example from the remote API PDF:
I got stuck in the places marked by question-marks, I don't know how to create trace32 internal types. I looked for a python example and couldn't find any.