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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Unpack Files to memory and then run them (like thinstall)

Unpack Files to memory and then run them (like thinstall)

Scheduled Pinned Locked Moved C / C++ / MFC
performancehelpquestion
9 Posts 5 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.
  • N Offline
    N Offline
    Nemok
    wrote on last edited by
    #1

    Hi, Is it possible in anyway to load a file into memory and then run it from there? I am working on a file compressor (www.nemokprod.go.ro/nb.htm) that can compress and encrypt and save multiple files as an exe file that can then run the compressed files after unpacking them to a temp folder. The problem is that I have to unpack the files to the hard-disk and then run them from there, making them vulnerable to user that may try to get the original (unprotected) files. So the user shouldn't have access to the file operations in the background. So I need to keep the original unpacked files hidden from the user, until after they are opened by the unpacker and then deleted. So users should have no kind of access to the files (should not see them, open them, should not be able to modify or copy them) but the unpacker should be able to run them. (that is why I think that the memory is the best solution) So is there any way to protect them, like unpacking them directly to memory and then run them from there? Something like a virtual disk in memory? Thanks. Nemok

    D C B J 4 Replies Last reply
    0
    • N Nemok

      Hi, Is it possible in anyway to load a file into memory and then run it from there? I am working on a file compressor (www.nemokprod.go.ro/nb.htm) that can compress and encrypt and save multiple files as an exe file that can then run the compressed files after unpacking them to a temp folder. The problem is that I have to unpack the files to the hard-disk and then run them from there, making them vulnerable to user that may try to get the original (unprotected) files. So the user shouldn't have access to the file operations in the background. So I need to keep the original unpacked files hidden from the user, until after they are opened by the unpacker and then deleted. So users should have no kind of access to the files (should not see them, open them, should not be able to modify or copy them) but the unpacker should be able to run them. (that is why I think that the memory is the best solution) So is there any way to protect them, like unpacking them directly to memory and then run them from there? Something like a virtual disk in memory? Thanks. Nemok

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

      This has been asked many times before but an answer is still 'unknown.' If you unpacked the files to disk, could you not use an obscure name like a GUID rather than something like mysecretfile.exe?


      "Take only what you need and leave the land as you found it." - Native American Proverb

      N 1 Reply Last reply
      0
      • D David Crow

        This has been asked many times before but an answer is still 'unknown.' If you unpacked the files to disk, could you not use an obscure name like a GUID rather than something like mysecretfile.exe?


        "Take only what you need and leave the land as you found it." - Native American Proverb

        N Offline
        N Offline
        Nemok
        wrote on last edited by
        #3

        Yes but using a FileMonitor like the one from SysInternals it is very easy to find out what files is the app working with. Nemok

        D 1 Reply Last reply
        0
        • N Nemok

          Yes but using a FileMonitor like the one from SysInternals it is very easy to find out what files is the app working with. Nemok

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

          True, but if the name were not obvious, would the person know what to do with it even if they managed to make a copy of it?


          "Take only what you need and leave the land as you found it." - Native American Proverb

          N 1 Reply Last reply
          0
          • N Nemok

            Hi, Is it possible in anyway to load a file into memory and then run it from there? I am working on a file compressor (www.nemokprod.go.ro/nb.htm) that can compress and encrypt and save multiple files as an exe file that can then run the compressed files after unpacking them to a temp folder. The problem is that I have to unpack the files to the hard-disk and then run them from there, making them vulnerable to user that may try to get the original (unprotected) files. So the user shouldn't have access to the file operations in the background. So I need to keep the original unpacked files hidden from the user, until after they are opened by the unpacker and then deleted. So users should have no kind of access to the files (should not see them, open them, should not be able to modify or copy them) but the unpacker should be able to run them. (that is why I think that the memory is the best solution) So is there any way to protect them, like unpacking them directly to memory and then run them from there? Something like a virtual disk in memory? Thanks. Nemok

            C Offline
            C Offline
            Chris Losinger
            wrote on last edited by
            #5

            a little Googling is enough to convince me that it is not a simple task. you might take a look at UPX (available from sourceforge). i think it can do this. Cleek | Image Toolkits | Thumbnail maker

            1 Reply Last reply
            0
            • N Nemok

              Hi, Is it possible in anyway to load a file into memory and then run it from there? I am working on a file compressor (www.nemokprod.go.ro/nb.htm) that can compress and encrypt and save multiple files as an exe file that can then run the compressed files after unpacking them to a temp folder. The problem is that I have to unpack the files to the hard-disk and then run them from there, making them vulnerable to user that may try to get the original (unprotected) files. So the user shouldn't have access to the file operations in the background. So I need to keep the original unpacked files hidden from the user, until after they are opened by the unpacker and then deleted. So users should have no kind of access to the files (should not see them, open them, should not be able to modify or copy them) but the unpacker should be able to run them. (that is why I think that the memory is the best solution) So is there any way to protect them, like unpacking them directly to memory and then run them from there? Something like a virtual disk in memory? Thanks. Nemok

              B Offline
              B Offline
              BadKarma
              wrote on last edited by
              #6

              Hi, It is possible to load a binary, executable block of raw data into memory and link a function to it. So you could call that 'extra' function from your code without any problem. Maybe this is what you need ?? But to load an entire file into memory and to run it that is something different. codito ergo sum

              N 1 Reply Last reply
              0
              • B BadKarma

                Hi, It is possible to load a binary, executable block of raw data into memory and link a function to it. So you could call that 'extra' function from your code without any problem. Maybe this is what you need ?? But to load an entire file into memory and to run it that is something different. codito ergo sum

                N Offline
                N Offline
                Nemok
                wrote on last edited by
                #7

                Actually yes I need to load an entire file and run it. Any ideas? Nemok

                1 Reply Last reply
                0
                • D David Crow

                  True, but if the name were not obvious, would the person know what to do with it even if they managed to make a copy of it?


                  "Take only what you need and leave the land as you found it." - Native American Proverb

                  N Offline
                  N Offline
                  Nemok
                  wrote on last edited by
                  #8

                  Yes but I need some more fail proof than that. Nemok

                  1 Reply Last reply
                  0
                  • N Nemok

                    Hi, Is it possible in anyway to load a file into memory and then run it from there? I am working on a file compressor (www.nemokprod.go.ro/nb.htm) that can compress and encrypt and save multiple files as an exe file that can then run the compressed files after unpacking them to a temp folder. The problem is that I have to unpack the files to the hard-disk and then run them from there, making them vulnerable to user that may try to get the original (unprotected) files. So the user shouldn't have access to the file operations in the background. So I need to keep the original unpacked files hidden from the user, until after they are opened by the unpacker and then deleted. So users should have no kind of access to the files (should not see them, open them, should not be able to modify or copy them) but the unpacker should be able to run them. (that is why I think that the memory is the best solution) So is there any way to protect them, like unpacking them directly to memory and then run them from there? Something like a virtual disk in memory? Thanks. Nemok

                    J Offline
                    J Offline
                    Joel Lucsy
                    wrote on last edited by
                    #9

                    Are you looking to just load dlls, or run the actual exe from memory? I've been working on virtual files system similar to thinstall, but am far from finishing. However, I do have some code that will load a dll from memory with certain limitations. Just depends on what you exact needs are. -- Joel Lucsy

                    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