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)); }