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); }
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); }
public void OffsetIsBiggerThanBuffer_Test() { var ibr = new IMAGE_BASE_RELOCATION(RawStructures.RawImageBaseRelocation, 1234, 12); }