Pages

Saturday, June 1, 2013

Convert bin/cue into iso

If you ever need to convert a cue/bin image into an iso image then bchunk might be the right software to use. First get the source by running wget:

# cd /usr/src
# wget -c "http://he.fi/bchunk/bchunk-1.2.0.tar.gz"


Then extract the source package and change into the source directory: 

# tar xf bchunk-1.2.0.tar.gz
# cd bchunk-1.2.0


Just run make to create the bchunk binary (or run the two following gcc statements):

# make
gcc -Wall -Wstrict-prototypes -O2 -c bchunk.c
...
gcc  -o bchunk bchunk.o


Check that the bchunk binary was created:

# ls -lah bchunk
-rwxr-xr-x 1 root root 19K Jun  1 11:11 bchunk*


And move it to /usr/local/bin/:

# mv bchunk /usr/local/bin/

Finally you can convert the cue/bin image into an iso image. The options are the following:

-w: create wav files for audio tracks
image.bin: the image file
image.cue: table of contents for the above image file
image.iso: the new iso file containing the date (no audio)

A sample command can look like this:

# bchunk -w image.bin image.cue image.iso
binchunker for Unix, version 1.2.0 by Heikki Hannikainen <hessu@hes.iki.fi>
        Created with the kind help of Bob Marietta <marietrg@SLU.EDU>,
        partly based on his Pascal (Delphi) implementation.
        Support for MODE2/2352 ISO tracks thanks to input from
        Godmar Back <gback@cs.utah.edu>, Colas Nahaboo <Colas@Nahaboo.com>
        and Matthew Green <mrg@eterna.com.au>.
        Released under the GNU GPL, version 2 or later (at your option).

Reading the CUE file:

Track  1: MODE1/2352    01 00:00:00
Track  2: AUDIO         01 19:34:33
Track  3: AUDIO         00 22:49:01 01 22:51:01
Track  4: AUDIO         00 23:52:74 01 23:54:74
...
Track 22: AUDIO         00 39:01:62 01 39:03:62

Writing tracks:

 1: image.iso01.iso  172/172  MB  [********************] 100 %
 2: image.iso02.wav   32/32   MB  [********************] 100 %
 3: image.iso03.wav   10/10   MB  [********************] 100 %
 4: image.iso04.wav   20/20   MB  [********************] 100 %
...
22: image.iso22.wav   10/10   MB  [********************] 100 %


At first the iso (image.iso01.iso) itself will be written followed by the wav files (image.iso02.wav - image.iso22.wav).

Links:
http://he.fi/bchunk/