当前位置: 首页>>代码示例>>C#>>正文


C# EmbeddedResource.GetResourceData方法代码示例

本文整理汇总了C#中Mono.Cecil.EmbeddedResource.GetResourceData方法的典型用法代码示例。如果您正苦于以下问题:C# EmbeddedResource.GetResourceData方法的具体用法?C# EmbeddedResource.GetResourceData怎么用?C# EmbeddedResource.GetResourceData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Mono.Cecil.EmbeddedResource的用法示例。


在下文中一共展示了EmbeddedResource.GetResourceData方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: decrypt

 public byte[] decrypt(EmbeddedResource resource)
 {
     if (!CanDecrypt)
         throw new ApplicationException("Can't decrypt resources");
     var encryptedData = resource.GetResourceData();
     return decrypt(encryptedData);
 }
开发者ID:ostuda,项目名称:de4dot,代码行数:7,代码来源:ResourceDecrypter.cs

示例2: initialize

        public void initialize(ISimpleDeobfuscator simpleDeobfuscator, IDeobfuscator deob)
        {
            if (methodsDecrypter == null)
                return;

            encryptedResource = BabelUtils.findEmbeddedResource(module, methodsDecrypter, simpleDeobfuscator, deob);
            if (encryptedResource == null) {
                Log.w("Could not find encrypted methods resource");
                return;
            }

            addImageReader("", new ResourceDecrypter(module).decrypt(encryptedResource.GetResourceData()));
        }
开发者ID:huliang,项目名称:de4dot,代码行数:13,代码来源:MethodsDecrypter.cs

示例3: decryptResourceV3

 protected static byte[] decryptResourceV3(EmbeddedResource resource)
 {
     return decryptResourceV3(resource.GetResourceData());
 }
开发者ID:Predator75,项目名称:de4dot,代码行数:4,代码来源:ResolverBase.cs

示例4: ShowBinary

 public void ShowBinary(EmbeddedResource er, bool showingGridBinary)
 {
     ShowBinary(er.GetResourceData(), showingGridBinary);
 }
开发者ID:adisik,项目名称:simple-assembly-explorer,代码行数:4,代码来源:ClassEditResourceHandler.cs

示例5: decryptResourceV41SL

 protected static byte[] decryptResourceV41SL(EmbeddedResource resource)
 {
     var data = resource.GetResourceData();
     byte k = data[0];
     for (int i = 0; i < data.Length - 1; i++)
         data[i + 1] ^= (byte)((k << (i & 5)) + i);
     return inflateIfNeeded(data, 1, data.Length - 1);
 }
开发者ID:huliang,项目名称:de4dot,代码行数:8,代码来源:ResolverBase.cs

示例6: initialize

        public void initialize(ISimpleDeobfuscator simpleDeobfuscator, IDeobfuscator deob)
        {
            if (methodsDecrypter == null)
                return;

            encryptedResource = BabelUtils.findEmbeddedResource(module, methodsDecrypter, simpleDeobfuscator, deob);
            if (encryptedResource != null)
                addImageReader("", resourceDecrypter.decrypt(encryptedResource.GetResourceData()));
        }
开发者ID:Joelone,项目名称:de4dot,代码行数:9,代码来源:MethodsDecrypter.cs

示例7: SaveResourceFile

        private void SaveResourceFile(EmbeddedResource er, string outputFile)
        {
            byte[] bytes = er.GetResourceData();
            using (FileStream fs = File.Create(outputFile))
            {
                fs.Write(bytes, 0, bytes.Length);
            }
            _form.SetStatusText(String.Format("{0} saved.", outputFile));

            if (PathUtils.IsResourceExt(outputFile))
            {
                using (ResourceReader rr = new ResourceReader(er.GetResourceStream()))
                {
                    string resxFile = Path.ChangeExtension(outputFile, ".resx");
                    using (ResXResourceWriter xw = new ResXResourceWriter(resxFile))
                    {
                        IDictionaryEnumerator de = rr.GetEnumerator();
                        while (de.MoveNext())
                        {
                            bool handled = false;
                            if (de.Value != null)
                            {
                                Type type = de.Value.GetType();
                                if (type.FullName.EndsWith("Stream"))
                                {
                                    Stream s = de.Value as Stream;
                                    if (s != null)
                                    {
                                        byte[] tmpBytes = new byte[s.Length];
                                        if (s.CanSeek) s.Seek(0, SeekOrigin.Begin);
                                        s.Read(tmpBytes, 0, tmpBytes.Length);
                                        xw.AddResource(de.Key.ToString(), new MemoryStream(tmpBytes));
                                        handled = true;
                                    }
                                }
                            }
                            if (handled) continue;
                            xw.AddResource(de.Key.ToString(), de.Value);
                        }
                    }
                }
            }
            else if (PathUtils.IsBamlExt(outputFile))
            {
                try
                {
                    using (StreamWriter sw = File.CreateText(Path.ChangeExtension(outputFile, ".xaml")))
                    {
                        sw.WriteLine(_form.ResourceHandler.DecompileBaml(new MemoryStream(bytes)));
                    }
                }
                catch (Exception ex)
                {
                    _form.SetStatusText(String.Format("Failed to translate {0}: {1}", er.Name, ex.Message));
                }
            }
        }
开发者ID:adisik,项目名称:simple-assembly-explorer,代码行数:57,代码来源:ClassEditTreeViewHandler.cs

示例8: initialize

        public void initialize(ISimpleDeobfuscator simpleDeobfuscator, IDeobfuscator deob)
        {
            if (resolverType == null)
                return;

            encryptedResource = BabelUtils.findEmbeddedResource(module, resolverType, simpleDeobfuscator, deob);
            if (encryptedResource == null) {
                Log.w("Could not find embedded assemblies resource");
                return;
            }

            var decrypted = resourceDecrypter.decrypt(encryptedResource.GetResourceData());
            var reader = new BinaryReader(new MemoryStream(decrypted));
            int numAssemblies = reader.ReadInt32();
            embeddedAssemblyInfos = new EmbeddedAssemblyInfo[numAssemblies];
            for (int i = 0; i < numAssemblies; i++) {
                string name = reader.ReadString();
                var data = reader.ReadBytes(reader.ReadInt32());
                var mod = ModuleDefinition.ReadModule(new MemoryStream(data));
                embeddedAssemblyInfos[i] = new EmbeddedAssemblyInfo(name, DeobUtils.getExtension(mod.Kind), data);
            }
        }
开发者ID:Joelone,项目名称:de4dot,代码行数:22,代码来源:AssemblyResolver.cs

示例9: initialize

 public void initialize(ModuleDefinition module, EmbeddedResource resource)
 {
     var decrypted = resourceDecrypter.decrypt(resource.GetResourceData());
     var reader = new BinaryReader(new MemoryStream(decrypted));
     while (reader.BaseStream.Position < reader.BaseStream.Length)
         offsetToString[getOffset((int)reader.BaseStream.Position)] = reader.ReadString();
 }
开发者ID:Joelone,项目名称:de4dot,代码行数:7,代码来源:StringDecrypter.cs


注:本文中的Mono.Cecil.EmbeddedResource.GetResourceData方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。