// Allows running Babel-Shellfish from unmanaged code. Installs default logger for Babel-Shellfish
        public static int Run(string input)
        {
            int success = 0;

            try
            {
                BabelShellfish instance            = BabelShellfish.GetInstance();
                BabelShellfishConfiguration config = BabelShellfishConfiguration.GetInstance();

                if (config.DebugOut)
                {
                    BabelShellfishDebugString debugStringLogger = new BabelShellfishDebugString();
                    instance.ScriptInvoke += debugStringLogger.ScriptInvokeHandler;
                }
                if (!String.IsNullOrEmpty(config.LogPath))
                {
                    BabelShellfishLogger logger = new BabelShellfishLogger(config.LogPath);
                    instance.ScriptInvoke += logger.ScriptInvokeHandler;
                }
                if (config.ScanAmsi)
                {
                    BabelShellfishAmsi amsiScanner = new BabelShellfishAmsi();
                    instance.ScriptScan += amsiScanner.ScriptScanHandler;
                }
                instance.Init();

                success = 1;
            }
            catch (Exception)
            {
            }
            return(success);
        }
 public static BabelShellfishConfiguration GetInstance()
 {
     if (null == Instance)
     {
         Instance = new BabelShellfishConfiguration();
     }
     return(Instance);
 }
        ////////////////////////////////////////////////////////////////
        // System.Management.Automation.AmsiUtils
        // Monitor strings Amsi receives
        private static UInt32 ScanContent(string content, string sourceMetadata)
        {
            if (BabelShellfishConfiguration.GetInstance().LogAmsi)
            {
                GetInstance().OnScriptInvoke(ScriptType.Amsi, content);
            }

            return(ScanContentDummy(content, sourceMetadata));
        }