binaryninja-api icon indicating copy to clipboard operation
binaryninja-api copied to clipboard

Expose function addresses as symbols to assembler

Open ColdHeat opened this issue 10 years ago • 4 comments

Mac Build 1.0.272 Beta

Helpful for patching.

screen shot 2015-11-10 at 2 30 38 am

ColdHeat avatar Nov 10 '15 07:11 ColdHeat

Thanks -- we've definitely talked about doing that before and have some ideas how to do it, definitely agree it would be super handy.

psifertex avatar Nov 10 '15 18:11 psifertex

To do this, we will need to do some basic parsing of the assembly, replace function names (or other similar stuff), with the actual address and send it to the assembler. Its definitely do-able, just need some time to write the code

jeffli678 avatar Sep 16 '21 10:09 jeffli678

For x86, yasm returns the unknown symbol, and we can replace it with its actual value. For LLVM MC, I am pretty sure the lexer can give us the same or even more information, which enables us to achieve the goal

xusheng6 avatar Feb 03 '23 11:02 xusheng6

It's worth noting that for LLVM MC backends (or at least for AArch64), attempts to use symbols actually just silently fail (and turn into spinning branches) rather than producing an error.

jonpalmisc avatar Aug 09 '24 13:08 jonpalmisc