Exemple #1
0
 public void Hunk_LoadFile()
 {
     var bytes = File.ReadAllBytes(
         FileUnitTester.MapTestPath("../UnitTests/Arch/M68k/images/FIBO"));
     var ldr = new HunkLoader(null, "FIBO", bytes);
     ldr.Load(Address.Ptr32(0x10000)); 
 }
Exemple #2
0
 public void Hunk_LoadEmpty()
 {
     var bytes = mh.MakeBytes(
         HunkType.HUNK_HEADER,
         "",
         0,
         0,
         0,
         0);
     var ldr = new HunkLoader(null, "foo.bar", bytes);
     var ldImg = ldr.Load(Address.Ptr32(0x00010000));
     Assert.AreEqual(1, ldImg.ImageMap.Segments.Count);
     Assert.AreEqual(Address.Ptr32(0x00010000), ldImg.ImageMap.Segments.Values[0].Address);
 }
Exemple #3
0
        public void Hunk_LoadCode()
        {
            var bytes = mh.MakeBytes(
                HunkType.HUNK_HEADER,
                "CODE",
                "",
                1,
                0,
                0,
                0x40,
                HunkType.HUNK_CODE,
                1,
                (ushort) 0x4E75,
                (ushort) 0,
                HunkType.HUNK_END);
            var ldr = new HunkLoader(null, "foo.bar", bytes);
            var ldImg = ldr.Load(Address.Ptr32(0x00010000));
            var rlImg = ldr.Relocate(Address.Ptr32(0x00010000));
            Assert.AreEqual(1, rlImg.EntryPoints.Count);
            Assert.AreEqual(0x00010000ul, rlImg.EntryPoints[0].Address.ToLinear());

        }