I want to add logging to some function(s) in the shared (.so
) library. (ARM, Android, a mix of Arm and Thumb modes; C++, some functions are virtual and therefore nameless, invoked via VFT.)
Does anyone already have code that does this or almost this? (Adds logging to existing functions.)
(I am thinking about patching at run-time (on-the-fly), but you may suggest something static.)
The procedures usually start with a PUSH
/STM
instruction, but it's difficult to place a branch into just one instruction, at least in the thumb mode.
How do I modify existing procedures?
One more issue is to detect code residing in PLT. How do I detect code in PLT, how do I "dereference" the plt entry?
Related info:
The caching issues are discussed here: Patching ARM7 code during runtime (but no code at the moment).
Qt-specific stuff: http://www.ntcore.com/files/qtrev.htm or (the same) http://www.codeproject.com/Articles/31330/Qt-Internals-Reversing and about Qt signals&slots.
About printing out RTTI (when it's available, of course).
UPD: reDroid: reverse-engineering tools for Android NDK/C++/Qt (source at github).