I am trying to use a python script to read from memory through trace32. I've found the following document: https://www2.lauterbach.com/pdf/api_remote.pdf
I managed the following code:
local_buffer = ctypes.POINTER(ctypes.c_uint32)
t32api.T32_ReadMemory(byteAddress=addr, access=0x0, buffer=local_buffer, size=size)
print(local_buffer)
Of course there is an initialization of the t32api object - that works. But the code I pasted here causes the following python error:
Traceback (most recent call last):
File "<path_to_python_script>", line 599, in <module>
main()
File "<path_to_python_script>", line 590, in main
process()
File "<path_to_python_script>", line 269, in process
NumberOfEmpr = read_addr(0xf0083100)
File "<path_to_python_script>", line 148, in read_addr
return read_addr_t32(addr, size)
File "<path_to_python_script>", line 137, in read_addr_t32
t32api.T32_ReadMemory(byteAddress=addr, access=0x0, buffer=local_buffer, size=size)
OSError: exception: access violation writing 0xXXXXXXXX
Of course 0xXXXXXXXX is a placeholder to some address, I am guessing it is the address of local_buffer
.
If anyone knows how to fix this I will be thankful.