hi,
can anyone help me writing self modifying exe??? any article, site,
reference??????? i need to write one in C/C++ this has to be console based
application.
thanks.

bye,
Farooq Khan

Re: self modifying exe by lallous

lallous
Wed Jun 23 04:31:00 CDT 2004

Hello

What are you trying to achieve?

Self modifying EXE (to modify itself and write back changes to disk) or self
modifying code (SMC)?

It may be doable in C/C++ but in ASM it is far better and easier.

--
Elias
"Farooq Khan" <farooq@softechww.com> wrote in message
news:Oo4Qb$GWEHA.1048@tk2msftngp13.phx.gbl...
> hi,
> can anyone help me writing self modifying exe??? any article, site,
> reference??????? i need to write one in C/C++ this has to be console based
> application.
> thanks.
>
> bye,
> Farooq Khan



Re: self modifying exe by Farooq

Farooq
Wed Jun 23 09:03:24 CDT 2004

hi Elias,
well, i want it be modifying itself and writing back changes to disk. let me
tell what this application be doing exactly.
this applcation would be writing application exit time somewhere in it and
reading it afterwards when it is launched again to do some calculation. i
cannot go for registry or any other thing.
thanks.

bye,
Farooq Khan


"lallous" <lallous@lgwm.org> wrote in message
news:u$D5xUQWEHA.2844@TK2MSFTNGP09.phx.gbl...
> Hello
>
> What are you trying to achieve?
>
> Self modifying EXE (to modify itself and write back changes to disk) or
self
> modifying code (SMC)?
>
> It may be doable in C/C++ but in ASM it is far better and easier.
>
> --
> Elias
> "Farooq Khan" <farooq@softechww.com> wrote in message
> news:Oo4Qb$GWEHA.1048@tk2msftngp13.phx.gbl...
> > hi,
> > can anyone help me writing self modifying exe??? any article, site,
> > reference??????? i need to write one in C/C++ this has to be console
based
> > application.
> > thanks.
> >
> > bye,
> > Farooq Khan
>
>



Re: self modifying exe by Tim

Tim
Wed Jun 23 13:49:16 CDT 2004

Farooq Khan wrote:
> well, i want it be modifying itself and writing back changes to disk.
> let me tell what this application be doing exactly.
> this applcation would be writing application exit time somewhere in
> it and reading it afterwards when it is launched again to do some
> calculation. i cannot go for registry or any other thing.
> thanks.

Self-modifying EXEs don't work because Windows itself locks the EXE file.
You won't be able to open the file for write access while the EXE is
running.

Modifying EXEs in general usually won't work because ordinary users don't
have write access to the Program Files directory.

In any case, what do you intend to do if more than one user uses your
application? With your scheme, they will overwrite each others' changes.

--
Tim Robinson (MVP, Windows SDK)
http://mobius.sourceforge.net/



Re: self modifying exe by Alexander

Alexander
Wed Jun 23 21:45:51 CDT 2004

An application cannot write to its own file because of sharing violation. An
user also may not have write permissions to your application file and to the
whole folder.

"Farooq Khan" <farooq@softechww.com> wrote in message
news:uJfP1oSWEHA.212@TK2MSFTNGP11.phx.gbl...
> hi Elias,
> well, i want it be modifying itself and writing back changes to disk. let
me
> tell what this application be doing exactly.
> this applcation would be writing application exit time somewhere in it and
> reading it afterwards when it is launched again to do some calculation. i
> cannot go for registry or any other thing.
> thanks.
>
> bye,
> Farooq Khan
>
>
> "lallous" <lallous@lgwm.org> wrote in message
> news:u$D5xUQWEHA.2844@TK2MSFTNGP09.phx.gbl...
> > Hello
> >
> > What are you trying to achieve?
> >
> > Self modifying EXE (to modify itself and write back changes to disk) or
> self
> > modifying code (SMC)?
> >
> > It may be doable in C/C++ but in ASM it is far better and easier.
> >
> > --
> > Elias
> > "Farooq Khan" <farooq@softechww.com> wrote in message
> > news:Oo4Qb$GWEHA.1048@tk2msftngp13.phx.gbl...
> > > hi,
> > > can anyone help me writing self modifying exe??? any article, site,
> > > reference??????? i need to write one in C/C++ this has to be console
> based
> > > application.
> > > thanks.
> > >
> > > bye,
> > > Farooq Khan
> >
> >
>
>



Re: self modifying exe by Farooq

Farooq
Thu Jun 24 03:29:59 CDT 2004

Alexendar/Tim,
i had written a piece of code for this soem time back that works OK under
DOS. i was trying to do that for windows.
guess will have to think of soemthing else.....thanks anyways.
hey do u know some good book that could tell me some inside stories of
Windows??

thanks again.

Farooq Khan



"Alexander Grigoriev" <alegr@earthlink.net> wrote in message
news:O9acdVZWEHA.2576@TK2MSFTNGP10.phx.gbl...
> An application cannot write to its own file because of sharing violation.
An
> user also may not have write permissions to your application file and to
the
> whole folder.
>
> "Farooq Khan" <farooq@softechww.com> wrote in message
> news:uJfP1oSWEHA.212@TK2MSFTNGP11.phx.gbl...
> > hi Elias,
> > well, i want it be modifying itself and writing back changes to disk.
let
> me
> > tell what this application be doing exactly.
> > this applcation would be writing application exit time somewhere in it
and
> > reading it afterwards when it is launched again to do some calculation.
i
> > cannot go for registry or any other thing.
> > thanks.
> >
> > bye,
> > Farooq Khan
> >
> >
> > "lallous" <lallous@lgwm.org> wrote in message
> > news:u$D5xUQWEHA.2844@TK2MSFTNGP09.phx.gbl...
> > > Hello
> > >
> > > What are you trying to achieve?
> > >
> > > Self modifying EXE (to modify itself and write back changes to disk)
or
> > self
> > > modifying code (SMC)?
> > >
> > > It may be doable in C/C++ but in ASM it is far better and easier.
> > >
> > > --
> > > Elias
> > > "Farooq Khan" <farooq@softechww.com> wrote in message
> > > news:Oo4Qb$GWEHA.1048@tk2msftngp13.phx.gbl...
> > > > hi,
> > > > can anyone help me writing self modifying exe??? any article, site,
> > > > reference??????? i need to write one in C/C++ this has to be console
> > based
> > > > application.
> > > > thanks.
> > > >
> > > > bye,
> > > > Farooq Khan
> > >
> > >
> >
> >
>
>



Re: self modifying exe by adebaene

adebaene
Thu Jun 24 11:00:38 CDT 2004

"Farooq Khan" <farooq@softechww.com> wrote in message news:<u7mQLTcWEHA.2340@TK2MSFTNGP09.phx.gbl>...

> hey do u know some good book that could tell me some inside stories of
> Windows??

"Inside Microsoft Windows 2000", by Solomon Russinovich

Arnaud
MVP - VC

Re: self modifying exe by lallous

lallous
Thu Jun 24 14:02:33 CDT 2004

"Farooq Khan" <farooq@softechww.com> wrote in message news:<u7mQLTcWEHA.2340@TK2MSFTNGP09.phx.gbl>...
> Alexendar/Tim,
> i had written a piece of code for this soem time back that works OK under
> DOS. i was trying to do that for windows.
> guess will have to think of soemthing else.....thanks anyways.
> hey do u know some good book that could tell me some inside stories of
> Windows??
>
> thanks again.
>
> Farooq Khan
>
>

Undocumented Windows NT
Windows 2000 Internals
etc....

Amazon on these titles and see what customers who bought these also bought ;)

--
Elias