Reputation: 47
I need to find address of a static function in a linux library for hooking.
I tried using dlopen() and dlsym() but it didn't work.
Is there any way to find it? Or how to iterate through library's memory so I can do a pattern scanning?
Upvotes: 2
Views: 632
Reputation: 2433
Unless there is an entry in the library's export table, you will have to do some reverse engineering to discover where it is (if it was compiled as what could be identified as a single function in the first place, that is).
Unfortunately, there seems to be no such entry. If you have the source code, you could try compiling just that function into a separate binary using your best guess for whatever options were used with the module of interest -- at least you'd have a pattern to try matching.
Upvotes: 1