def skip_leader(data, ii):
    """Skips data starting at ii until a non 0x55 char is found. Returns
       (new_ii, datai, 0x55)"""
    start_ii = ii
    while((ii < len(data)) and data[ii] == 0x55):
        ii = ii + 1
    if (ii >= len(data)):
        raise EOFError(
            f'Found EOF at index {ii} in the file')
    return (ii, data[start_ii:ii], 0x55)