API NEEDED! - Extracting version numbers from Linux programs

API NEEDED! - Extracting version numbers from Linux programs

Post by Brian Krispinsk » Wed, 16 Jun 1999 04:00:00



Does Linux have an API for extracting the version number resource string
from binaries? If not, is there a standard offset where program version may
be found in compiled executables?
                                        TIA - Brian
(please CC to email.)

--
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ Brian C. Krispinsky                                        +
+ Developmental Consultant                                   +
+                                                            +
+ DPI, Inc.                 http://www.dpinnovator.com       +
+ 3201 North 16th St.       http://www.abacusnet.net/sargoth +  
+ Phoenix, AZ 85016 USA     ICQ# 35928113                    +
+ (602)279-4269                                              +
+                                                            +
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

 
 
 

API NEEDED! - Extracting version numbers from Linux programs

Post by Jürgen Exne » Wed, 16 Jun 1999 04:00:00



Quote:> Does Linux have an API for extracting the version number resource string
> from binaries? If not, is there a standard offset where program version
may
> be found in compiled executables?

Where do you find a "resource string" in UNIX programs?
And until now I didn't know, that a "hello world" program has a version
number.

jue
--
Jrgen Exner

 
 
 

API NEEDED! - Extracting version numbers from Linux programs

Post by Jeffrey L Straszhei » Wed, 16 Jun 1999 04:00:00





> > Does Linux have an API for extracting the version number resource string
> > from binaries? If not, is there a standard offset where program version
> may
> > be found in compiled executables?
> Where do you find a "resource string" in UNIX programs?
> And until now I didn't know, that a "hello world" program has a version
> number.

Hehe :) "Hello world" is on version 12393.0.3 now, I think.

Here is a more friendly translation:

There is no concept of a "resource string" for unix and thus no standard
way to extract one. Also, unix folks don't tend to use the term "API",
although it certainly isn't a bad term in any essential way, it will
label you as a "newbie from M$ land". Whether you want that image is
up to you :)

That all being said, most well behaved unix apps will accept a command
line argument --version (sometimes with one dash) which will display the
version of the app on stdout and then terminate. For example:

$gcc --version
egcs-2.91.66.1

$eiffel -version
-- SmallEiffel The GNU Eiffel Compiler -- Release (- 0.78)      --
-- Copyright (C), 1994-98 - LORIA - UHP - CRIN - INRIA - FRANCE --

--                  http://SmallEiffel.loria.fr/                --

Now if we could only get all these pesky programmers to agree on the
number of dashes...

-- Jeffrey Straszheim          
-- Systems Engineer, Programmer
-- http://www.shadow.net/~stimuli
-- stimuli AT shadow DOT net

 
 
 

API NEEDED! - Extracting version numbers from Linux programs

Post by Kaz Kylhe » Thu, 17 Jun 1999 04:00:00




Quote:>Does Linux have an API for extracting the version number resource string
>from binaries? If not, is there a standard offset where program version may
>be found in compiled executables?

Linux executables don't have any such thing in them.  Binary resources
are a brain damaged idea that is best left to the Mac and Windows
world.

The sccs revision control system defines a way of embedding static
strings into binary code and provides a tool called what
for extracting the information. It looks for strings that

tools on Linux.

The RCS system (and by incorporation, CVS as well) uses
strings of the form "$Key: ... $" . These can be sought after
using the rcsid command.

With RCS and CVS, one adds keywords to source which are expanded when a file is
retrieved from the repository.  For example:

        $Id: $

expands to something like

    $Id: foo.c,v 1.7 1999/06/09 00:08:28 kaz Exp $

This can be put into a static string literal. Applying the rcsid command to a
binary will extract such strings.

 
 
 

API NEEDED! - Extracting version numbers from Linux programs

Post by Victor Wagn » Thu, 17 Jun 1999 04:00:00


: Does Linux have an API for extracting the version number resource string
: from binaries? If not, is there a standard offset where program version may
: be found in compiled executables?

There is standard utility, named ident, which have desired
functionality. Read its man
--
--------------------------------------------------------

I don't answer questions by private E-Mail from this address.

 
 
 

API NEEDED! - Extracting version numbers from Linux programs

Post by Arnt Gulbrandse » Fri, 18 Jun 1999 04:00:00



Quote:> Does Linux have an API for extracting the version number resource string
> from binaries? If not, is there a standard offset where program version may
> be found in compiled executables?

No.  But you might try ident.

--Arnt

 
 
 

API NEEDED! - Extracting version numbers from Linux programs

Post by James Youngma » Fri, 18 Jun 1999 04:00:00



> The sccs revision control system defines a way of embedding static
> strings into binary code and provides a tool called what
> for extracting the information. It looks for strings that

> tools on Linux.

Actually, they are available from ftp://alpha.gnu.org/pub/gnu/CSSC/.

Quote:> The RCS system (and by incorporation, CVS as well) uses
> strings of the form "$Key: ... $" . These can be sought after
> using the rcsid command.

s/rcsid/ident/

--

 
 
 

API NEEDED! - Extracting version numbers from Linux programs

Post by Brian Krispinsk » Fri, 18 Jun 1999 04:00:00


Quote:> There is no concept of a "resource string" for unix and thus no standard
> way to extract one. Also, unix folks don't tend to use the term "API",
> although it certainly isn't a bad term in any essential way, it will
> label you as a "newbie from M$ land". Whether you want that image is
> up to you :)

WAIT!!!!!

Before you guys start measuring my neck for the gallows, let me explain...

I develop in Java, where API is a totally acceptable and often-used acronym.
If you don't beleive me, check java.sun.com :-)
--
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ Brian C. Krispinsky                                        +
+ Developmental Consultant                                   +
+                                                            +
+ DPI, Inc.                 http://www.dpinnovator.com       +
+ 3201 North 16th St.       http://www.abacusnet.net/sargoth +  
+ Phoenix, AZ 85016 USA     ICQ# 35928113                    +
+ (602)279-4269                                              +
+                                                            +
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

 
 
 

1. Need version number of Linux

Hi all Linux'ers !

I'd really want to know how to read the exact version of Linux (the kernel)...
The FAQ says "uname -a", but that only gives tells me that I'm running
version 1.0, no minor number or patch level.

Could somebody please send me a note and let me know the magic command :-)

/Anders

--
  +-------------------------------------------------------------------------+

  | _  _  _         Phone +46-42-25 73 08, Anders Ostling                   |
  |  \  \  \             IKEA Northern Europe AB, Sweden                    |
  | _/ _/ _/                                                                |
  +-------------------------------------------------------------------------+

2. Problems with RedHat 6.1 update installer

3. HCON API/API programming ...

4. Anyone using Jail in a production environment?

5. Spell checking API - API to ISPELL needed

6. networking

7. checking the version numbers of gnu utilities and other software programs

8. any (new) news: XF86/Rendition?

9. Need good books on Advanced UNIX programming, Standard Unix C APIs

10. Help : Needed API for obtaining system information from C program

11. Need help: Info on Multimedia File Format/ Programming API on UNIX wanted

12. Information needed about Linux > version 0.12 and < Version 0.99

13. Need Latest Version of Linux CD-ROM Version