public DynamicSectionRenderer(ElfImageLoader loader, Elf32_SHdr shdr) { this.loader = loader; this.shdr = shdr; }
public void EIL_LoadCellLv2() { var opEl = mr.Stub<OperatingEnvironment>(); var platform = new DefaultPlatform(services, arch); dcSvc.Stub(d => d.GetEnvironment("elf-cell-lv2")).Return(opEl); opEl.Expect(o => o.Load(null, null)).IgnoreArguments().Return(platform); mr.ReplayAll(); var el = new ElfImageLoader(services, "foo", rawImg); el.CreatePlatform(0x66); // ELFOSABI_CELL_LV2; mr.VerifyAll(); }
public RelaSegmentRenderer(ElfImageLoader loader, Elf32_SHdr shdr) { this.loader = loader; this.shdr = shdr; }
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_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_LoadStringTable() { mr.ReplayAll(); var el = new ElfImageLoader(services, "foo", rawImg); el.Load(Address.Ptr32(0)); Assert.AreEqual(".symtab", el.GetSectionName(1)); }
public void EIL_Load() { mr.ReplayAll(); var el = new ElfImageLoader(services, "foo", rawImg); var lr = el.Load(Address.Ptr32(0)); Assert.AreSame(arch, lr.Architecture); }
public Relocator(ElfImageLoader loader) { this.loader = loader; machine = loader.ElfHeader.e_machine; e_type = loader.ElfHeader.e_type; }