• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to write a program that deletes itself?

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can anyone give me the logic as to how a program can delete itself?
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This forum is for puzzle questions. Moving to Java Forum, but it might be moved again...

Eric
 
Ranch Hand
Posts: 305
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Didn't you ever see the Matrix? Programs don't like to delete themselves.

Anyhow, it seems that you would need to fork a new process (not a lightweight child thread, but an independent process), that would then have its way with the original process (aka, shutting it down, deleting it, etc.). You may be able to pass the PID of the parent to the child, the child then uses the PID to kill the parent process, and remove it from the disk. This is theoretical of course, but seems like a sound theory.

Of course, the primary purpose of doing such a thing seems to be the need to erase one's footprint? Strategically dropping a bomb which serves its purpose then erases any indication that it was ever there? In this case, I deny any knowledge of this thread and any and all contents therein and should any cracking attempts be made as a result of this thread I do not speak English and I know nothing about computers.
 
Ranch Hand
Posts: 815
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Jeffrey Hunter:
You may be able to pass the PID of the parent to the child, the child then uses the PID to kill the parent process, and remove it from the disk.



And marry its mother?
 
Ranch Hand
Posts: 469
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Cannot think any positive thought why someone would want something like that. Why?
 
Jeffrey Hunter
Ranch Hand
Posts: 305
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Rita Moore:
Cannot think any positive thought why someone would want something like that. Why?



Dump a password harvestor, set up a remote socket to listen for the passwords, once the procedure is complete -- kill socket, erase footprint of harvestor. Just one of the many possibilities.
 
Sania Marsh
Ranch Hand
Posts: 469
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Jeffrey Hunter:


Dump a password harvestor, set up a remote socket to listen for the passwords, once the procedure is complete -- kill socket, erase footprint of harvestor. Just one of the many possibilities.



That's considered positive?
 
Jeffrey Hunter
Ranch Hand
Posts: 305
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sure, if it's some Al-Qaeda bonehead running a communications network like the one they caught not too long ago.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic