public static DumpedMethods Decrypt(ServerClrVersion serverVersion, string filename, byte[] moduleCctorBytes) {
			using (var client = new NewProcessAssemblyClientFactory(serverVersion).Create(AssemblyServiceType.MethodDecrypter)) {
				client.Connect();
				client.WaitConnected();
				var info = new DecryptMethodsInfo();
				info.moduleCctorBytes = moduleCctorBytes;
				client.MethodDecrypterService.InstallCompileMethod(info);
				client.MethodDecrypterService.LoadObfuscator(filename);
				return client.MethodDecrypterService.DecryptMethods();
			}
		}
Ejemplo n.º 2
0
 public static DumpedMethods decrypt(string filename, byte[] moduleCctorBytes)
 {
     using (var client = new NewProcessAssemblyClientFactory().create()) {
         client.connect();
         client.waitConnected();
         var info = new DecryptMethodsInfo();
         info.moduleCctorBytes = moduleCctorBytes;
         client.Service.installCompileMethod(info);
         client.Service.loadObfuscator(filename);
         return client.Service.decryptMethods();
     }
 }
		protected override void DecryptInternal() {
			CheckRuntimeFiles();
			IList<DecryptedMethodInfo> decryptedData;
			var serverVersion = NewProcessAssemblyClientFactory.GetServerClrVersion(module);
			using (var client = new NewProcessAssemblyClientFactory(serverVersion).Create(AssemblyServiceType.Generic)) {
				client.Connect();
				client.WaitConnected();

				client.GenericService.LoadUserService(typeof(DynamicMethodsDecrypterService), null);
				client.GenericService.LoadAssembly(module.Location);
				decryptedData = client.GenericService.SendMessage(DynamicMethodsDecrypterService.MSG_DECRYPT_METHODS, new object[] { GetMethodIds() }) as IList<DecryptedMethodInfo>;
			}

			if (decryptedData == null)
				throw new ApplicationException("Unknown return value from dynamic methods decrypter service");

			foreach (var info in decryptedData)
				methodInfos[info.id] = info;
		}