def METHOD_NAME(bin_str: str) -> List[int]:
    if not isinstance(bin_str, str):
        raise ValueError('bin_str must be a string')
    if bin_str in cached_patterns:
        return cached_patterns[bin_str]
    bin_list = bin_str.split()
    image = bytearray()
    mask = bytearray()
    # Create the mask and convert '?' to 'CC'.
    for i in range(len(bin_list)):
        byte = bin_list[i]
        if byte== '?':
            image.append(int('CC', 16))
            mask.append(0)
        else:
            image.append(int(byte, 16))
            mask.append(1)
    image = bytes(image)
    mask = bytes(mask)
    start = ida_nalt.get_imagebase()
    end = ida_idaapi.BADADDR
    addrs: List[int] = []
    ea = ida_bytes.METHOD_NAME(start, end, image, mask, 0, ida_bytes.BIN_SEARCH_FORWARD)
    while ea != ida_idaapi.BADADDR:
        addrs.append(ea)
        ea = ida_bytes.METHOD_NAME(ea + len(image), end, image, mask, 0, ida_bytes.BIN_SEARCH_FORWARD)
    cached_patterns[bin_str] = addrs
    return cached_patterns[bin_str]