Load() public méthode

public Load ( Address addrLoad ) : Program
addrLoad Address
Résultat Program
Exemple #1
0
        public void EIL_Load()
        {
            mr.ReplayAll();

            var el = new ElfImageLoader(sc, "foo", rawImg);
            el.LoadElfIdentification();
            var lr = el.Load(Address.Ptr32(0));
            Assert.AreSame(arch, lr.Architecture);
        }
        public void EIL_LoadSections()
        {
            mr.ReplayAll();

            var el = new ElfImageLoader(services, "foo", rawImg);
            el.Load(Address.Ptr32(0));

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

            var el = new ElfImageLoader(services, "foo", rawImg);
            el.Load(Address.Ptr32(0));
            el.Dump(Console.Out);
        }
        public void EIL_LoadStringTable()
        {
            mr.ReplayAll();

            var el = new ElfImageLoader(services, "foo", rawImg);
            el.Load(Address.Ptr32(0));
            Assert.AreEqual(".symtab", el.GetSectionName(1));
        }