1

Hi,

This is a tool to calculate hashes on parts of a file.

Readme:

What:
 This calculates the crc, md5 and sha1 of parts of a file, or the file as a whole.

How:
 parthash <FILENAME> [PARTSIZE ...]

Why:
 Useful for comparing single file images against the multitrack hashes in the redump.org database.

Compiling:
 Use "make" on any linux/unix/bsd console nearby, or if you must, an msys or cygwin environment.
 You need to use a relatively recent gcc (4.5.0+ ish I guess).

 This software uses crcutil-1.0 for providing fast crc calculations.
 crcutil is made by Andrew Kadatch and Bob Jenkins and can be found on http://code.google.com/p/crcutil/
 Do not contact them for support on this software.
 The Makefile will try to pull in version 1.0 through wget if it is not supplied yet.

 Also, this software makes use of the MD5 implementation of Alexander Peslyak.
 This is found at http://openwall.info/wiki/people/solar/software/public-domain-source-code/md5
 Changes were made for OpenSSL compatibility and a small casting patch for g++ support.
 These changes are released under the same license as the original md5.c file.

 Finally, this software makes use of the SHA1 implementation of Steve Reid, Ralph Giles et al.
 Changes were made for OpenSSL compatibility and using standard c types in the header.
 Also, SHA1HANDSOFF is defined to protect input data.
 These changes are also released under the same license as the original sha1.c file.

Contact:
 At the moment, see the redump.org forum thread where you got this.

-V.

The 64 bit version is around 40% faster if your machine supports it.
The MD5 and SHA1 algorithms I use in this are not the fastest available, I choose them based on their license, readability and compactness.
I made them OpenSSL compatible though, so if you are on linux, you could modify the source to compile with OpenSSL.

Source: parthash-0.1.tar.gz
Win32 binary: parthash-0.1-bin-win32.zip
Win64 binary: parthash-0.1-bin-win64.zip

2 (edited by pablogm123 2013-08-09 02:25:04)

Tested, I really like this program, because I prefer single file images to store my personal dumps, and now I can verify them against redump's database without splitting anything.

D:\>parthash pmagic_2013_08_01.iso
 #        Size   CRC-32                        MD5/SHA-1
 1   352321536 d12fd366 af2356aac7fc8fc4039a514126933455
                301065eaaa48bdaf3040056917cd93ff25b634a9

D:\>parthash "Club Saturn.pcm" 62125728 53802000 48394752 50974896 56965440 58047360 54262992 56029344 50278704 54907440 53009376 44285808 54639312 55363728 48989808
 #        Size   CRC-32                        MD5/SHA-1
 1    62125728 2d7ce663 bf707cb55faa4483e553f78ebdd3efc5
                f8818ed37046dbd6c4d86c3421011d2abdc43173
 2    53802000 b82e7404 01150f5ed45885f12f69dc540b7fc746
                d647a8c5984f501bde2bb104921c0ce9dcde44f1
 3    48394752 626c4051 5439026b5027556722a6cda79af767d8
                de30e4620e294118ae86d2aadcce4cebe7ffbab0
 4    50974896 da78b6d0 685d207a47cbbca2e6631564dcbcee86
                4ec3adb07c91e302cd2ab4d38d05867a2dd38349
 5    56965440 87201c30 6b546a9a056fff01218f03427f7bca1b
                ad858cd0482dfbb88e24a52b388294f130422495
 6    58047360 f25c1340 212b160e396791f32e19fbd59864f974
                8ea1aa23542b23d5afb39f0a6fb8351736fb913c
 7    54262992 05cad2df 06251e9ec337f0bd47b4ca47e686b69b
                e130025d95776d36c8282ae5fcc79cbe1687d17b
 8    56029344 d1979f68 ff799f8ac5a17dd3e2182e423ff762c1
                e2747556862b203572a15e02d98cb27805592e73
 9    50278704 75b6b7c7 66d62126aa6a8ca373050b6b249f5da2
                6f822eff53c7c8af407df774b8c8cfb6d9f2bf43
10    54907440 04369a19 d2dbed140b1931eeb46b4ea1dfd7d1ed
                11449694e9bf7822b56ef51dc09f3131f9cac548
11    53009376 4b53b496 d4df387f1cf0ad0d2bbdd48719dc6611
                1959b7c2c20bea28ad106d3df7acacdea94436fc
12    44285808 cbc3e964 d447ded267d8789a659e1f1569c151e7
                ff68191e7055b07f972dd2dc49c3a3a190524b85
13    54639312 4781baf0 0249e5a21bd110e993383906601ebf8c
                38c4fff9cf0ef924cefa60bc54bf77af9f87cc9d
14    55363728 40f2b7ba f632537835fe678eab0ebf276d8e63e2
                1fcb94fffd3e8b34ded0c7f5513ed637edfa4931
15    48989808 eb9d0b03 b4c99d0e6b66153d41c247c6b707aa52
                01eccb50e2d58498da9d226d6a5ce3df27997adf
On semi-vacation. MSF/AMSF to LBA/offset and viceversa calculator: link
To write properly occidental characters contained in japanese titles: screenshot
Spaces must be the fullwidth variant: link / screenshot

3

You are a great quick tester ;-)