how can I force program in pascal to write its own source code from .exe file?:-|

Recommended Answers

All 2 Replies

you can't do that with any programming language. The best you can hope for is for a disassembler to produce assembly language.

the reason you can't do that is because on most filesystems a running exe "locks" its file for write operations. if you were to directly overwrite parts of an application while it was running it would probably crash anyway.

you could recompile the application using a command line call and then close or exit the application, overwrite it, and then re-open or re-enter it.

a better solution would be to write your application in a way that it can be customized without needing to be recompiled.

some programming languages do allow scripted processes to be written into, but as far as I know; all of them are interpretted languages, so they don't compile to an exe atall.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.