Thank you @geek1011.
I am making slow progress but I think I'm at a point where I can ask a few questions.
I'm having trouble getting hooks to be established. dlsym grabs are working fine. Here's how I'm configuring.
If I have only the following:
Quote:
typedef QObject OverDriveActionProxy;
void (*OverDriveActionProxy_setShowOverdrive)(OverDrive ActionProxy *_this, bool setShow);
struct nh_dlsym NickelNoteDlsym[] = {
{
.name = "_ZN20OverDriveActionProxy16setShowOverDriveEb ",
.out = nh_symoutptr(OverDriveActionProxy_setShowOverdrive ),
.desc = "OverDriveActionProxy_setShowOverdrive"
},
{0},
};
|
My init call executes fine (I am logging to a text file)
But, when I switch to a hook instead with the following, my init doesn't work anymore.
Quote:
typedef QObject OverDriveActionProxy;
void (*OverDriveActionProxy_setShowOverdrive)(OverDrive ActionProxy *_this, bool setShow);
extern "C" void _always_show_overdrive(OverDriveActionProxy *_this, bool setShow) {
appendToFile(NICKEL_NOTE_DIR "logs.txt", "Intercepted... _always_show_overdrive");
OverDriveActionProxy_setShowOverdrive(_this, setShow);
}
struct nh_hook NickelNoteHook[] = {
{
.sym = "_ZN20OverDriveActionProxy16setShowOverDriveEb ",
.sym_new = "_always_show_overdrive",
.lib = "libnickel.so.1.0.0",
.out = nh_symoutptr(OverDriveActionProxy_setShowOverdrive ),
.desc = "Always show overdrive"
},
{0}
};
|
There's literally nothing in the code apart from the NickelHook macro, init and uninstall calls, and I think my function signatures are right. Do you see anything out of place here?
Thanks