lclean

Documentation

Version 1.0

lclean is a program that allows you to detect, save and clean the trash sections of OLE style documents.

Note: This program changes your document! If you use lclean, please keep a backup of the treated files, until you are sure they did not take any harm!

Why lclean?

The program "lclean" can access this kind of garbage in OLE documents. To do this it uses the laola_modify_trash function of the "laola.pl" library. This library decides between four different types of trash. To understand them fully, you will have to look at the source code. In short:

  1. Unused "big blocks". These blocks are not used by the document. Each of these blocks is 512 bytes long.
  2. Unused "small blocks". These blocks are not used by the document. Each of these blocks is 64 bytes long.
  3. File end space. This refers to the "streams" of an OLE document. The space is made up of all the space between the end of a stream and the end of a block.
  4. System space. These sections are required by file format, though they are not used by OLE system. Actually this data is no garbage.
You can do several things:

Get a trash report
lclean -r {document}
Gives a little report about the trash in the document(s).

Clean the trash
lclean -c [-n] {document}
The trash sections will be cleaned. Unused blocks are filled with null bytes. System data will be cleaned with 0xff bytes. File end trash (type 4) will be cleaned with random bytes. When using switch -n, file end trash will be filled also with zero bytes (faster on files with lots of embedded objects).

Save the trash to files
lclean -s [-a] [-d] [-z] {document}
The trash sections will be saved to own files. They will be stored to an directory in your current directory. Normally it will be the directory "doctrash". E.g., if there is the example file "legacy.doc" the trashfiles will be stored as: "doctrash/legacy.tr1", "doctrash/legacy.tr2", "doctrash/legacy.tr3" and "doctrash/legacy.tr4".

Example: lclean -cs {document}
This would first save all trash chunks into separate files into directory "doctrash", then it would clean the document.

Insert a file into the document (hide it)
lclean -i <file> [-a] {document}
Instead of trash, some <file> can thus be stored into the document. This file cannot be seen by the documents application. The file may of course not be bigger, than the size of the trash in your documents (plus 20 bytes plus the size to store the filename). Normally, only trash types 1 and 2 will be used for this. If they offer not enough space, with switch -a trash type 4 and 8 will be used, too.

Example: lclean -aci <file> {document}
This would first clean the document, then insert the hidden file by using all trash types.

List if there is a file inserted into the documents trash
lclean -l {document}

Extract the hidden file
lclean -e [-f] [-z] {document}
This makes a copy of the hidden file. If the file got corrupted by what reason ever, it will not be extracted. The file will get the date of its last modification. If the file already exists, you will be prompted to overwrite it with the new extracted file. With switch -f you will not be prompted, but the file will be overwritten. With switch -z, no zero length files will be created.

Back to Laola Homepage.