Esempio n. 1
0
        void Restore2()
        {
            Logger.v("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();
        }
Esempio n. 2
0
		void Restore2() {
			Logger.v("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();
		}