home *** CD-ROM | disk | FTP | other *** search
/ ftp.whtech.com / ftp.whtech.com.tar / ftp.whtech.com / utilities / diskhack.txt < prev    next >
Text File  |  2006-10-19  |  26KB  |  462 lines

  1.    ***************************************************************************
  2.    *                                                                         *
  3.    *            Documentation for Funnelweb Farm FAIRWARE Program            *
  4.    *            ------------- --- --------- ---- -------- -------            *
  5.    *                                                                         *
  6.    *   Program name    :  D i s k   H a c k e r ................. Part one   *
  7.    *                                                                         *
  8.    *   Disk Controller :  TI Controller only.                                *
  9.    *                                                                         *
  10.    *   Version number  :  Vn 1.0                                             *
  11.    *                                                                         *
  12.    *   Author          :  Will McGovern                                      *
  13.    *                                                                         *
  14.    *   Address         :  215 Grinsell St.,                                  *
  15.    *                      Kotara, NSW 2289                                   *
  16.    *                      AUSTRALIA                                          *
  17.    *                                                                         *
  18.    *                                                                         *
  19.    *   IF YOU FIND THIS PROGRAM USEFUL PLEASE SEND A CONTRIBUTION TO THE     *
  20.    *                                                                         *
  21.    *   ABOVE ADDRESS.  PERSONAL CHEQUES FROM OUTSIDE AUSTRALIA PRESENT       *
  22.    *                                                                         *
  23.    *   PROBLEMS.  CASH IS USUALLY SAFE IN FIRST CLASS AIR MAIL.              *
  24.    *                                                                         *
  25.    *                                                                         *
  26.    *   Note : If there is a large enough demand I will rewrite these         *
  27.    *          programs to run with the MYARC and CORCOMP disk controllers.   *
  28.    *        : Do not rename the Disk Hacker files or the program won't load  *
  29.    *                                                                         *
  30.    ***************************************************************************
  31.           
  32.           
  33.    NOTE :  o  This program is released as FAIRWARE, so, if use is made of it a
  34.               contribution to the author would be greatly appreciated. 
  35.           
  36.            o  This program is not capeable of destroying data contained on
  37.               floppy disks unless it is used incorrectly. 
  38.           
  39.            o  No responsibility can be taken by the author for the loss of
  40.               data due to misuse of this program. 
  41.           
  42.                             BRIEF PROGRAM DESCRIPTION 
  43.                             ----- ------- ----------- 
  44.           
  45.          Disk Hacker part one is the only program of its type available to
  46.    the TI community. Disk Hacker is an extremely powerful disk utility which
  47.    allows the user to examine the actual format of each track of a disk. Have
  48.    you ever wanted to get an inside look at the latest protection schemes ?
  49.    Well, Disk Hacker part one allows you to do this, and much more. 
  50.           
  51.    EQUIPMENT REQUIRED TO RUN DISK HACKER                  FILES REQUIRED 
  52.    --------- -------- -- --- ---- ------                  ----- -------- 
  53.           
  54.    32K EXPANSION                  EDITOR/ASSEMBLER        DISKHACKER 
  55.                                   or 
  56.    TI DISK CONTROLLER             EXTENDED BASIC          DISKHACKXB 
  57.                                   or 
  58.    AT LEAST ONE DISK DRIVE        MINI MEMORY             HACKRDOC/1 and 2 
  59.        
  60.                                LOADING DISK HACKER 
  61.                                ------- ---- ------ 
  62.           
  63.    Loading from EDITOR/ASSEMBLER :- 
  64.           
  65.          o  Select Editor/Assembler from main selection screen. 
  66.           
  67.          o  Select LOAD AND RUN from E/A selection screen. 
  68.           
  69.          o  Type DSKn.DISKHACKER. ( n = drive number to load from. ) 
  70.           
  71.          o  Disk Hacker will autostart. 
  72.           
  73.    Loading from MINIMEMORY :- 
  74.           
  75.          o  Select MINI MEMORY from main selection screen. 
  76.           
  77.          o  Select LOAD AND RUN from Minimemory selection screen. 
  78.           
  79.          o  Type DSKn.DISKHACKER. ( n = drive number to load from. ) 
  80.           
  81.          o  Disk Hacker will autostart. 
  82.           
  83.    Loading from EXTENDED BASIC :- 
  84.           
  85.          o  Select Extended Basic from main selection screen. 
  86.           
  87.          o  Type in :    RUN "DSKn.DISKHACKXB" 
  88.           
  89.          o  Disk Hacker will autostart. 
  90.           
  91.           
  92.                               OPERATING DISK HACKER 
  93.                               --------- ---- ------ 
  94.           
  95.          When the Disk Hacker title screen appears, it will stay displayed
  96.    for a few seconds and then the main operating screen will come up. There
  97.    are a few areas of this screen which you must become familiar with before
  98.    you start to use the program. These areas are as follows :- 
  99.           
  100.    o  The operation window is the second window from the top of the screen
  101.       which contains the Disk Analayser Vn 1.0 message.  The function of this
  102.       window is to tell you what the program is doing at any particular time.
  103.       If the 'Disk Analyser Vn 1.0' is being displayed, then the program is
  104.       waiting for your input. Whenever the program halts all you have to do
  105.       read the display in this window to find out what is going on.  Errors
  106.       are also displayed in this window. Therefore, if disk activity stops
  107.       for no reason, read the display in the window to find what has gone
  108.       wrong. 
  109.           
  110.    o  The large space in the middle of the screen, between the two small
  111.       windows, is where the program displays its prompts for the information
  112.       you have to supply for disk analysis, such as number of sides and drive
  113.       number to use. 
  114.           
  115.    o  The final area to be explained is the very bottom line of the screen
  116.       just below the lowest window. This line explains which function keys
  117.       are active at any particular time. The only time that the function keys
  118.       are not displayed is when you are in analysis mode. This will all be
  119.       expained further on. 
  120.        
  121.    Answering the Prompts 
  122.    --------- --- ------- 
  123.           
  124.          Now that you understand the basic functions of the important areas
  125.    of the initial screen we can proceed to the next stage, answering the
  126.    prompts that the program gives you. 
  127.          You probably noticed that when the title screen vanished and the
  128.    initial screen appeared that the question 'Drive number [1-3] :' appeared
  129.    in the prompt area. This is the first of the five prompts you will have to
  130.    answer before you can begin the analysis. The information asked of you may
  131.    seem complicated when you first start but you'll eventually be able to
  132.    understand and answer the prompts quite easily. The next section will be
  133.    devoted to explaining each of the prompts and showing you how to answer
  134.    them. 
  135.           
  136.    o  Drive number [1-3] 
  137.           
  138.          This is the simplest of the questions you have to answer. All that
  139.       you have to do is enter the number of the drive you wish to use. This
  140.       value must be between 1 and 3 because 3 is the maximum number of drives
  141.       that the TI controller can handle. 
  142.           
  143.       EXAMPLE :  Drive number [1-3] : 1 <enter> selects drive one as the 
  144.                                                 drive you wish to work on. 
  145.           
  146.           
  147.    o  [S]ingle or [D]ouble sided 
  148.           
  149.          This prompt simply asks you whether the drive you have selected is a
  150.       single or double sided drive. ( ie. Whether the drive has a second head
  151.       to read the second side of the disk. NOTE : If you have to flip the
  152.       disk over ( FLIPPY ) to use the second side of the disk then the drive
  153.       is still only single sided ) You answer this prompt with 'S' for single
  154.       sided or a 'D' for double sided. If you choose single sided then the
  155.       program will not be able to analyse the tracks on the second side of
  156.       the disk. If double sided is selected then it makes reading the second
  157.       side of the disk possible. 
  158.           
  159.       EXAMPLE :  [S]ingle or [D]ouble sided : S <enter> selects single sided 
  160.                                                         operation. 
  161.           
  162.                  [S]ingle or [D]ouble sided : D <enter> selects double sided 
  163.                                                         operation. 
  164.           
  165.           
  166.    o     To fully understand the next two prompts you must first understand
  167.       how the tracks on a floppy disk are arranged. Here is a brief
  168.       explanation of this structure. 
  169.           
  170.          On a normal TI/99/4(a) compatible disk you have 40 tracks on each
  171.       side of the disk. On each side the tracks are numbered from 0 -> 39
  172.       inclusive, with track 0 being furthest from the hub ring in the centre
  173.       and track 39 being closest to the centre. The diagram shows how the
  174.       tracks are arranged on a normal double sided disk. For single sided
  175.       drives the format is exactly the same except that the drive is not
  176.       capeable of reading or writing from or to the second side. 
  177.     
  178.       Diagram 1.  Normal floppy disk format. 
  179.           
  180.                                      sector # 
  181.                       359  <--------------------------    0 
  182.  
  183.                                      track # 
  184.            CENTRE} ---39   <--------------------------    0 <--SIDE 1 
  185.            HUB   }}---------------------------------------- <--DISK SURFACE 
  186.            RING  } ---39   <--------------------------    0 <--SIDE 2 
  187.                                      track # 
  188.           
  189.                       360  -------------------------->  719 
  190.                                      sector # 
  191.           
  192.    o  Starting track 
  193.           
  194.          The process of entering track numbers in Disk Hacker is very simple.
  195.       For single sided operation you enter exactly what you would expect, a
  196.       number between 0 and 39. Numbers outside these limits will be rejected.
  197.       For double sided operation however, to make it easy to enter track
  198.       numbers for the second side, a new system is used. The tracks on the
  199.       second side, instead of being numbered 0 to 39 and clashing with the
  200.       side 1 track numbers, they have been renumbered as tracks 40 to 79.
  201.       Therefore, the track numbers on side 1 are from 0 to 39 and the track
  202.       numbers on side 2 are from 40 to 79. ( ie. Track 40 is really track 0
  203.       on side 2 ). So, the limits for the entry in double sided mode are 0 to
  204.       79. 
  205.       EXAMPLE : Starting track : 10 <enter> selects the starting track as 
  206.                                             track 10 on side ONE. 
  207.           
  208.                 Starting track : 50 <enter> selects the starting track as 
  209.                                             track 10 on side TWO. 
  210.           
  211.    o  Stopping track 
  212.           
  213.          Exactly the same system applies for entering the stopping track
  214.       number as for the starting track number. (ie) Single sided 0 -> 39,
  215.       Double sided 0 -> 79. 
  216.           
  217.    o     The next prompt is is a very advanced, but complicated, feature of
  218.       Disk Hacker. Before you just answer 'Y' or 'N' I will try to explain in
  219.       easy terms the meanings of the two aspects of sectors involved in this
  220.       prompt, CRC's and Data Marks. 
  221.           
  222.          A standard, non-protected track on a TI/99/4(a) floppy disk contains
  223.       9 sectors each of 256 bytes length. On the track there is space between
  224.       each sector which contains a special series of information bytes called
  225.       an address or HEADER. Addresses will fully explained further on in this
  226.       documentation. Somehow, the disk controller must be able to locate
  227.       where the end of this gap is, which is where the sector starts. To find
  228.       the start of the sector the disk controller looks for a special 'mark'
  229.       written on the disk when it was formatted. This 'mark' tells the
  230.       controller that it is at the end of the inter-sector gap and that the
  231.       read/write head is positioned at the start of the sector data. This
  232.       'mark' is called a DATA ADDRESS MARK and can be in two different forms,
  233.       normal or deleted. The TI controller uses only normal data address
  234.       marks but some copy protection techniques use sectors with the deleted
  235.       data address marks, which cannot be created using normal disk access
  236.       methods. Therefore, to check if the disk is an original all they have
  237.       to do is check to see if the deleted marks are there. DISK HACKER WILL
  238.       TELL YOU WHICH SECTORS ON A TRACK HAVE DELETED DATA MARKS AND WHICH
  239.       HAVE NORMAL DATA MARKS. 
  240.        
  241.          CRC is short for CYCLIC REDUNDANCY CODE and it a very common method
  242.       of checking for errors in a data stream. A CRC can be thought of as
  243.       just a complicated checksum. Each sector has two 2 byte CRC error check
  244.       codes, one for the sector address and one for the sector data. If a CRC
  245.       for the sector is incorrect then it becomes a 'bad' sector, gives an
  246.       error code and cannot be read using the TI-DSR. DISK HACKER WILL CHECK
  247.       THE HEADER AND THE DATA CRC'S AND TELL YOU WHICH OF THE SECTORS HAVE
  248.       CRC ERRORS. 
  249.           
  250.    o  Check marks and CRC's [Y/N] 
  251.           
  252.          This prompt asks whether or not you wish to check for deleted data
  253.       marks and data CRC errors. Header CRC's are checked automatically and
  254.       marked even if you answer 'N' to the prompt. If you select 'Y' then the
  255.       analysis will take approximately twice as long as it would without the
  256.       checking, but the information gained can be invaluable. 
  257.           
  258.           
  259.    ANALYSING THE DISK 
  260.    --------- --- ---- 
  261.           
  262.          Now that you have given the program all the information it needs to
  263.    know you can start the disk analysis procedure. After you have pressed
  264.    enter for the last prompt the message 'PRESS SPACEBAR TO BEGIN ANALYSIS'
  265.    will appear in the operation window. When you press the spacebar the
  266.    selected drive will start up and the operation window will start to
  267.    display the current track and side number. All the information you entered
  268.    in the information area will stay displayed so you can remember what
  269.    responses you made to the prompts. The track count will begin at the start
  270.    track you entered and stop when it reaches the specified stop track. 
  271.           
  272.    NOTE : If you feel that you have made an incorrect entry in the
  273.           information area don't worry. DISK ACTIVITY MAY BE TERMINATED AT
  274.           ANY TIME BY PRESSING FCTN 4 ( BREAK ). HOLD THE BREAK KEY DOWN
  275.           UNTIL THE PROGRAM CONFIRMS THAT THE COMMAND HAS BEEN TERMINATED. 
  276.           
  277.          When the track count reaches the specified stop track the program
  278.    will inform you that the analysis has been completed and will then go into
  279.    the next stage of operation, your viewing of the information. 
  280.           
  281.          This concludes the section explaining the loading details, prompts,
  282.    and the analysis process. The next file will completely document the
  283.    details and use of the next stage of Disk Hacker, the information viewer. 
  284.     
  285.                              VIEWING THE INFORMATION 
  286.                              ------- --- ----------- 
  287.           
  288.          Now that the analysis has been completed and there is no disk
  289.    activity you go into the second stage. The second stage is a system
  290.    designed to allow you to view all the information obtained from the
  291.    analysis in an easy to understand, easy to read format. All the
  292.    information is displayed in a columnar arrangement with each row
  293.    representing one sector from the track and one track taking one full
  294.    screen. 
  295.          If we start at the top of the screen and work down explaining as we
  296.    go then you will achieve the best understanding of what is actually being
  297.    displayed. 
  298.           
  299.    o  At the very top of the display window we have the TRUE physical
  300.       information for the track. First, the drive number that the track was
  301.       analysed from is displayed, then the physical side of the disk on which
  302.       the track is located, and the physical number of the track the
  303.       information was read from. 
  304.           
  305.    o  The next row of information displayed is the actual number of sectors
  306.       found on the track. This saves you from the annoyance of having to
  307.       count the number of rows displayed in the display area. 
  308.           
  309.          Before we go on to the next set of information you should understand
  310.    the concept of addresses. When a track is formatted the sectors are
  311.    arranged so as to be uniformly distributed about the track. To do this,
  312.    especially on the longer outside tracks of the disk, a space must be left
  313.    between each sector to give the disk controller time to get ready for
  314.    reading the next sector. Preceeding each sector in this inter-sector gap
  315.    is an ID address field or address for short. This address consists
  316.    of six bytes containing information about the proceeding sector, this
  317.    being track number, side number, sector number, sector length and CRC
  318.    bytes in respective order. The CRC bytes are a precaution so we can tell
  319.    if the address read has not been read correctly. The disk controller must
  320.    be able to locate this address in the inter-sector gap, so, when the track
  321.    is formatted a special 'mark', like the data address mark, is placed
  322.    directly before the address. When the controller locates this mark in the
  323.    gap it knows that the following six bytes are the ID address field bytes. 
  324.           
  325.           
  326.    DIAGRAM : Structure of one ninth of a normal TI disk track. 
  327.              (ie) Only one of the nine sectors is shown with associated gaps. 
  328.           
  329.             >DATA<                         >DATA< 
  330.             >MARK<                         >MARK< 
  331.     ______________________________________________________________________ 
  332.     ! gap 1 ! DM ! TK!SD!SC!LN!CRC ! gap 2 ! DM ! sector data ! data CRC ! 
  333.     ---------------------------------------------------------------------- 
  334.                  >>>ADDRESS FIELD<<< 
  335.           
  336.           
  337.          Now that the concept of addresses has been explained we can go on to
  338.    explain the display between the two lines across the window. All these
  339.    symbols are abbreviations of parts of the ID address field and terms used
  340.    to describe certain aspects of sectors. Here is an expanded list of what
  341.    all these symbols stand for :- 
  342.     
  343.    o  TRK  stands for TRACK NUMBER. This track number is the number obtained
  344.            from the address field. This does not necessarily have to contain
  345.            the same number as the physical track number displayed at the top
  346.            of the screen but on normal TI disks it is always the same,
  347.            otherwise it is unreadable by the standard disk DSR. 
  348.           
  349.    o  SID  stands for SIDE NUMBER. The side number is obtained from the
  350.            address field and if it is 0 then the sector is saying it is on
  351.            side 1. If it is 1 it says it is on side 2. As with the track
  352.            number the address side number does not have to correspond to the
  353.            physical side number that the track is on but any normal TI disk
  354.            has the correct value. 
  355.           
  356.    o  SEC  stands for SECTOR NUMBER. On any TI-DSR readable disk the sector
  357.            numbers from the address field for the 9 sectors range from 0 to 8
  358.            inclusive. ( ie. Every track has a set of 9 sectors, each with a
  359.            unique number between 0 and 8 ). However, the sector number can
  360.            vary from 0 to 255 but no normal TI track contains sector numbers
  361.            above 8. The column of sector numbers is the sector interlace. 
  362.           
  363.    o  LGTH This stands for LENGTH of the sector. Any normal TI-DSR compatible
  364.            disk contains sectors of length 256 bytes. However, it is possible
  365.            to create sectors of other lengths. Disk Hacker will display the
  366.            length of every sector it finds. If Disk Hacker runs across a
  367.            sector of indeterminate length it will display 'inv', for invalid,
  368.            in place of the length. 
  369.           
  370.    o  CRC  This column contains the 2 header CRC bytes from the ID address
  371.            field. The CRC bytes, if correct, indicate a valid header, if
  372.            incorrect then the header contains an error. Disk Hacker checks
  373.            this header CRC and tells you if it is invalid. If the header CRC
  374.            is incorrect a small arrow appears to the left of the CRC value
  375.            for the sector. 
  376.           
  377.          These next two columns only display any information if you responded
  378.    to the 'Check marks and CRC's [Y/N]' with a 'Y', as they refer to sector
  379.    data and not header data. 
  380.           
  381.    o  M    stands for DATA MARK. The information displayed in this column
  382.            tells you whether the data mark for any particular sector on the
  383.            track is a DELETED data mark. If a deleted data mark is detected
  384.            for a sector then a 'D' is displayed in the column on that
  385.            sector's row. If the data mark is normal then nothing is displayed
  386.            in the column, making it easy to spot the sectors with DELETED
  387.            DATA MARKS. 
  388.           
  389.    o  C    stands for DATA CRC. If the data in the sector does not produce
  390.            the correct CRC then there is a DATA CRC error. If there is a data
  391.            CRC error for a particular sector then an 'E', for error, is
  392.            displayed in this column. If there is no error then nothing is
  393.            displayed, making it easy to spot DATA CRC errors. 
  394.           
  395.    NOTE :  There are two special cases which affect the display in this
  396.            column. They are these :- 
  397.           
  398.            o   If 'inv' is displayed in the length column ( invalid length )
  399.                then no data is displayed in the M and C columns because it is
  400.                impossible to check for this information. 
  401.                 
  402.            o   If no data address mark can be found after the address ( ie.
  403.                no sector data, fake ID field ), then 'RNF' is displayed
  404.                across the M and C columns. 
  405.     
  406.    PAGING THROUGH THE INFORMATION 
  407.    ------ ------- --- ----------- 
  408.           
  409.          Because only one track is displayed per screen, if you analysed more
  410.    than one track then you must 'page' through the track information. Because
  411.    all tha analysis has already been done the disk does not have to turn on
  412.    again unless you wish to analyse another disk. To page through the
  413.    information for each track use the FCTN E and FCTN X keys. FCTN X pages
  414.    forward through the tracks and FCTN E pages back through the tracks. Note
  415.    that as you page through the tracks the information at the top of the
  416.    screen is also updated. The track number at the top is handy if you want
  417.    to compare the address track numbers in the data area to the real,
  418.    physical track number. 
  419.           
  420.          The physical track number at the top does not go past 39, even if
  421.    you specified double sided track numbers above 39, because the address
  422.    track numbers start at zero again when they start on the second side. (
  423.    see diagram in first file ) So, when the physical track counter exceeds
  424.    track 39 on side 1 it starts again from track 0 on side 2 so you can
  425.    easily compare the address track numbers with the physical track number
  426.    without having to subtract 40 all the time. 
  427.           
  428.           
  429.    DECIMAL / HEXADECIMAL TOGGLING 
  430.    --------------------- -------- 
  431.           
  432.          While examining the information you may find it more convenient to
  433.    look at the information in hexadecimal rather than decimal. If you press
  434.    FCTN 6 you will toggle between DECIMAL and HEX. The header CRC bytes are
  435.    always displayed in HEX because they are of no use in decimal. 
  436.           
  437.           
  438.    FUNCTION KEYS FOR DISK HACKER 
  439.    -------- ---- --- ---- ------ 
  440.           
  441.    Press at any time    :  CTRL =  -------> QUIT DISK HACKER 
  442.    ( not while disk on )   FCTN 9  -------> GO TO DISK HACKER TITLE SCREEN 
  443.                            FCTN 8  -------> GO TO DISK HACKER INITIAL SCREEN 
  444.           
  445.    Cursor function keys :  FCTN 1  -------> DELETE CHARACTER 
  446.                            FCTN 2  -------> INSERT SPACE 
  447.                            FCTN 3  -------> ERASE LINE 
  448.                            FCTN S  -------> MOVE CURSOR BACK ONE CHARACTER 
  449.                            FCTN D  -------> MOVE CURSOR FORWARD ONE CHARACTER 
  450.           
  451.    During disk activity :  FCTN 4  -------> TERMINATE DISK ACTIVITY 
  452.           
  453.           
  454.          REMEMBER, THIS IS ONLY DISK HACKER PART ONE. PART TWO WILL DIG EVEN
  455.    DEEPER INTO TRACKS. 
  456.           
  457.           
  458.                                                                THANKS, 
  459.           
  460.                                                                WILL McGOVERN 
  461.  
  462.