Technical Reference

Appendix Q

Q.1   UNPROTECTING DISCS

If you have ever accidentally re-saved your basic program onto disc in protected mode, overwriting your existing source program, it is possible to recover it.
Below is a sample session.

A>MSBASIC                                                                 
BASIC-86 Rev. 5.27
[MS-DOS Version]
Copyright 1977-1982 (C) by Microsoft
Created: 8-Nov-82
62281 Bytes free
Ok
load"PINSTALL"        ** load in protected program MSBASIC will 
                         find the first byte read is 'FE', this
                         tells BASIC that it must unscramble the
                         following program
Ok
new                   ** type new, this does not erase the program
                         but inserts 3 bytes '00 00 00' at the 
                         start of memory for program storage.
                         These 3 bytes normally are at the end of
                         your program to signify it's end mark.
Ok
def seg:bsave"PROG",2700,50000
                      ** this sets the default segment and saves a  
                         block of memory to disc. Within this block
                         is your program in it's unscrambled form
Ok
system                ** exit to the operating system

A>debug prog          ** load DEBUG and your saved memory block

DEBUG-86  version 1.07
>d                            ** display memory from 0100
05A7:0100  FD 79 0A 8C 0A 50 C3 00-00 00 00 00 00 00 00 00   }y...PC.........
05A7:0110  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
05A7:0120  64 00 3A 8F DB 00 B3 0A-6E 00 3A 8F DB 00 C4 0A   d.:.[.3.n.:.[.D.
05A7:0130  78 00 3A 8F DB 20 50 49-4E 53 54 41 4C 4C 00 05   x.:.[ PINSTALL..
05A7:0140  OB 82 00 3A 8F DB 20 54-68 69 73 20 70 72 6F 67   ...:.[ This prog
05A7:0150  72 61 6D 20 69 6E 73 74-61 6C 6C 73 20 76 61 72   ram installs var
05A7:0160  69 6F 75 73 20 70 72 69-6E 74 65 72 73 20 66 6F   ious printers fo
05A7:0170  72 20 57 6F 72 64 53 74-61 72 20 33 2E 30 32 00   r WordStar 3.02./
                              ** at address 011D are the 3 bytes that were
                                 inserted after the 'new' command, so by 
                                 placing a 'FF' byte at 011E we are setting
                                 the normal unprotected first byte
>e011e
05A7:011E  00.ff
>nprog.bas                    ** rename the program with a .BAS extension
>w011e                        ** write the program back to disc from 011E
                                 this will then have 'FF' as the first
                                 byte of the program on disc.
>q                            ** exit DEBUG utility

Load MSBASIC again and load "PROG". After the program loads type list. Your program will start to list but the first line will have some odd large number this is because the original line number was overwritten by the 3 bytes inserted with the 'new' command. This line can be edited as well as the remainder of our program. After the editing the program may be resaved in the normal manner in either binary or ascii mode.

BACK


All contents of this website (including text, images, design, and presentation) are Copyright � 1999-2004,
ACT Sirius 1 User Group (UK) unless explicity stated otherwise. All Rights Reserved.
E-Mail: siriususer@eurobell.co.uk

Last revision 22/01/2003