コード例 #1
0
        void Restore2()
        {
            Logger.n("Restoring CSVM methods");
            Logger.Instance.Indent();

            var opcodeDetector = GetVmOpCodeHandlerDetector();
            var csvmMethods    = new CsvmDataReader(resource.Data).Read();

            var converter     = new CsvmToCilMethodConverter(deobfuscatorContext, module, opcodeDetector);
            var methodPrinter = new MethodPrinter();

            foreach (var csvmMethod in csvmMethods)
            {
                var cilMethod = module.ResolveToken(csvmMethod.Token) as MethodDef;
                if (cilMethod == null)
                {
                    throw new ApplicationException(string.Format("Could not find method {0:X8}", csvmMethod.Token));
                }
                converter.Convert(cilMethod, csvmMethod);
                Logger.v("Restored method {0:X8}", cilMethod.MDToken.ToInt32());
                PrintMethod(methodPrinter, cilMethod);
            }
            Logger.Instance.DeIndent();
            Logger.n("Restored {0} CSVM methods", csvmMethods.Count);
        }
コード例 #2
0
ファイル: Csvm.cs プロジェクト: RafaelRMachado/de4dot
		void Restore2() {
			Logger.n("Restoring CSVM methods");
			Logger.Instance.Indent();

			var opcodeDetector = GetVmOpCodeHandlerDetector();
			var csvmMethods = new CsvmDataReader(resource.Data).Read();

			var converter = new CsvmToCilMethodConverter(deobfuscatorContext, module, opcodeDetector);
			var methodPrinter = new MethodPrinter();
			foreach (var csvmMethod in csvmMethods) {
				var cilMethod = module.ResolveToken(csvmMethod.Token) as MethodDef;
				if (cilMethod == null)
					throw new ApplicationException(string.Format("Could not find method {0:X8}", csvmMethod.Token));
				converter.Convert(cilMethod, csvmMethod);
				Logger.v("Restored method {0:X8}", cilMethod.MDToken.ToInt32());
				PrintMethod(methodPrinter, cilMethod);
			}
			Logger.Instance.DeIndent();
			Logger.n("Restored {0} CSVM methods", csvmMethods.Count);
		}