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. Change Exe contents while running

Change Exe contents while running

Scheduled Pinned Locked Moved C / C++ / MFC
help
7 Posts 6 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.
  • A Offline
    A Offline
    Arsalan Malik
    wrote on last edited by
    #1

    I want to change exe file contents, while running it, i.e. the exe file should be able to change itself. Actually I want to append some data to exe, which I want to change dynamically, and save within same exe. I don't want to create a temporary file, or use system registary,or any other files. Somebody, please help! Arsalan Malik

    B A 2 J D 5 Replies Last reply
    0
    • A Arsalan Malik

      I want to change exe file contents, while running it, i.e. the exe file should be able to change itself. Actually I want to append some data to exe, which I want to change dynamically, and save within same exe. I don't want to create a temporary file, or use system registary,or any other files. Somebody, please help! Arsalan Malik

      B Offline
      B Offline
      bmw5002
      wrote on last edited by
      #2

      I don't think its possible to do that while its running. The solution I can think of might take a little work. Basically u write another app and insert the binary data for that app into a resource in your main app. Then you have a function that extracts the resource data using api calls and saves that file in a temporary folder, wherever. It then looks at the end of that file, and inserts the data that you want to change in your main app. Then it executes that program and closes itself. The extracted program then waits a second or two for the main program to end and then looks at itself and writes that data to the closed main program. Then it executes the main program again and closes itself. You can look it up, but I don't recall that you can write resources to the app you are executing the call from at runtime. And you definitely can't obtain write privilages to yourself while your running. Don't take my word for it though.

      1 Reply Last reply
      0
      • A Arsalan Malik

        I want to change exe file contents, while running it, i.e. the exe file should be able to change itself. Actually I want to append some data to exe, which I want to change dynamically, and save within same exe. I don't want to create a temporary file, or use system registary,or any other files. Somebody, please help! Arsalan Malik

        A Offline
        A Offline
        alex barylski
        wrote on last edited by
        #3

        Polymorhpic EXE's :) I always thought that would make more sense than storing INI data in INI files... :) How do I print my voice mail?

        B 1 Reply Last reply
        0
        • A alex barylski

          Polymorhpic EXE's :) I always thought that would make more sense than storing INI data in INI files... :) How do I print my voice mail?

          B Offline
          B Offline
          bmw5002
          wrote on last edited by
          #4

          Polymorphic exes are just viruses that rewrite their machine code every time they propogate. That has nothing to do with modifying a file that is in use.

          1 Reply Last reply
          0
          • A Arsalan Malik

            I want to change exe file contents, while running it, i.e. the exe file should be able to change itself. Actually I want to append some data to exe, which I want to change dynamically, and save within same exe. I don't want to create a temporary file, or use system registary,or any other files. Somebody, please help! Arsalan Malik

            2 Offline
            2 Offline
            224917
            wrote on last edited by
            #5

            Microsoft dosent support this.

            1 Reply Last reply
            0
            • A Arsalan Malik

              I want to change exe file contents, while running it, i.e. the exe file should be able to change itself. Actually I want to append some data to exe, which I want to change dynamically, and save within same exe. I don't want to create a temporary file, or use system registary,or any other files. Somebody, please help! Arsalan Malik

              J Offline
              J Offline
              jmkhael
              wrote on last edited by
              #6

              You have several options and that depends on what you want to do. If your objective is to hide some sensitive data than encrypt those into your exe, and decrypt at runtime. If hiding the code from crackers eyes is what you are trying to achieve, try one of the different packers that are available (or write your own but requires some time. google for writing packer reverse) SMC exe can achieve what you need to do, but that requires writing some assembly code (make sure the section in your exe your modifiying is linked with RW attributes) So practically without knowing what you need, its kind of hard to tell you what to do. An average cracker may only stop if he becomes bored to death Papa while (TRUE) Papa.WillLove ( Bebe ) ;

              1 Reply Last reply
              0
              • A Arsalan Malik

                I want to change exe file contents, while running it, i.e. the exe file should be able to change itself. Actually I want to append some data to exe, which I want to change dynamically, and save within same exe. I don't want to create a temporary file, or use system registary,or any other files. Somebody, please help! Arsalan Malik

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

                See if this article gets you started.


                "When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen

                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