def strstr(cpu_context, func_name, func_args):
    """
    Locate substring.

    Returns a pointer to the first occurrence of str2 in str1, or a null pointer if str2 is not part of str1.
    """
    str1_ptr, str2_ptr = func_args
    str1 = cpu_context.memory.read_data(str1_ptr)
    str2 = cpu_context.memory.read_data(str2_ptr)

    offset = str1.find(str2)
    if offset == -1:
        return 0

    return str1_ptr + offset