These are simple variable declarations in cpp, how do I do it in Python ctypes?
B *C = (B *) A;
D *E = (D *)(A + sizeof(B));
Assume that B and D are structs and A is uint8_t A[42];
. Where do I start from here?
I tried using cast functions but maybe I’m wrong, can you help me?
from ctypes import POINTER, byref, addressof, sizeof, cast
C = cast(byref(A), POINTER(B)).contents
E = cast(addressof(A) + sizeof(B), POINTER(D)).contents