def csce(args: Namespace):
    'Parse configuration options from Cobalt Strike Beacon.'
    if (not args.source.is_file()):
        logger.error('Source path does not exist or is not file')
        return 1
    if args.cs_version:
        version_list = [args.cs_version]
    else:
        version_list = list(CobaltStrikeConfigParser.SUPPORTED_VERSIONS)
    config: Dict[(str, Any)] = dict()
    for version in version_list:
        with CobaltStrikeConfigParser(args.source, version) as parser:
            try:
                config = parser.parse_config()
                break
            except CobaltStrikeError:
                pass
    print(json.dumps(config, indent=(2 if args.pretty else None), cls=JSONEncoderWithBinarySupport))
    return 0
Parse configuration options from Cobalt Strike Beacon.
def csce(args: Namespace):
    
    if (not args.source.is_file()):
        logger.error('Source path does not exist or is not file')
        return 1
    if args.cs_version:
        version_list = [args.cs_version]
    else:
        version_list = list(CobaltStrikeConfigParser.SUPPORTED_VERSIONS)
    config: Dict[(str, Any)] = dict()
    for version in version_list:
        with CobaltStrikeConfigParser(args.source, version) as parser:
            try:
                config = parser.parse_config()
                break
            except CobaltStrikeError:
                pass
    print(json.dumps(config, indent=(2 if args.pretty else None), cls=JSONEncoderWithBinarySupport))
    return 0