The IMAGE_BASE_RELOCATION structure holds information needed to relocate the image to another virtual address.
Inheritance: AbstractStructure
コード例 #1
0
        public void ImageBaseRelocationConstructorWorks_Test()
        {
            var ibr = new IMAGE_BASE_RELOCATION(RawStructures.RawImageBaseRelocation, 2, 12);

            Assert.AreEqual((uint) 0x10000, ibr.VirtualAddress);
            Assert.AreEqual((uint) 0xc, ibr.SizeOfBlock);
            Assert.AreEqual(2, ibr.TypeOffsets.Length);
            Assert.AreEqual(0x2211 >> 12, ibr.TypeOffsets[0].Type);
            Assert.AreEqual(0x2211 & 0xfff, ibr.TypeOffsets[0].Offset);
            Assert.AreEqual(0x4433 >> 12, ibr.TypeOffsets[1].Type);
            Assert.AreEqual(0x4433 & 0xfff, ibr.TypeOffsets[1].Offset);
        }
コード例 #2
0
 public void SizeOfBlockIsBiggerThanRelocDirSize_Test()
 {
     var rawImageBaseRelocBroken = new byte[]
     {0x00, 0x00, 0x01, 0x00, 0x60, 0x00, 0x00, 0x00, 0x60, 0x30, 0xC4, 0x30};
     var ibr = new IMAGE_BASE_RELOCATION(rawImageBaseRelocBroken, 0, 0);
 }
コード例 #3
0
 public void OffsetIsBiggerThanBuffer_Test()
 {
     var ibr = new IMAGE_BASE_RELOCATION(RawStructures.RawImageBaseRelocation, 1234, 12);
 }