bbcim.exe.patch Patch file for -40, -80, -max options of bbcim (Win32 binary) Greg Cook, 21/Mar/2003 For bbcim 0.95 beta 2 (http://www.nvg.org/bbc/util/bbcim095-2-w32.zip) Usage: Either patch the binary manually from the listing, or enter the following Linux commands: mv bbcim.exe bbcim.exe.old xd -c bbcim.exe.old bbcim.exe.hex patch -Np1 < bbcim.exe.patch xd -l bbcim.exe.hex bbcim.exe (xd: http://www.fourmilab.ch/xd/) Corrects a problem with the -40, -80 and -max options of bbcim. The disc image had two excess bytes at the end, containing the new sector count, and consequently the old sector count was not replaced. Append mode only allows writing at the end of the file, and so read/write mode is now used instead. Other versions of the executable (up to 0.97) can be modified in a similar way, as there is only one occurrence of ab+ NB. I am aware of bbcim version 0.97 alpha 27, and having tried it, I don't recommend it. Best wait for the betas or a stable release. strings bbcim.exe.old | grep 0.9 0.95-beta 2 cksum bbcim.exe.old bbcim.exe 2285077706 58368 bbcim.exe.old 571042428 58368 bbcim.exe diff -Naur bbcim.exe.old.hex bbcim.exe.hex --- bbcim.old/bbcim.exe.hex Fri Mar 21 15:08:42 2003 +++ bbcim/bbcim.exe.hex Fri Mar 21 15:10:57 2003 @@ -2979,7 +2979,7 @@ BA20: 69 73 6B 69 6D 61 67 65 0A 0A 00 00 46 69 6C 65 | iskimage....File BA30: 20 25 73 20 63 61 6E 6E 6F 74 20 62 65 20 6F 70 | %s cannot be op BA40: 65 6E 65 64 0A 0A 00 00 61 72 67 73 0A 00 00 00 | ened....args.... - BA50: 61 62 2B 00 75 6E 65 78 70 65 63 74 65 64 20 65 | ab+.unexpected e + BA50: 72 62 2B 00 75 6E 65 78 70 65 63 74 65 64 20 65 | rb+.unexpected e BA60: 6E 64 20 6F 66 20 74 68 65 20 64 69 73 6B 69 6D | nd of the diskim BA70: 61 67 65 20 61 74 20 66 69 6C 65 20 25 73 0A 0A | age at file %s.. BA80: 00 00 00 00 73 74 61 72 74 73 65 63 74 6F 72 20 | ....startsector diff -Naur bbcim.old/expand_im.c bbcim/expand_im.c --- bbcim.old/expand_im.c Mon Jun 30 08:29:14 1997 +++ bbcim/expand_im.c Fri Mar 21 16:19:19 2003 @@ -9,7 +9,7 @@ unsigned char byte, bootoption; long i, length, expand_length; - fpdisk=fopen(disk,"ab+"); + fpdisk=fopen(disk,"rb+"); fseek(fpdisk,0,SEEK_END); length=ftell(fpdisk); expand_length=expand*256; (End of bbcim.exe.patch)