Esempio n. 1
0
        public void GetContainingSectionIndex()
        {
            var peHeaders = new PEReader(SynthesizedPeImages.Image1).PEHeaders;

            Assert.Equal(-1, peHeaders.GetContainingSectionIndex(0));
            Assert.Equal(-1, peHeaders.GetContainingSectionIndex(0x200 - 1));
            Assert.Equal(0, peHeaders.GetContainingSectionIndex(0x200));
            Assert.Equal(1, peHeaders.GetContainingSectionIndex(0x400));
            Assert.Equal(2, peHeaders.GetContainingSectionIndex(0x600));
            Assert.Equal(2, peHeaders.GetContainingSectionIndex(0x600 + 9));
            Assert.Equal(-1, peHeaders.GetContainingSectionIndex(0x600 + 10));
        }
Esempio n. 2
0
        public void GetContainingSectionIndex()
        {
            var peHeaders = new PEReader(SynthesizedPeImages.Image1).PEHeaders;

            Assert.Equal(-1, peHeaders.GetContainingSectionIndex(0));
            Assert.Equal(-1, peHeaders.GetContainingSectionIndex(0x200 - 1));
            Assert.Equal(0, peHeaders.GetContainingSectionIndex(0x200));
            Assert.Equal(1, peHeaders.GetContainingSectionIndex(0x400));
            Assert.Equal(2, peHeaders.GetContainingSectionIndex(0x600));
            Assert.Equal(2, peHeaders.GetContainingSectionIndex(0x600 + 9));
            Assert.Equal(-1, peHeaders.GetContainingSectionIndex(0x600 + 10));
        }