Writing data to a executing file

Started by
4 comments, last by Boder 17 years, 11 months ago
Is it possible to get write access permission to a executing file?
Advertisement
Nope. An executing file, or a file being read from has a write lock on it, so you'll only be able to read from it.

What exactly are you trying to do? There's usually better ways around this. Assuming you're using UpdateResource() or something, you can copy the EXE, then update the resource, then copy it back. I'll explain more if that's actually what you're doing.
Quote:Original post by Brocketino
Is it possible to get write access permission to a executing file?

What exactly are you trying to do?
If you are thinking of self-modifying code, you can simply map the file to memory and get a handle to modify the memory-mapped file, rather than directly the file on disk.

Quote:Original post by Brocketino
We like to know your flesh...


Huh?
--== discman1028 ==--
Quote:Original post by discman1028
Quote:Original post by Brocketino
We like to know your flesh...


Huh?


Just send him a nude photo of yourself, like all of the previous respondents did, too!
Evil Steve helped me out before:

http://www.gamedev.net/community/forums/topic.asp?topic_id=390903

This topic is closed to new replies.

Advertisement