Sign in to follow this  

Deleting individual pieces of programs

This topic is 4336 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi everyone, I was just wondering, is there any way in C++ or any other language for that matter, to delete individual bits and bites of a program on someones hard drive (don't worry this isnt for anything nefarious) so like take a program and delete a few ones and zeros from it? Or even whole chunks?

Share this post


Link to post
Share on other sites
Yes, it is possible but it would be hard to tell what your deleting! Just open up the file and start deleting. NOTE: Research the file format firze, if its something like an MZ EXE then I believe the first 512 bytes are header info. And in that info is the size of the program and the pages and such so if you modify the program, you also have to modify the header. Its a pain but can be done

Hope that helps

Share this post


Link to post
Share on other sites
Well what I was thinking is you have a watchdog program, that whenever a program is installed on your machine you set a time period for it to be deleted, or you make it invincible, and if you dont select anything it has a period of an hour before it is deleted. So every day the watchdog removes part of the program from your computer in a way that still allows it to run but compromises some features. This would essentially eliminate clutter and viruses that dont immediately wipe your hard drive.

Share this post


Link to post
Share on other sites
Quote:
Original post by PhlashStudios
Well what I was thinking is you have a watchdog program, that whenever a program is installed on your machine you set a time period for it to be deleted, or you make it invincible, and if you dont select anything it has a period of an hour before it is deleted. So every day the watchdog removes part of the program from your computer in a way that still allows it to run but compromises some features. This would essentially eliminate clutter and viruses that dont immediately wipe your hard drive.
A specific program, or any program? Why would you muck around removing features from a random .exe? All your going to do is mess up the files. Wouldn't it be easier to modify another external file, and just not offer the features at runtime (in your own .exe)

Share this post


Link to post
Share on other sites
Quote:
Original post by PhlashStudios
Any program that is downloaded to the computer and that the user states to be not invincible
That makes no sense... [wow] You'd never know which part of the .exe was for what.. let alone that's it's illegal to modifdy most .exe files in their EULA. Why would anyone even want something like this? They can delete their own unwanted programs via a proper unistall.

Who wants their programs to rot away over time, and mess up their uninstall data?

Share this post


Link to post
Share on other sites
One thing you can do is figure out what the actual hex instructions are for your processor. For example, after a few minutes of mucking around with DEBUG, I was able to determine the following:

* B8yyxx = mov ax, xxyy
* CDxx = int xx
* C3 = ret

So, to put together a small routine that places the computer into mode 13h (an old video mode from the DOS days, for those who didn't know) would look something like this:


B81300CD10C3


That's 16-bit code, however. If you want to get into 32-bit code, I suggest downloading NASM and using it's NDISASM program to disassmble simple programs to find out what the machine-language equivalents actually are.

If you can figure out enough of the codes, parse an executable's header section, and identify the sections of the code that you want to modify, then you can write self-modifying code, or the watchdog program the OP described.

edit: Of course, you're going to have to learn some assembly language to do all this, but assembly is fun! (at least, that's how I find it, you might not)

Share this post


Link to post
Share on other sites
Im sorry to say but that is just about impossible to do...plus I doubt anyone would want that...if they want to get rid of the program they will uninstall it, and that WONT get rid of any viruses really becauses BATCH viruses if your lucky! Modern viruses cant simply be deleted or edited, plus some of them spread so it wont be doing much good.

Share this post


Link to post
Share on other sites
Quote:
Original post by PhlashStudios
Well what I was thinking is you have a watchdog program, that whenever a program is installed on your machine you set a time period for it to be deleted, or you make it invincible, and if you dont select anything it has a period of an hour before it is deleted.

You can easily create a utility to delete - or preferrably, uninstall - other programs for any criteria you choose. Such a program - if there does not exist one already - might actually be really useful.

Quote:
So every day the watchdog removes part of the program from your computer in a way that still allows it to run but compromises some features.

Not going to happen. However, you can prohibit certain services to a program - file system accesses, internet accesses, etc. - from your watchdog program; you can in Windows, anyway. What platform are you planning on developing for?

Share this post


Link to post
Share on other sites

This topic is 4336 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this