Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

How to disable a DLLs init() when using dlopen() ?
I have a shared lib I'm opening with dlopen() but do not have access
to its source code.  It automatically executes an init fn on loading
(and fini() in exiting) which do stuff I want to disable.  Is there
any way to do this programatically?

Thanks
AB

Report this thread to moderator Post Follow-up to this message
Old Post
Adrian B.
07-29-04 01:57 PM


Re: How to disable a DLLs init() when using dlopen() ?
borg@swirve.com (Adrian B.) writes:

> I have a shared lib I'm opening with dlopen() but do not have access
> to its source code.  It automatically executes an init fn on loading
> (and fini() in exiting) which do stuff I want to disable.  Is there
> any way to do this programatically?

You could use objcopy to rename those symbols to something harmless.

--
Måns Rullgård
mru@kth.se

Report this thread to moderator Post Follow-up to this message
Old Post
Måns Rullgård
07-29-04 01:57 PM


Re: How to disable a DLLs init() when using dlopen() ?
Måns Rullgård <mru@kth.se> writes:

> borg@swirve.com (Adrian B.) writes:
> 

No, not really.

> You could use objcopy to rename those symbols to something harmless.

At least on ELF systems, these symbols are not referenced by the
dynamic loader "by name"; rather their address is recorded in the
the PT_DYNAMIC header as DT_INIT and DT_FINI at link time.

Renaming the _init/_fini will not do the OP any good.

OTOH, binary-editing the .dynamic section and setting DT_INIT/DT_FINI
to some other "harmless" address should do the trick.

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

Report this thread to moderator Post Follow-up to this message
Old Post
Paul Pluzhnikov
07-30-04 08:57 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Unix Programming archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 04:27 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.