K
kvt
Hi,
One of my friend puzzled me to write a program which destructs itself.
i.e, by the time it stops execution, its executable file should be
deleted.
I tried a lot like
a) using " system() function to deleted the running program"
result: Access denied
b) googled for logic of other self destructing programs
result: not turned up
c) searched groups. They suggested using a .bat file, invoking the bat
file from currently executing one and through bat file deleting the
current executable after we have finished.
But in this case also, we are leaving residual (.bat file).
result: not a perfect one, only a remedy.
d) after system() function Access denial, i got a thought, as OS is
protecting the currently executing program, it is not possible to
perform anything explicitly on it. so what about taking a pointer in
the current program and filling the entire program space with garbage.
result: i don't known how to do it. i mean from where to start, what
is the start and end of the current memory space.etc.,
if any one of you find other ways please let me know. I think this is
for hackers, who can think out of box.
Bye..
KVT
One of my friend puzzled me to write a program which destructs itself.
i.e, by the time it stops execution, its executable file should be
deleted.
I tried a lot like
a) using " system() function to deleted the running program"
result: Access denied
b) googled for logic of other self destructing programs
result: not turned up
c) searched groups. They suggested using a .bat file, invoking the bat
file from currently executing one and through bat file deleting the
current executable after we have finished.
But in this case also, we are leaving residual (.bat file).
result: not a perfect one, only a remedy.
d) after system() function Access denial, i got a thought, as OS is
protecting the currently executing program, it is not possible to
perform anything explicitly on it. so what about taking a pointer in
the current program and filling the entire program space with garbage.
result: i don't known how to do it. i mean from where to start, what
is the start and end of the current memory space.etc.,
if any one of you find other ways please let me know. I think this is
for hackers, who can think out of box.
Bye..
KVT