SourceFiles.org - Use the Source, Luke
Home | Register | News | Forums | Guide | MyLinks | Bookmark

Related Sites

Latest News
  General News
  Reviews
  Press Releases
  Software
  Hardware
  Security
  Tutorials
  Off Topic


Back to files

FileRepair

Current version: 1.3.8

FREEWARE (GPL)
(c) Copyright Robin Hill 2004
Email: filerepair@robinhill.me.uk
URL: http://www.robinhill.me.uk/FileRepair/

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 (http://www.geocities.com/filefixie/). 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 (http://www.edonkey2000.com/) 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 (http://developer.kde.org/~sewardj/).

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

  • Corrected problem with writing the last block to a file. Previous versions were using the size to write to calculate the offset. This works fine if the write is a full block, but will fail if the last block is shorter. This would lead to it writing to the wrong location.
  • Change to use the wxLongLongFmtSpec specifier for all platforms, rather than switching between %I64d and %lld depending on platform. Unfortunately this doesn't seem to work when it occurs more than once in a singe string (on Windows anyway) so I've had to split the string into two parts.
  • Corrected a problem with using small blocks. Unless the file is flushed after writing each block then they can end up in the wrong place (I'm not sure HOW that happens, but it does).
  • Added quiet mode to the command-line version. This makes it a lot easier to use FileRepair in scripts.
    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 or 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 and will be released at a later date, once I've documented it. Otherwise 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++.

Please let me know of any problems or suggestions at the above email address.


Other Sites

Discussion Groups
  Beginners
  Distributions
  Networking / Security
  Software
  PDAs

About | FAQ | Privacy | Awards | Contact
Comments to the webmaster are welcome.
Copyright 2006 Sourcefiles.org All rights reserved.