Unix Programming - Re: overriding functions with functions that call the original

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > March 2006 > Re: overriding functions with functions that call the original





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Re: overriding functions with functions that call the original
Paul Pluzhnikov

2006-03-21, 5:56 pm

Frank Cusack <fcusack@fcusack.com> writes:

>
> Yes he did state that, and that's why I wonder why you'd need to
> dlopen() it.


So that he pass the handle to dlsym().

> If you are *interposing* on (e.g.) open() by using
> LD_PRELOAD, then the original binary is already linked to the library
> containing it, and the runtime linker has already loaded it, and you
> only need to call dlsym(RTLD_NEXT, ...).


Correct. However the OP didn't know (or understand) RTLD_NEXT.

> Even if you are interposing on all functions in a library, doesn't the
> runtime linker open that library anyway?


Yes, the runtime loader will open it anyway (if it is recorded as
DT_NEEDED in the main exe or any of the DSOs the exe depends on).

Cheers,
--
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com