CreateLoader() public method

public CreateLoader ( ) : Reko.ImageLoaders.Elf.ElfLoader
return Reko.ImageLoaders.Elf.ElfLoader
Exemplo n.º 1
0
        public void EIL_LoadCellLv2()
        {
            var opEl = mr.Stub<OperatingEnvironment>();
            var platform = new DefaultPlatform(sc, arch);
            cfgSvc.Stub(d => d.GetEnvironment("elf-cell-lv2")).Return(opEl);
            opEl.Expect(o => o.Load(null, null)).IgnoreArguments().Return(platform);
            mr.ReplayAll();
            
            var eil = new ElfImageLoader(sc, "foo", rawImg);
            eil.LoadElfIdentification();
            var el = eil.CreateLoader();
            el.LoadPlatform(0x66, arch);        // ELFOSABI_CELL_LV2;

            mr.VerifyAll();
        }
Exemplo n.º 2
0
        public void EIL_LoadSections()
        {
            mr.ReplayAll();

            var eil = new ElfImageLoader(sc, "foo", rawImg);
            eil.LoadElfIdentification();
            var el = (ElfLoader32)eil.CreateLoader();
            el.LoadSectionHeaders();

            Assert.AreEqual("", el.Sections[0].Name);
            Assert.AreEqual(".interp", el.Sections[1].Name);
            Assert.AreEqual(".note.ABI-tag", el.Sections[2].Name);
            Assert.AreEqual(".hash", el.Sections[3].Name);
            Assert.AreEqual(".dynsym", el.Sections[4].Name);
            Assert.AreEqual(".dynstr", el.Sections[5].Name);
            Assert.AreEqual(".gnu.version", el.Sections[6].Name);
            Assert.AreEqual(".gnu.version_r", el.Sections[7].Name);
            Assert.AreEqual(".rel.dyn", el.Sections[8].Name);
            Assert.AreEqual(".rel.plt", el.Sections[9].Name);
            Assert.AreEqual(".init", el.Sections[10].Name);
            Assert.AreEqual(".plt", el.Sections[11].Name);
            Assert.AreEqual(".text", el.Sections[12].Name);
            Assert.AreEqual(".fini", el.Sections[13].Name);
            Assert.AreEqual(".rodata", el.Sections[14].Name);
            Assert.AreEqual(".eh_frame", el.Sections[15].Name);
            Assert.AreEqual(".ctors", el.Sections[16].Name);
            Assert.AreEqual(".dtors", el.Sections[17].Name);
            Assert.AreEqual(".jcr", el.Sections[18].Name);
            Assert.AreEqual(".dynamic", el.Sections[19].Name);
            Assert.AreEqual(".got", el.Sections[20].Name);
            Assert.AreEqual(".got.plt", el.Sections[21].Name);
            Assert.AreEqual(".data", el.Sections[22].Name);
            Assert.AreEqual(".bss", el.Sections[23].Name);
            Assert.AreEqual(".comment", el.Sections[24].Name);
            Assert.AreEqual(".shstrtab", el.Sections[25].Name);
            Assert.AreEqual(".symtab", el.Sections[26].Name);
            Assert.AreEqual(".strtab", el.Sections[27].Name);
        }
Exemplo n.º 3
0
        public void EIL_LoadProgramHeaders()
        {
            mr.ReplayAll();

            var eil = new ElfImageLoader(sc, "foo", rawImg);
            eil.LoadElfIdentification();
            var el = (ElfLoader32)eil.CreateLoader();
            el.LoadProgramHeaderTable();
            el.LoadSectionHeaders();
            //el.Dump(Console.Out);

            mr.VerifyAll();
        }
Exemplo n.º 4
0
        public void EIL_LoadStringTable()
        {
            mr.ReplayAll();

            var eil = new ElfImageLoader(sc, "foo", rawImg);
            eil.LoadElfIdentification();
            var el = (ElfLoader32)eil.CreateLoader();
            el.LoadSectionHeaders();
        }