import struct


def _replace_header_crc32(raw_header: bytes, header_crc32: int) -> bytes:
    """Replace the 'header_crc32' field in a raw header."""
    header_crc32_bytes = struct.pack("<I", header_crc32)
    return raw_header[: 8 + 4 + 4] + header_crc32_bytes + raw_header[8 + 4 + 4 + 4 :]