Hi there...

first of all: sorry for my terrible english but i'm doin my very best!

i got a question... i want to write a lil program which checks if its started for the first time... if so, it should ask the user for a password... the password should be entered and stored in the binary (pe/exe)...
is it possible? if yes, how could i do sumthin like that? (i think i have to modify the header etc...)

so long,
JF
Posted on 2002-12-19 14:45:51 by cetchmoh
Use a 2nd programm for write into the first. You cant write to a "open" executable (you can read from it tough).
Posted on 2002-12-19 14:49:10 by bazik
but a file can delete itself... so i think it would be possible that a file could modify itself...
(polymorphy?)
Posted on 2002-12-19 15:03:58 by cetchmoh
Create a Resource string. XOR or encrypt it if you desire.

Then use UpdateResource function to add a new password from the default. If the default is present, no password is necessary for the first execution.

Look here for all the functions you will need.
Posted on 2002-12-19 15:16:56 by Kdr Kane

Use a 2nd programm for write into the first. You cant write to a "open" executable (you can read from it tough).



actually you can write to it on disk while its open, but its pretty advanced. any thing you put in it or change perhaps a label to a window, it will immediatly load it into memory.
Posted on 2002-12-19 20:52:15 by Qages
are there any tutorials on that stuff? :rolleyes:
Posted on 2002-12-20 07:18:49 by cetchmoh
not that i know of.
Posted on 2002-12-20 15:11:36 by Qages
cetchmoh,

basically the operating system is designed to prevent any modification to a running program so updating the disk image is not normally an option while the program is running.

I would recommend using a different design for storing settings that does not have to try and get around the operating system design as it will be a lot more reliable in the long term.

Regards,

hutch@movsd.com
Posted on 2002-12-20 16:37:24 by hutch--
its just for education :)
i wanna know how i could deal with it...
there are so many possibilities... so why not? :D
Posted on 2002-12-20 18:03:22 by cetchmoh
Even if it was possible to modify the .exe in this way you would set off people's AV software like mad. So aside from educational interests, it would be impractical.

Just encrypt the password and store it in the registry or an .ini or whatever. You could probably even store it in a DLL although that might set off some AV alarms too.
Posted on 2002-12-20 20:38:23 by iblis