rainbow icon indicating copy to clipboard operation
rainbow copied to clipboard

elfloader: load shared library and relocate

Open aiooss-ledger opened this issue 3 years ago • 1 comments

Users can already load dynamic ELF using Rainbow elfloader, but no shared library are loaded.

Maybe with some tweaks to the elfloader, we could allow users to load shared library like this:

from rainbow.generics import rainbow_x64

emu = rainbow_x64()
emu.load("main", typ=".elf", verbose=True)
emu.load("/lib/x86_64-linux-gnu/libc.so.6", typ=".elf", base_addr=0x10000, verbose=True)
emu.function_calls = True
emu.start(emu.functions["main"], 0, count=100)

This would be a "low-effort" way to easily instrument dynamic binaries without implementing a dynamic loader in Python. This would reduce the amount of functions to stub to make dynamic binaries work.

aiooss-ledger avatar Jul 15 '22 13:07 aiooss-ledger

Patch proposition: https://github.com/Ledger-Donjon/rainbow/pull/53

erdnaxe avatar Oct 01 '23 12:10 erdnaxe