Beispiel #1
0
        void restore2()
        {
            Log.v("Restoring CSVM methods");
            Log.indent();

            var opcodeDetector = getVmOpCodeHandlerDetector();
            var csvmMethods    = new CsvmDataReader(resource.GetResourceStream()).read();
            var converter      = new CsvmToCilMethodConverter(deobfuscatorContext, module, opcodeDetector);
            var methodPrinter  = new MethodPrinter();

            foreach (var csvmMethod in csvmMethods)
            {
                var cilMethod = module.LookupToken(csvmMethod.Token) as MethodDefinition;
                if (cilMethod == null)
                {
                    throw new ApplicationException(string.Format("Could not find method {0:X8}", csvmMethod.Token));
                }
                converter.convert(cilMethod, csvmMethod);
                Log.v("Restored method {0:X8}", cilMethod.MetadataToken.ToInt32());
                printMethod(methodPrinter, cilMethod);
            }
            Log.deIndent();
        }
Beispiel #2
0
        void restore2()
        {
            Log.v("Restoring CSVM methods");
            Log.indent();

            var opcodeDetector = getVmOpCodeHandlerDetector();
            var csvmMethods = new CsvmDataReader(resource.GetResourceStream()).read();
            var converter = new CsvmToCilMethodConverter(deobfuscatorContext, module, opcodeDetector);
            var methodPrinter = new MethodPrinter();
            foreach (var csvmMethod in csvmMethods) {
                var cilMethod = module.LookupToken(csvmMethod.Token) as MethodDefinition;
                if (cilMethod == null)
                    throw new ApplicationException(string.Format("Could not find method {0:X8}", csvmMethod.Token));
                converter.convert(cilMethod, csvmMethod);
                Log.v("Restored method {0:X8}", cilMethod.MetadataToken.ToInt32());
                printMethod(methodPrinter, cilMethod);
            }
            Log.deIndent();
        }