예제 #1
0
        public void ReadEmbeddedResource2Data()
        {
            var module   = ModuleDefinition.FromFile(typeof(TestCaseResources).Assembly.Location);
            var resource = module.Resources.First(r =>
                                                  r.Name == "AsmResolver.DotNet.TestCases.Resources.Resources.EmbeddedResource2");

            Assert.Equal(TestCaseResources.GetEmbeddedResource2Data(), Encoding.ASCII.GetString(resource.GetData()));
        }
        public void ReadEmbeddedResource2Data()
        {
            var image    = PEImage.FromFile(typeof(TestCaseResources).Assembly.Location);
            var metadata = image.DotNetDirectory.Metadata;
            var resource = FindResourceRow(metadata, "AsmResolver.DotNet.TestCases.Resources.Resources.EmbeddedResource2");

            var data = image.DotNetDirectory.DotNetResources.GetManifestResourceData(resource.Offset);

            Assert.Equal(TestCaseResources.GetEmbeddedResource2Data(), Encoding.ASCII.GetString(data));
        }