Virchk.cs: A C# file Scan Utility for Generating MD5 Signature Footprints


About Virchk

Virchk.cs is a file scanner utility, which traverses the files in a directory and all it's sub directories, to generate a MD5 hash signature footprint of the targeted extensions file.

This utility is authored by me (Ashish Banerjee
). This utility is the C# avatar of a Java utility, also authored by me a couple of years back.

I re-wrote this utility from Java to C#, to gain insights into similarities and disparities between the two languages.

I found the Java utility (which uses similar algo. to this C# utility) useful for ensuring my virus scanner is not hood winked by  emerging viruses. It has saved my day on more than one occasions.

I have also found this utility for version control of documents and source codes. To protect them against accidental or intentional changes.

C# features used

  • Operator overloading: see FileSig structure (Line 63, Virchk.cs).
  • Structures : again see FileSig structure.
  • Object Recursion: see DirTraverse class (Line 93, Virchk.cs).
  • MD5 hash : see Lines 231 to 237, Virchk.cs.
  • SOAP serialization: see Lines 171 to 205,  Virchk.cs.
  • Regular Expressions: see Lines 362 to 378,  Virchk.cs.

Compiling Virchk

From the current directory execute from a dos prompt:

namake all, It is assumed that you have .NET SDK installed and also have executed corvar.bat found in the bin dir. of the SDK from the dos prompt.

If all goes well Virchk.exe will be produced.

Executing Virchk

See usage Line number 335 of Virchk.cs.

First time execute

virchk U . test.xml

The test.xml will contain the SOAP serialized XML file. Use IE 5.5 or above to open the XML file.

For checking back use

virchk U . test.xml

Disclaimer

No warranties claims are made by the author, use it at your own risk.


Similar Articles