Jump to content

Cleaning Temp Folders?


RandomlyKnighted

Recommended Posts

When a program like Ccleaner cleans out the Temp folder it deletes the files. If you change the settings in Ccleaner to overwrite the file say with the NSA 7 pass secure file deletion then it permanently deletes the files. To my understanding it overwrites these files.

 

My question is simple, how do they do this? I mean I mainly program with C# so I know that you can delete files programmatically and I know you can overwrite the data inside the file programmatically but to my understanding they actually overwrite the file from the hard disk to where it's not there at all. So how are they able to overwrite it from the hard drive?

 

Thanks in advance for all answers given.

Link to comment
Share on other sites

Actually, the file is still there (you'd have to wipe the MFT free space to prevent that).

I think it first overwrite the file X times with random data the size of the file, then change its name, and then deletes it. The random data is still there on the disk, but since the disk's free space also contains random data, you can't tell there was a file there before ;)

Piriform French translator

Link to comment
Share on other sites

  • Moderators

In exactly the same way as the correct file is returned when you access it.

 

In the case of Secure File Deletion the file is initially live, so NTFS knows where it is and can return to CC where the data clusters are. CC will (in a very simplified description) lock the file, overwrite the clusters, rename the file to ZZ.ZZZ, release the lock, and delete the file. All these operations are done - as I understand - using Windows API's, which leave file control to NTFS.

 

WFS is more complicated, I don't even know if I could give a description of how it works at any but the most basic level. But NTFS knows which (logical) clusters are flagged as free and which aren't. I guess CC must read all clusters sequentially, determine from the cluster bitmap whether the current cluster is unused, lock it, overwrite it, free it, then on to the next. Hairy stuff. Perhaps there's a 'Is this cluster free?' or 'Get next free cluster' command, in which case easy-peasy.

Link to comment
Share on other sites

You need to get yourself an old computer with DOS and a floppy disc.

Then you can have the fun of using Edlin and debug.com and using the floppy disc.

You can issue the command to format the disc.

You can write and read files.

You can see where a file starts, and you can see the linkage as it moves to the next available track and sector.

 

Thirty years ago I had a two inch thick printout on 132 column fan folder paper of magic entry points and interrupt invocations.

I had the information but not the courage to set up the control codes and GOTO the special address that would modify my HDD.

I had the information to reformat my 20 MB HDD which had 16 KB sectors, i.e. 1200 files top whack.

Information but not the courage to make a possibly non-reversible mistake.

 

It was hard work doing and understanding all that low level stuff "by hand",

and much easier just using the "high level" file operating system.

 

I prefer now to simply use the tools which do the work for me.

 

That "high level" file operating system is very low level compared to a hard disc FAT32 system,

and converting from FAT32 to NTFS does not make it simpler.

 

I think there is more than two inches of data available on the API's available in the O.S.

 

You will have an awful lot of studying ahead of you.

 

It may be easier if you gave up on this topic and instead looked for support from the suppliers of your C# compiler.

They may provide relevant #include and lower level stuff

Link to comment
Share on other sites

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
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.