hi, it´s me again with the same old question.
i´m sure it must be possible to change a running exe-file.
anybody an idea?
hi, it´s me again with the same old question.
i´m sure it must be possible to change a running exe-file.
anybody an idea?
Hmm, what exactly do you mean by change?. It is possible to draw on that programs client window. You would simply use FindWindow() to get a handle to it then get a Device Context from the handle. Again depeding on what you mean by change it is possible to change varibles in a running instance. You would need to find the location of the varible in the ram, then set up some pointers to it. It isnt impossible, but depeding on what you are planning on changing it could get quite tricky....
Hope that helps, it would help if you could be more specifc though
TNT
TNT
You Can Stop Me, But You Cant Stop Us All
oh. stupid me:-)
i mean... change the file. something like open...write andsoon
i want my program to change itselfe on disk while it is running. but windows dont want it:-(
So you mean you want the program to change it's own code (= functionality) during runtime? Windows doesn't allow that. By the way, where should the program get it's new functionality from? I can imagine you will be using function pointers.
A challenge for the gurus - make a program which can decompile an exe back to it's source, including comments etc, that 10 year old who was going to write his own OS could have a go at this too, seems to be his kind of thing.
lol, i only know of softice that dissasebles back to code. But i never found a working copy that would work on 2k or xp....
TNT
You Can Stop Me, But You Cant Stop Us All
Originally posted by Robert602
A challenge for the gurus - make a program which can decompile an exe back to it's source, including comments etc, that 10 year old who was going to write his own OS could have a go at this too, seems to be his kind of thing.
Comments aren't compiled into the .exe. They are ignored by the compiler. You also can't get back the original source (its like trying to unbake a cake) [you'd have to convert the machine code to asm and then to C , by then you wouldn't have variable names and lots of stuff would look very different.
You can't, as far as I know modify a .exe while it is running.
Could shut it down, modify it and restart.
"Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
Friedrich Nietzsche
"I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
George Best
"If you are going through hell....keep going."
Winston Churchill
ok. stop fooling on me.
what i make is: put a text file at the end of my exe so the prog can save a text to itselfe. that is not impossible. i´m a beginner, but it was no really big problem to do that. but my problem is to edit the text while the prog is running.
i´m not 10 years old nor am i programming something like an os.
my prog should be something like a posti.
(maby you know the small yello papers)
so maby there is a "guru" out there who can help me.
it must be possible to do that... even with windows.
I suspect what you want to do and what you are asking to do are very different things. Perhaps you should describe your problem, rather than your attempted solution.
Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.
wesentlich: do you mean that you want your program to open a txt file, read its content, maybe modify it, and save the file under the same name again (without changing its code I mean) ?
Or
Open a text file, write the (decompiled or not) .exe to the text file.
Modify the text file (the .exe's text, changing the way the .exe works) as you see fit and copy back over the .exe (so when it runs next time your changes will have taken place)? (which sounds like a virus)
"Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
Friedrich Nietzsche
"I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
George Best
"If you are going through hell....keep going."
Winston Churchill
>>> (which sounds like a virus)
That had occured to me as well, but generally, would a virus want to append code to itself, (i.e. the current .exe, which is open of course)? I would have thought it would want to append to some other .exe.
Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.
I have a similar question. How does an update work. this is what I want to do. I have a program. and it checks over the internet to see if there is a new version available. if there is, download it and overwrite or change the current exe. can this be done with one exe?
first of all.
thanx for your replies.
and may you excuse my bad english.
ok. i hafe a form with a richEdit textfield. the contents of the textfield is added at the end of my exe file. i have made this by copying the exe from 0 to filelength with open&write and then write the text. so the exe is still executable and it can read it´s contents from the added text.
and now all i need to be lucky is, saving the changed text on closing the prog.
but as you all wrote... windows won´t me to do that.
i have also tryed to make a temp(clone) on start, lounch it and close. the clone (who knows his existance as a clone by reading some extra information from the added text) can now change the original exe
but that is only a second-choice-solution.
now i know that windows won´t things like changing a running file. but maby there is a tricky solution how this can be done.
everything is possible.
and i don´t want to make a virus.