• Dr. Evil Laboratories

  • by kentsu

This blog recounts the history of Dr. Evil Laboratories, the creator, manufacturer, and retail sales of peripherals and software for the Commodore 64, including the Imagery! adventure game system, the SID Symphony Stereo cartridge, and the Swiftlink-232 cartridge.


How to Forensically Repair a Corrupted .D64 Image

Do you have an image of a 1541 disk that has special meaning, but it has corruption (bad sectors)? Learn how to repair the image by replacing the bad sectors in place, without disturbing the placement of any of the data.

In the Sidplayer music scene during the 1980s and 1990s, in-person gatherings of Sidplayer enthusiasts, known as SIDfests, happened regularly, about 10 times in total. Each gathering generally had one or more 1541 disks of music released during the event. I have been on a mission to locate as many original disks as possible and make .D64 images of them, for historical preservation purposes. (These images will be part of the Compute!'s Gazette Sid Collection in the near future.)

Amazingly, most of the disks I have found were in really good shape, so I was able to make images of them (using OpenCBM, CBMXfer and ZoomFloppy) easily. Some of the disks, however, had degraded, with one or more bad sectors (error code 23, read error, in CBM DOS). After much searching, I was able to locate clean copies of all of the affected files (thanks to several sources, including SceneBase.org and CBM8Bit.com's Disk Image Search, with an extra-special thanks to Jason Whitener, aka DemongerX).

Because these disks have special significance to Sidplayer history, I took the approach of changing as little of each disk image as possible to fix the corruption. That meant I didn't want to scratch a file with bad sectors then copy over a replacement, because the individual sectors could end up in very different places within the image, as compared to their locations on the original disk.

Therefore, with the help of several PDXCUG members, especially Goog, Agent Friday, and Piña Colada, I learned about several cool tools for doing "surgery" on the images. This video gives a short demo of the sector replacement procedure:

Here are links to the tools discussed in the video:

.D64 file format descriptions

.D64 image offset table (this is a PDF)


D64 Editor


I converted the .D64 image offset spreadsheet to a PDF since not everyone has easy access to Excel.

Please comment with any questions you have. I'm also interested in methods you use to fix bad disk images.

Leave a Comment

You must be signed-in to post comments.