Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pointing to file end

Status
Not open for further replies.

rpk2006

Technical User
Apr 24, 2002
225
IN
I want my C program EXE to search, say "-" at the end of the file while the program is running.

I mean while the EXE of my C program is running, I want to write few characters at the end of my exe file.

Any Idea?

---------------------------------
Securing a computer system has traditionally been a battle of wits: the penetrator tries to find the holes, and the designer tries to close them. � M.Gosser
 
> I want to write few characters at the end of my exe file.
Why would you want to do such a thing?

Aside from the fact that executable files are binary files with a defined format, random writing of data could easily corrupt them to make it un-runnable.

Some operating systems (eg. linux) make an executable read-only whilst the program is running, so it cannot be modified.

Not to mention that the likes of virus checkers will almost certainly regard modifying an executable as signs of virus activity.

If you're trying to store some config information, the correct place to do this is in a configuration file, preferably stored in the user's HOME directory. That way, each user can have their own preferences.

--
 
Actually I wanted to create a self-decrypting executable, but my approach above was wrong.

I better want to create an executable file with my encrypted code contained in it. It should execute and release the code from within it and decrypt it.


---------------------------------
Securing a computer system has traditionally been a battle of wits: the penetrator tries to find the holes, and the designer tries to close them. � M.Gosser
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top