Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How to get software (exe, dll) Version info from a buffer?

How to get software (exe, dll) Version info from a buffer?

Scheduled Pinned Locked Moved C / C++ / MFC
performancetutorialquestionannouncement
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    includeh10
    wrote on last edited by
    #1

    an exe or dll is in memory buffer downloaded from website. How to get the exe or dll version info from memory buffer directly? I don't want to save it then retrieve version info from the saved file. Is it possible? How?

    O J 2 Replies Last reply
    0
    • I includeh10

      an exe or dll is in memory buffer downloaded from website. How to get the exe or dll version info from memory buffer directly? I don't want to save it then retrieve version info from the saved file. Is it possible? How?

      O Offline
      O Offline
      Orjan Westin
      wrote on last edited by
      #2

      Yes, it is possible, but quite fiddly. If it's at all possible to save the files and using the Windows API function GetFileVersionInfo I recommend doing that. If not, you can dig into the details of "PE", or the Win32 Portable Executable File Format which describes where to find the version information, among many other things. It's quite a hassle though.

      1 Reply Last reply
      0
      • I includeh10

        an exe or dll is in memory buffer downloaded from website. How to get the exe or dll version info from memory buffer directly? I don't want to save it then retrieve version info from the saved file. Is it possible? How?

        J Offline
        J Offline
        j_schultz
        wrote on last edited by
        #3

        There is probably some C/C++ code that does this, but so far I have only seen an implementation in PHP. Maybe you could just translate this to C/C++.

        D 1 Reply Last reply
        0
        • J j_schultz

          There is probably some C/C++ code that does this, but so far I have only seen an implementation in PHP. Maybe you could just translate this to C/C++.

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          j_schultz wrote:

          ...so far I have only seen an implementation in PHP.

          Which requires the info to be on disk, yes?

          "One man's wage rise is another man's price increase." - Harold Wilson

          "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

          "Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather

          J 1 Reply Last reply
          0
          • D David Crow

            j_schultz wrote:

            ...so far I have only seen an implementation in PHP.

            Which requires the info to be on disk, yes?

            "One man's wage rise is another man's price increase." - Harold Wilson

            "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

            "Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather

            J Offline
            J Offline
            j_schultz
            wrote on last edited by
            #5

            It should be simple to rewrite the implementation to work with normal memory chunks instead of real files - as the downloaded file should be in some kind of byte array, you can emulate the fseek / etc. calls by simply advancing a pointer in this array.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups