FileRepair

Current version: 1.3.9

© Robin Hill 2004. Licensed under the GNU General Public License Version 2


Introduction

FileRepair is an application to compare files across a network and, if necessary, modify one so that it is identical with the second.

This was written after the experience of using (and helping others to use) WinCRC. While a very good program functionally, it lacked a lot in usability. Since development on this seemed to have stopped I decided to write my own version. Since there was no source code available for WinCRC I started from scratch, which means FileRepair is not compatible with WinCRC.

This is the end result. The program performs not only the same file repair functionality as WinCRC but also adds MD5 and eDonkey hashes for quick checking of files after repair. In addition the repair process is far faster than WinCRC and, with feedback on progress, far easier to use.

I consider this software to be stable - I've tested it fairly extensively and it has been checked for memory leaks during normal operation using valgrind.

There are both Windows and Linux versions available which use the same communications protocol so can be used in combination. I've tested the Windows version on 98, 2000 and XP.

Changes in this version

  • Forced calculation of file offset to be 64-bit. This fixes reported issues with repairing files > 2GB.
  • Updated for new versions of wxWidgets.
  • Added wxWidgets unicode support.

Requirements

Windows

  • IE4+ (for cryptographic code used in MD4/5)
  • Winsock version 2 (should be in any system with Win95 or later)

Linux

(These requirements are only for the dynamically compiled version)

  • openssl (for cryptographic code used in MD4/5)
  • curses/ncurses libraries (for the command-line version)
  • GTK+ libraries (for the graphical interface)

Capabilities

It can perform the following tasks:

Generate eDonkey, MD5, CRC32 and TTH hashes

The eDonkey hash (MD4 based) can be used to verify files against hashes posted on eDonkey sites. MD5 is the more commonly used hash for file verification. CRC32 is the hash used in .sfv files and elsewehere online. TTH hashes are used in newer versions of DC++, Shareaza and other P2P applications. All of these can be used to check whether a downloaded file is identical to the source file.

Create of Verify CRC file

The CRC file is a listing of CRC checksums for every block in the file. This can be used to check how badly corrupted a download is, and thus whether it is worth fixing.

Repair files

This is done in a client-server configuration, where the server has a verified correct version of the file. The client connects to the server and uploads a CRC list. The server checks this against it's own and transfers correct versions of any corrupt blocks to the client. Each block is checked again by the client before the file is updated.

Now also works in reverse - once the initial client-server connection is made, the client & server swap roles so that the server's version of the file is repaired based on the client's file. This makes it possible for those behind firewalls or on NATed connections to help with repairs.

Other Info

The communications protocol is very simple, but it doesn't look I'll get around to documenting it now. You can figure it out from the source.

The application should be able to deal with any size files the operating system is capable of using.

The code can probably be improved, I'm no expert in C++.