| 1 |
cd5 |
| 2 |
=== |
| 3 |
|
| 4 |
Quick and dirty program to compute checksum of individual track |
| 5 |
|
| 6 |
It reports for each track: |
| 7 |
- size (read) |
| 8 |
- MD5 digest |
| 9 |
|
| 10 |
Version: |
| 11 |
-------- |
| 12 |
|
| 13 |
- 0.1 (first written and released version) |
| 14 |
|
| 15 |
Supports: |
| 16 |
--------- |
| 17 |
|
| 18 |
- multi track CD-ROM |
| 19 |
- mode 1 |
| 20 |
- Linux ioctl() |
| 21 |
- libmhash |
| 22 |
|
| 23 |
Doesn't support: |
| 24 |
---------------- |
| 25 |
- DVD |
| 26 |
- Audio CD |
| 27 |
- Multi session |
| 28 |
- Other operating system |
| 29 |
|
| 30 |
TODO: |
| 31 |
----- |
| 32 |
- support options |
| 33 |
- support other track format |
| 34 |
- support multi session |
| 35 |
- support other interfaces (ioctl, packet, ...) |
| 36 |
- support other OS |
| 37 |
|
| 38 |
Known problem: |
| 39 |
-------------- |
| 40 |
- Track are often bigger than the data written inside |
| 41 |
The program will report an error at the end of the data |
| 42 |
I don't know the way to detect the end of data. |
| 43 |
The checksum is good, and the size too. |
| 44 |
|
| 45 |
Be aware: |
| 46 |
--------- |
| 47 |
- Track shorter than 4s -> 300 frames -> 614400 bytes are padded |
| 48 |
To check the checksum, pad the img/iso file to 614400 and run md5sum |
| 49 |
|
| 50 |
Requires: |
| 51 |
--------- |
| 52 |
|
| 53 |
To build and run cd5, you need libmhash, or port it to OpenSSL, |
| 54 |
Gcrypt or other. |
| 55 |
|
| 56 |
Build: |
| 57 |
------ |
| 58 |
|
| 59 |
Run "make" or |
| 60 |
|
| 61 |
gcc -W -Wall cd5.c -o cd5 -lmhash |
| 62 |
|
| 63 |
Example: |
| 64 |
-------- |
| 65 |
|
| 66 |
$ ./cd5 |
| 67 |
|
| 68 |
Track 1 to 3 (3 tracks) |
| 69 |
ioctl(/dev/cdrom, CDROMREADMODE1(1277)) failed: Input/output error |
| 70 |
Track 1, data, 0 + 1429 | 2615296 22597f64d164d509ef988b4ae97d3ad2 |
| 71 |
ioctl(/dev/cdrom, CDROMREADMODE1(1729)) failed: Input/output error |
| 72 |
Track 2, data, 1429 + 452 | 614400 c8605c7db3dd78fba70c2030d339f22b |
| 73 |
ioctl(/dev/cdrom, CDROMREADMODE1(4001)) failed: Input/output error |
| 74 |
Track 3, data, 1881 + 2272 | 4341760 8084e5945813a02415d08fb027d9ea97 |
| 75 |
|
| 76 |
For the ioctl() errors, see above. |
| 77 |
Just check that track size match ISO file size (except for file under |
| 78 |
614400 bytes). |
| 79 |
One rule: if digest mismatch there's an error. |
| 80 |
|
| 81 |
Author: |
| 82 |
------- |
| 83 |
|
| 84 |
Yann Droneaud <[email protected]> |
| 85 |
|