[DynInst_API:] Binary Rewriting using wrapFunction


Date: Sun, 14 Dec 2014 23:04:58 +0100
From: Sergej Proskurin <prosig@xxxxxxx>
Subject: [DynInst_API:] Binary Rewriting using wrapFunction
Hello,

currently, I am developing a software that should be able to rewrite
binaries (as the name suggests, the process of rewriting should be
performed statically). One of the goals I am trying to achieve, is to
wrap library function calls with custom implementations.

To achieve this, I am using the function:
BPatch_addressSpace::wrapFunction(...)

This works fine for functions compiled statically into binary objects.
However, I have encountered the issue that the wrapping of dynamically
loaded functions (such as printf) works only dynamically. This means, if
the binary object is opened with BPatch_addressSpace::openBinary(...),
it will not create persistent wrappers for dynamic library function
calls within the binary object on BPatch_binaryEdit::writeFile(...).

Is there any way to manipulate the ELF file by using the tools provided
by Dyninst so that the binary will behave as presented? Thank you very
much in advance.

Best regards,
Sergej
[← Prev in Thread] Current Thread [Next in Thread→]