Esempio n. 1
0
    def test_add_reloc(self):
        ef = UnpreparedElfFile()
        ef.wordsize = 32
        reloc_sect = UnpreparedElfReloc(ef)
        for offset in range(0, 0x10000, 0x1000):
            reloc = ElfReloc(offset)
            reloc_sect.add_reloc(reloc)

        # we expect to have the relocs we added
        self.assertEqual(len(reloc_sect.relocs), 16)
Esempio n. 2
0
    def test_empty_reloca(self):
        ef = UnpreparedElfFile()
        ef.wordsize = 32
        reloc_sect = UnpreparedElfReloc(ef)

        self.assertEqual(reloc_sect.get_size(), 0)