コード例 #1
0
ファイル: Csvm.cs プロジェクト: wanglin2019/Reflexil
        VmOpCodeHandlerDetector GetVmOpCodeHandlerDetector()
        {
            var vmFilename   = vmAssemblyRef.Name + ".dll";
            var vmModulePath = Path.Combine(Path.GetDirectoryName(module.Location), vmFilename);

            Logger.v("CSVM filename: {0}", vmFilename);

            var dataKey = "cs cached VmOpCodeHandlerDetector v2";
            var dict    = (Dictionary <string, VmOpCodeHandlerDetector>)deobfuscatorContext.GetData(dataKey);

            if (dict == null)
            {
                deobfuscatorContext.SetData(dataKey, dict = new Dictionary <string, VmOpCodeHandlerDetector>(StringComparer.OrdinalIgnoreCase));
            }
            if (dict.TryGetValue(vmModulePath, out var detector))
            {
                return(detector);
            }
            dict[vmModulePath] = detector = new VmOpCodeHandlerDetector(ModuleDefMD.Load(vmModulePath));

            detector.FindHandlers();
            Logger.v("CSVM opcodes: {0}", detector.Handlers.Count);
            Logger.Instance.Indent();
            for (int i = 0; i < detector.Handlers.Count; i++)
            {
                Logger.v("{0:X4}: {1}", i, detector.Handlers[i]);
            }
            Logger.Instance.DeIndent();

            return(detector);
        }
コード例 #2
0
		public CsvmToCilMethodConverter(IDeobfuscatorContext deobfuscatorContext, ModuleDefMD module, VmOpCodeHandlerDetector opCodeDetector)
			: base(deobfuscatorContext, module) {
			this.opCodeDetector = opCodeDetector;
		}
コード例 #3
0
 public CsvmToCilMethodConverter(IDeobfuscatorContext deobfuscatorContext, ModuleDefMD module, VmOpCodeHandlerDetector opCodeDetector)
     : base(deobfuscatorContext, module) => this.opCodeDetector = opCodeDetector;
コード例 #4
0
ファイル: Csvm.cs プロジェクト: RafaelRMachado/de4dot
		VmOpCodeHandlerDetector GetVmOpCodeHandlerDetector() {
			var vmFilename = vmAssemblyRef.Name + ".dll";
			var vmModulePath = Path.Combine(Path.GetDirectoryName(module.Location), vmFilename);
			Logger.v("CSVM filename: {0}", vmFilename);

			var dataKey = "cs cached VmOpCodeHandlerDetector v2";
			var dict = (Dictionary<string, VmOpCodeHandlerDetector>)deobfuscatorContext.GetData(dataKey);
			if (dict == null)
				deobfuscatorContext.SetData(dataKey, dict = new Dictionary<string, VmOpCodeHandlerDetector>(StringComparer.OrdinalIgnoreCase));
			VmOpCodeHandlerDetector detector;
			if (dict.TryGetValue(vmModulePath, out detector))
				return detector;
			dict[vmModulePath] = detector = new VmOpCodeHandlerDetector(ModuleDefMD.Load(vmModulePath));

			detector.FindHandlers();
			Logger.v("CSVM opcodes: {0}", detector.Handlers.Count);
			Logger.Instance.Indent();
			for (int i = 0; i < detector.Handlers.Count; i++)
				Logger.v("{0:X4}: {1}", i, detector.Handlers[i]);
			Logger.Instance.DeIndent();

			return detector;
		}