Newbie: How to read metadata from a windows DLL

Ask a Question related to PERL Modules, Design and Development.

  1. #1

    Default Newbie: How to read metadata from a windows DLL

    Greetings!
    If you will forgive a newbie, I'll try to explain what I want to do.
    (Googling wasn't really successful in this case, since I don't know where to
    begin.)

    My company is making software, and part of the release notes are details
    about the files included in the release, timestamp, version, checksum, and
    so on. This info is gathered in a very manual process:
    In Windows Explorer, highlighting the file, ALT+Enter to bring up a
    "Properties" window.
    In this window, there are tabs, "General","Version", and so on.

    What I would like to do, is to write a quick Perl script that will traverse
    a directory,
    look "inside" each .DLL or what ever type of file, read the metadata
    attributes, and write to a file.

    I am using ActiveState Perl, 5.6.1 on Windows 2000.

    Guess my questions are:
    Is there a Perl module that allows me to read this info from the files?
    What methods to use?
    Examples of code to do this?
    Module to compute checksums?

    Thanks in advance,
    Foz


    Frank Foss Guest

  2. Similar Questions and Discussions

    1. Getting Metadata from Photoshop files to be Read in Acrobat
      I'm trying to get metadata from Photoshop it be read by the Read Aloud feature iin Acrobat 7. I can add it in Acrobat, but I want the images...
    2. Read FLV metadata using CF
      Can coldfusion read FLV metadata natively? I need to extract a metadata value and use it to build an XML doc that that then gets passed into the...
    3. how can you read the *metadata* in a doc file using coldfusion please?
      Hi all, Anyone know how to do this? if you right click on a doc file, go to properties and then go to the summary tab, you can find information...
    4. using coldfusion to read the *metadata* from a word .doc file
      Hi all, Anyone know how to do this? if you right click on a doc file, go to properties and then go to the summary tab, you can find information...
    5. newbie: cgi,read URI
      Hello Newsgroup, i´m a newbie and work on a ruby 1.8, an apache 1.3, modruby and eruby and use it in the cgi-version i just want to get the...
  3. #2

    Default Re: Newbie: How to read metadata from a windows DLL

    Frank Foss wrote:

    (snipped)
    > What I would like to do, is to write a quick Perl script that will traverse
    > a directory, look "inside" each .DLL or what ever type of file, read the metadata
    > attributes, and write to a file.

    You will do better, as a software writer, to learn about
    writing software. It is clear you do not hold enough
    knowledge to tackle this task.

    Windows dll files appear as three basic types, with a number
    of variations on each. Should you elect to research and read,
    elect to learn, you will discover windows dll files can be
    sixteen bit, thirty-two bit Win9.x and thirty-two bit NT types.

    Sixteen bit dll files can be used with FAT32 Win systems.
    NT types, depending on which NT version, can run under
    FAT32 or NTFS file systems, but usually not both.

    There are thousands of gray market (third party) dll files
    which may or may not comply with expected standards, and often
    run under both sixteen bit and thirty-two bit Win systems.
    Many gray market dll files are installed with default Win
    installations. Some gray market dll files are written for
    sixteen bit and thirty-two bit, both Win9x and Win NT.

    Differences here are in how these various dll files are accessed.
    Older sixteen bit, Win9.x 32 bit and gray market sixteen/thirty-two
    bit dll files, usually require a compiled C language executable
    to access information. NT NTFS dll files can be accessed, to a degree,
    with WIN32 API perl modules designed solely for NT.

    Other choices are compiled binaries and Visual Basic scripts, both
    dependent upon Windows version. There are many commercial compiled
    binaries written specifically for working with Win dll files. For
    a low level beginner, such as yourself, your money will be wisely
    invested in the skills of a professional.

    Your Win2k system will include all dll types being NT 5 enhanced
    for limited compatibility with older 16/32 bit DOS software. You
    may or may not be able to access those dll files depending on how
    your Win2k system is installed.

    My suggestion is you hit those "reference books" and learn about
    what you clearly don't know. You will not do well writing software
    based upon this lack of knowledge you display. Personally, I don't
    think you can write any Windows software with your not knowing even
    the simple basics of Win dll files.

    Research, read and learn, or pay a professional to do your work.


    I am curious why you want to pull information for _all_ dll files
    when only a limited number are needed for any given software. You
    are aware of this, yes? I tend to believe you are unaware many
    dll files depend on other dll files which depend on....

    Purl Gurl
    Purl Gurl Guest

  4. #3

    Default Re: Newbie: How to read metadata from a windows DLL

    Frank Foss wrote:

    ....

    > My company is making software, and part of the release notes are details
    > about the files included in the release, timestamp, version, checksum, and
    > so on. This info is gathered in a very manual process:
    > In Windows Explorer, highlighting the file, ALT+Enter to bring up a
    > "Properties" window.
    > In this window, there are tabs, "General","Version", and so on.
    >
    > What I would like to do, is to write a quick Perl script that will traverse
    > a directory,
    > look "inside" each .DLL or what ever type of file, read the metadata
    > attributes, and write to a file.
    >
    > I am using ActiveState Perl, 5.6.1 on Windows 2000.
    >
    > Guess my questions are:
    > Is there a Perl module that allows me to read this info from the files?

    I'm not aware of any, but you might check on CPAN. Maybe something
    like Win32::File::Ver ?

    [url]http://www.cpan.org[/url]

    > What methods to use?
    > Examples of code to do this?
    > Module to compute checksums?

    You might check the Digest::MD5 module.

    >
    ....

    > Foz

    Here is some really kludgy code to return the

    version number of a typical DLL file. It works

    for both 16-bit and 32-bit DLL's, but knows nothing
    of the real file format of a DLL, and could
    conceivably be fooled. This is an excerpt from a
    program I use to look for "DLL Hell" on my computer.
    Start with the full path to the DLL in $fn and the
    base file name in $file:


    open IN,$fn or die "Oops, couldn't open $fn, $!";
    binmode IN;
    $in='';while(read(IN,$a,4000)){$in.=$a}
    close IN;
    if($in=~/\0F\0i\0l\0e\0V\0e\0r\0s\0i\0o\0n\0(.{30})/){
    $ver=$1;
    while($ver=~s/([^\0])\0([^\0])/$1$2/g){};
    $ver=~s/^\0+//;
    $ver=~s/^([^\0]+).*/$1/;
    $file=$file."|$ver";
    }
    elsif($in=~/\0FileVersion\0(.{30})/){
    $ver=$1;
    $ver=~s/^\0+//;
    $ver=~s/^([^\0]+).*/$1/;
    $file=$file."|$ver";
    }
    else{
    $file=$file."|--not specified--";
    }
    print $file;

    You can probably find some more "meta-info" near the places
    where the FileVersion appears. HTH.
    --
    Bob Walton

    Bob Walton Guest

  5. #4

    Default Newbie: How to read metadata from a windows DLL

    Greetings!
    If you will forgive a newbie, I'll try to explain what I want to do.
    (Googling wasn't really successful in this case, since I don't know where to
    begin.)

    My company is making software, and part of the release notes are details
    about the files included in the release, timestamp, version, checksum, and
    so on. This info is gathered in a very manual process:
    In Windows Explorer, highlighting the file, ALT+Enter to bring up a
    "Properties" window.
    In this window, there are tabs, "General","Version", and so on.

    What I would like to do, is to write a quick Perl script that will traverse
    a directory,
    look "inside" each .DLL or what ever type of file, read the metadata
    attributes, and write to a file.

    I am using ActiveState Perl, 5.6.1 on Windows 2000.

    Guess my questions are:
    Is there a Perl module that allows me to read this info from the files?
    What methods to use?
    Examples of code to do this?
    Module to compute checksums?

    Thanks in advance,
    Foz




    Frank Foss Guest

  6. #5

    Default Re: Newbie: How to read metadata from a windows DLL

    Hi Frank,
    > Guess my questions are:
    > Is there a Perl module that allows me to read this info from the files?
    > What methods to use?
    > Examples of code to do this?
    > Module to compute checksums?
    >
    CPAN is your friend ;)
    checkout
    Win32/File/Ver version 0.01

    I hope this helps

    Mothra


    Mothra Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139