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); }
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); }