def EndsWith(field, value):
    """
    A criterion used to search for objects having a text field's value end with `value`. 
    It's a wildcard operator that adds the `*` if not specified, at the beginning of `value`. For example:

    * search for filename observables ending with `.exe`

    Arguments:
        field (value): field name
        value (Any): searched value

    Returns:
        dict: JSON repsentation of the criterion
            ```python
            # Search for tasks where title stats with 'Communication'
            query = EndsWith('data', '.png')
            ```
            produces
            ```json
            {
                "_wildcard": {
                    "_field": "data",
                    "_value": "*.png"
                }
            }
            ```
    """
    if not value.startswith('*'):
        value = '*' + value

    return {'_wildcard': {'_field': field, '_value': value}}