protected override bool CheckHandlerMethod(MethodDef method) {
			if (!method.IsStatic || !method.HasBody)
				return false;

			EmbeddedAssemblyInfo info = null;
			var instructions = method.Body.Instructions;
			for (int i = 0; i < instructions.Count; i++) {
				var instrs = DotNetUtils.GetInstructions(instructions, i, OpCodes.Ldstr, OpCodes.Call);
				if (instrs == null)
					continue;

				var s = instrs[0].Operand as string;
				var calledMethod = instrs[1].Operand as IMethod;
				if (s == null || calledMethod == null)
					continue;

				info = assemblyResolverInfo.Find(Utils.GetAssemblySimpleName(s));
				if (info != null)
					break;
			}
			if (info == null)
				return false;

			resourceInfo = info;
			Logger.v("Found embedded assemblies resource {0}", Utils.ToCsharpString(info.resourceName));
			return true;
		}
        public static EmbeddedAssemblyInfo create(ModuleDefMD module, string encName, string rsrcName)
        {
            var info = new EmbeddedAssemblyInfo();

            try {
                if (encName == "" || Convert.ToBase64String(Convert.FromBase64String(encName)) != encName)
                    return null;
            }
            catch (FormatException) {
                return null;
            }

            if (rsrcName.Length > 0 && rsrcName[0] == '[') {
                int i = rsrcName.IndexOf(']');
                if (i < 0)
                    return null;
                info.flags = rsrcName.Substring(1, i - 1);
                info.isTempFile = info.flags.IndexOf('t') >= 0;
                info.isCompressed = info.flags.IndexOf('z') >= 0;
                rsrcName = rsrcName.Substring(i + 1);
            }
            if (rsrcName == "")
                return null;

            info.assemblyName = Encoding.UTF8.GetString(Convert.FromBase64String(encName));
            info.resourceName = rsrcName;
            info.resource = DotNetUtils.getResource(module, rsrcName) as EmbeddedResource;
            info.simpleName = Utils.getAssemblySimpleName(info.assemblyName);

            return info;
        }
		public byte[] RemoveDecryptedResource(EmbeddedAssemblyInfo info) {
			if (info == null)
				return null;

			var data = DecryptResource(info);
			if (!assemblyResolverInfo.RemoveEmbeddedAssemblyInfo(info))
				throw new ApplicationException(string.Format("Could not remove resource {0}", Utils.ToCsharpString(info.resourceName)));
			return data;
		}
 byte[] decryptResource(EmbeddedAssemblyInfo info)
 {
     if (info.isCompressed)
         return resourceDecrypter.decrypt(info.resource);
     else
         return info.resource.GetResourceData();
 }
 public bool canDecryptResource(EmbeddedAssemblyInfo info)
 {
     if (info == null || !info.isCompressed)
         return true;
     return resourceDecrypter.CanDecrypt;
 }
 public bool removeEmbeddedAssemblyInfo(EmbeddedAssemblyInfo info)
 {
     bool removed = false;
     for (int i = 0; i < EmbeddedAssemblyInfos.Count; i++) {
         var other = EmbeddedAssemblyInfos[i];
         if (info.simpleName == other.simpleName) {
             EmbeddedAssemblyInfos.RemoveAt(i--);
             removed = true;
         }
     }
     return removed;
 }