예제 #1
0
파일: Setting.cs 프로젝트: shurka1024/dip
 public Setting()
 {
     if (SnifferSettings == null)
     {
         SnifferSettings = new SnifferSettings();
     }
 }
예제 #2
0
        /// <summary>
        /// Instantiate a new Sniffer on process, using cache
        /// </summary>
        /// <param name="rsProcess"></param>
        /// <param name="cache"></param>
        public Sniffer(Process rsProcess, ICache cache, SnifferSettings settings = null)
        {
            //Use default settings if no settings were given
            if (settings == null)
            {
                settings = new SnifferSettings();
            }

            _rsProcess = rsProcess;
            _cache     = cache;
            _settings  = settings;

            //Initialise memory reader
            memReader = new RSMemoryReader(rsProcess);

            OnStateChanged += Sniffer_OnStateChanged;

            //Listen to PsarcInstalled event for auto enumeration
            if (settings.enableAutoEnumeration)
            {
                OnPsarcInstalled += Sniffer_OnPsarcInstalled;
            }

            DoMemoryReadout();
            DoStateMachine();
            DoSniffing();
        }
예제 #3
0
        /// <summary>
        /// Load JSON files from disc or initialize default values and write all configuration files to disc
        /// </summary>
        internal void Load()
        {
            //Create the config directory if it doesn't exist
            Directory.CreateDirectory(cfiledir);

            //Load settings files
            addonSettings   = LoadFile <AddonSettings>(addonFile);
            snifferSettings = LoadFile <SnifferSettings>(snifferFile);
            rpcSettings     = LoadFile <RPCSettings>(rpcFile);
            formatSettings  = LoadFile <FormatSettings>(formatFile);
            debugSettings   = LoadFile <DebugSettings>(debugFile);
            outputSettings  = LoadFile <OutputSettings>(outputFile);

            Console.WriteLine("Configuration loaded");

            //Save the resulting JSON
            Save();
        }