public Setting() { if (SnifferSettings == null) { SnifferSettings = new SnifferSettings(); } }
/// <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(); }
/// <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(); }