How to browse a C Library with Python

georg.heiss georg.heiss at gmx.de
Fri Dec 7 07:50:34 EST 2007


On 5 Dez., 21:03, "Rafael Sachetto" <rsache... at gmail.com> wrote:
> This could be a solution
>
> import commands
>
> callables = commands.getoutput("nm -D /lib/libc.so.6 | egrep ' T '
> ").split("\n")
> callables = [c.split()[2] for c in callables]
>
> print callables
>
> On Dec 5, 2007 5:26 PM, Rafael Sachetto <rsache... at gmail.com> wrote:
>
>
>
>
>
> > > > with Python it is simple to call direct functions from c-librarys.
> > > > Is there a way to browse over alibraryi.e. '/lib/libc.so' with
> > > > python, to see all possible functions in alibrary?
>
> > > You could use the subprocess module to execute 'nm /lib/libc.so' and look
> > > at lines with type T.
>
> > To do this on a dynamiclibraryyou have to use nm -D /lib/libc.so
>
> > --
> > Rafael Sachetto Oliveira
>
> > Sir - Simple Image Resizer
> >http://rsachetto.googlepages.com
>
> --
> Rafael Sachetto Oliveira
>
> Sir - Simple Image Resizerhttp://rsachetto.googlepages.com- Zitierten Text ausblenden -
>
> - Zitierten Text anzeigen -

works fine ..., thanks a lot georg



More information about the Python-list mailing list