def deserialize(ctypesObj, inputBytes):
    """
    FAQ: How do I copy bytes to a ctypes.Structure from Python?
    """
    fit = min(len(inputBytes), ctypes.sizeof(ctypesObj))
    ctypes.memmove(ctypes.addressof(ctypesObj), inputBytes, fit)

    FAQ: How do I copy bytes to a ctypes.Structure from Python?
    
recipes/Python/577994_EMMG_simulator/recipe-577994.py