import struct


def read_unpack(binary_file, fmt):
    """Read bytes from a binary file sized according to the given struct format."""
    return struct.unpack(fmt, binary_file.read(struct.calcsize(fmt)))