HexHive / retrowrite

RetroWrite -- Retrofitting compiler passes through binary rewriting
Other
655 stars 78 forks source link

LLVM IR Corpus leads to cases where functions are not disassembled. #22

Open Liblor opened 3 years ago

Liblor commented 3 years ago

Hi,

As you may know, I developed a tool that creates an LLVM IR corpus for my master thesis @ HexHive :)

Some generated snippets resulted in an assertion error, I didn't have time to analyse the issue yet, so it might not be in scope of retrowrite.

Files to reproduce: reproducible.tar.gz

$ clang -O2 -fPIE -fPIC -pie 1198a663f254851c2086795b4c8c54b50e067d7c_SCCP3633_2.c 1198a663f254851c2086795b4c8c54b50e067d7c.ll -o out
$ retrowrite out out.s
[*] Relocations for a section that's not loaded: .rela.dyn
[*] Relocations for a section that's not loaded: .rela.plt
[x] Could not replace value in .init_array
[x] Couldn't find valid section 3de8
[x] Couldn't find valid section 3fd8
[x] Couldn't find valid section 3fe0
[x] Couldn't find valid section 3fe8
[x] Couldn't find valid section 3ff0
[x] Couldn't find valid section 3ff8
Traceback (most recent call last):
  File "path/to/retrowrite/retro/bin/retrowrite", line 176, in <module>
    rw.dump()
  File "path/to/retrowrite/librw/rw.py", line 73, in dump
    results.append("\t.text\n%s" % (function))
  File "path/to/retrowrite/librw/container.py", line 172, in __str__
    assert self.cache, "Function not disassembled!"
AssertionError: Function not disassembled!
diagprov commented 2 years ago

See also #23