def get_function_at(bv, addr):
    """Gets the function that contains a given address, even if that address
    isn't the start of the function"""
    functions = bv.get_functions_containing(addr)
    return functions[0] if (functions is not None and len(functions) > 0) else None