-
My plugin creates a map of function names to addresses for use by an external simulator when resolving a call instruction to its function name. However, when attempting to get addresses for external functions, i.e., when iterating over function_manager.getExternalFunctions(), the addresses returned by function.getBody() are null. How can I get the address of each external function, i.e., the value in the call instruction? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 2 replies
-
External functions aren't real functions that have a body (as seen by the python snippet above), but they do have an address (entry point) in a fake address space ("EXTERNAL"). The details of how that function work will depend on the binary, could be a thunk, or an indirect pointer, etc. |
Beta Was this translation helpful? Give feedback.
-
I had also tried function.getExternalLocation().getAddress() with no luck. It is not a thunk. |
Beta Was this translation helpful? Give feedback.
-
I had tried variations of that in Java:
But the address offset is always an index value (incrementing integers). Also tried with getExternalSymbol on the SymbolTable. |
Beta Was this translation helpful? Give feedback.
-
try
(where f is the external function, and its entry point is going to be something like EXTERNAL:00000NNN) |
Beta Was this translation helpful? Give feedback.
try
(where f is the external function, and its entry point is going to be something like EXTERNAL:00000NNN)