コード例 #1
0
ファイル: ResourceResolver.cs プロジェクト: haise0/de5dot
        public bool MergeResources(out EmbeddedResource rsrc)
        {
            rsrc = null;

            switch (version)
            {
            case ResourceVersion.V3:
                if (data30.resource == null)
                {
                    return(false);
                }

                DeobUtils.DecryptAndAddResources(module, data30.resource.Name.String, () => DecryptResourceV3(data30.resource));
                rsrc = data30.resource;
                return(true);

            case ResourceVersion.V40:
                return(DecryptResource(data40.resourceField, data40.magic));

            case ResourceVersion.V41:
                return(DecryptResource(data41.resourceField, data41.magic));

            default:
                return(true);
            }
        }
コード例 #2
0
 public EmbeddedResource MergeResources()
 {
     if (encryptedResource.Resource == null)
     {
         return(null);
     }
     DeobUtils.DecryptAndAddResources(module, encryptedResource.Resource.Name.String, () => {
         return(QuickLZ.Decompress(encryptedResource.Decrypt()));
     });
     return(encryptedResource.Resource);
 }
コード例 #3
0
        public EmbeddedResource MergeResources()
        {
            if (encryptedResource == null)
            {
                return(null);
            }
            DeobUtils.DecryptAndAddResources(module, encryptedResource.Name.String, () => DecryptResourceAssembly());
            var result = encryptedResource;

            encryptedResource = null;
            return(result);
        }
コード例 #4
0
        public EmbeddedResource MergeResources()
        {
            if (resource == null)
            {
                return(null);
            }
            DeobUtils.DecryptAndAddResources(module, resource.Name.String, () => DecryptResource());
            var tmpResource = resource;

            resource = null;
            return(tmpResource);
        }
コード例 #5
0
        public EmbeddedResource MergeResources()
        {
            if (rsrcResolveMethod == null)
            {
                return(null);
            }
            var resource = DotNetUtils.GetResource(module, DotNetUtils.GetCodeStrings(rsrcResolveMethod)) as EmbeddedResource;

            if (resource == null)
            {
                return(null);
            }
            DeobUtils.DecryptAndAddResources(module, resource.Name.String, () => DecryptResource(resource));
            return(resource);
        }
コード例 #6
0
ファイル: ResourceResolver.cs プロジェクト: haise0/de5dot
        bool DecryptResource(FieldDef resourceField, int magic)
        {
            if (resourceField == null)
            {
                return(false);
            }

            string name = $"Embedded data field {resourceField.MDToken.ToInt32():X8} RVA {(uint)resourceField.RVA:X8}";

            DeobUtils.DecryptAndAddResources(module, name, () => DecryptResourceV4(resourceField.InitialValue, magic));
            resourceField.InitialValue  = new byte[1];
            resourceField.FieldSig.Type = module.CorLibTypes.Byte;
            resourceField.RVA           = 0;
            return(true);
        }
コード例 #7
0
        public List <AssemblyResolver.AssemblyInfo> MergeResources()
        {
            var list = new List <AssemblyResolver.AssemblyInfo>();

            foreach (var asmName in resourceInfos)
            {
                var asmInfo = assemblyResolver.Get(asmName);
                if (asmInfo == null)
                {
                    throw new ApplicationException($"Could not find resource assembly {Utils.ToCsharpString(asmName)}");
                }

                DeobUtils.DecryptAndAddResources(module, asmInfo.ResourceName, () => asmInfo.Data);
                list.Add(asmInfo);
            }
            resourceInfos.Clear();
            return(list);
        }
コード例 #8
0
        public EmbeddedResource MergeResources()
        {
            if (mergedIt)
            {
                return(null);
            }

            var resource = DotNetUtils.GetResource(module, GetResourceNames()) as EmbeddedResource;

            if (resource == null)
            {
                return(null);
            }

            DeobUtils.DecryptAndAddResources(module, resource.Name.String, () => resourceDecrypter.Decrypt(resource.CreateReader().AsStream()));
            mergedIt = true;
            return(resource);
        }
コード例 #9
0
        public EmbeddedAssemblyInfo MergeResources()
        {
            if (mergedIt)
            {
                return(null);
            }

            var info = resourceResolverInfo.ResourceInfo;

            if (info == null)
            {
                return(null);
            }

            DeobUtils.DecryptAndAddResources(module, info.resourceName, () => assemblyResolver.RemoveDecryptedResource(info));
            mergedIt = true;
            return(info);
        }
コード例 #10
0
ファイル: ResourceResolver.cs プロジェクト: haise0/de5dot
 public EmbeddedResource MergeResources()
 {
     if (encryptedResource.Resource == null)
     {
         return(null);
     }
     DeobUtils.DecryptAndAddResources(module, encryptedResource.Resource.Name.String, () => {
         try {
             return(QuickLZ.Decompress(encryptedResource.Decrypt()));
         }
         catch {
             try {
                 return(DeobUtils.Inflate(encryptedResource.Decrypt(), true));
             }
             catch {
                 return(null);
             }
         }
     });
     return(encryptedResource.Resource);
 }