views:

56

answers:

4

I have a copy of the expat XML processing library on an embedded system running busybox 0.61. I need to find out the version of the library, but I don't have the 'strings' or 'what' applications on the image, nor can I recompile the image. These busybox images that I'm forced to use a grossly impaired.

Is there any way for me to find out what version of the expat library is installed without the 'strings' or 'what' utilities ? The library is shared (libexpat.so.1)

+1  A: 

You will have to write your own equivalent of 'strings'. Versions aren't part of the elf format. Some libraries happen to contain a string with a version, others do not.

For expat in particular you might get a good idea by using nm to see what APIs are present and absent. Programmatically, that'd dlopen and dlsym.

bmargulies
These things don't even have 'nm' on them either, it turns out. Thank you for the suggestion though.
Alex Marshall
+1  A: 

Run ident against the library to find out what version it is. It is similar to strings but it picks out the revision source control library identifiers.

Hope this helps, Best regards, Tom.

tommieb75
A good suggestion, but it turns out I don't have 'ident' either. I'm still discovering just how truly limited these boxes are.
Alex Marshall
+1  A: 

If it is libexpat 1.95.0 or later, the library will have a XML_ExpatVersion() function which returns a char * containing the library version.

Miles
+2  A: 

If this is just a one-time problem, couldn't you copy the library to another machine that has strings installed and run it there?

Ether
Sounds good to me. I've worked with embedded systems where the easiest thing to do is often to `tftp` (dumb UDP-based protocol) files to and from a real workstation.
ephemient
Even using an editor on some stripped-down systems can be painful; particularly if all you have to choose from is `ed` and `joe`. :)
Ether