I'm working with python and import dll that have the following function:
int ReadMem(long Addr, long NumBytes, void* pData);
and I'm using this function to read memory from my target.
I want to create structure in python that is identical to structure defined in my target and then read it in python
I.E if i used C , i would wrote , ReadMem(0x10000000, 200, &mem_struct);
- What is the best way to define the struct (ctype Structure class or struct)?
- I used ctype Structure class:
class memory(Structure):
fields_ = [("x", c_int),
("y", c_int)]
My question is: how can I call the ReadMem function with pointer to this struct? I try to use ctype pointer (I.E pi=pointer(memory) ) but I get TypeError