home *** CD-ROM | disk | FTP | other *** search
/ The Unsorted BBS Collection / thegreatunsorted.tar / thegreatunsorted / programming / misc_programming / qa.doc < prev    next >
Text File  |  1990-03-18  |  39KB  |  757 lines

  1.                              Quaid Analyzer
  2.                                 May 1988
  3.  
  4.  
  5.  This progran allows diagnosis of programs for IBM computers, especially
  6. programs for which the source is unavailable, or which contain
  7. countermeasures to thwart tracing of their functions. You can single
  8. step thru a program and follow the processor instructions and registers.
  9. Virtually all areas of memory are available for your inspection. 
  10.  
  11.  
  12. Common Keys
  13.   These keys are effective everywhere.
  14.  
  15. ESC   This will get you out of an area and eventually bring you back to
  16.       the Main Menu.
  17. F1    Help key
  18. F2    Brings up Instruction Display
  19. F3    Vector Display
  20. F4    Trace Display
  21. F5    ACSII Table
  22. F6    Users Screen. This is what was interrupted.
  23. F7    Exit. This is the same as selecting EXIT TO USER at the Main
  24.       Menu when QA has intervened, or the same as EXIT TO DOS when
  25.       QA is in temporary memory.
  26. PGUP  Up one line
  27. PGDN  down one line
  28. HOME  Cursor to top or back one screen
  29. END   Cursor to bottom or foward one screen.
  30.  
  31.  
  32.                     Invoking Quaid Analyzer
  33.  
  34.   You have to pay attention to where Quaid Analyzer is located in memory,
  35. since it must not interfere with the software being diagnosed.
  36.  
  37.     The command QA at the DOS prompt puts Quaid into
  38.     temporary memory. You will see the Main Menu. Temporary
  39.     memory is relinquished when you select EXIT TO DOS.
  40.     
  41.     The command QA followed by a hexadecimal interrupt number (5
  42.     is most common) puts Quaid into permanent memory with the 
  43.     specified interrupt patched. You will see the DOS prompt almost
  44.     immeadiatly. Therafter, Quaid Analyzer will intervene whenever
  45.     the patched interrupt occures. Quaid will remain memory resident
  46.     until you reboot or you select EXIT TO DOS on the Main Menu.
  47.     
  48.   When running QA from permanent memory, interrupt 5 is the most
  49. convient patch. Then you can press PRTSC to bring up Quade Analyzer.
  50.  
  51.  
  52.  
  53.                             Main Menu
  54.  
  55. The Main Menu lets you select one of the functions of the Quaid Analyzer.
  56. Continued pressing of ESC will bring up the Main Menu from anywhere in
  57. Quaid Analyzer.
  58.  
  59. DESCRIPTION
  60. The Main Menu has a column of functions, and for most of the functions, one or
  61. more options to the right. Some fixed information appears to the left of a
  62. vertical bar. Some of the functions, such as BREAKPOINT, appear only when they
  63. are allowed.
  64.  
  65. MENU KEYBOARD CONTROL
  66.  
  67. Quaid uses a Main Menu, and several other screens where you have the option of
  68. moving a cursor and selecting functions. You may find the method of control to
  69. be unfamiliar, but when you learn it you can operate it quickly.
  70.  
  71. In general, you press the four cursor arrows to get to a function or an option,
  72. press + and - to the right of the numeric keypad to change an option, and press
  73. ENTER to carry out a function after you have set its options. You can control
  74. lots of options without a cluttered screen.
  75.  
  76. UP & DOWN KEYS      Use these keys to choose a function.
  77.  
  78. LEFT & RIGHT KEYS   For the functions that have more than one option, use 
  79.                     these keys to highlight one of the options.      
  80.  
  81. +  -                Use these keys to change an option after you have reached
  82.                     it. Be sure to use the + and - to the right of the numeric
  83.                     keypad, not the typewriter keys with the same symbols.
  84.  
  85. ENTER               Use ENTER to carry out a function after you have set its
  86.                     options.
  87.                     
  88. ESC                 Get directly to the EXIT function.
  89.  
  90. 0 to F              When a number appears in an option, you can change it with 
  91.                     these keys. The key you press is appended to the end of the
  92.                     number.
  93.                     
  94. BACK                When the cursor is on a number or the File Name, this key
  95.                     erases the last character.
  96.                     
  97.  
  98. MENU FUNCTIONS
  99.   EXIT
  100.     Select this function to get out of Quaid Analyzer. The options are:
  101.     
  102.     - TO USER. When QA intervenes in a user program, EXIT TO USER
  103.       resumes execution of the interrupted program as if QA had
  104.       not intervened.
  105.     - RESIDENT. Select this option to get QA to use the terminate 
  106.       process and remain resident function, putting it in permanent
  107.       memory. Thereafter, QA will intervene any time one of
  108.       the patched interrupts occurs.
  109.     - TO DOS. This option relinquishes the permanent or temporary
  110.       memory occupied by QA.
  111.  
  112.   BREAKPOINT
  113.       When you have set permanent breakpoints, you can choose any
  114.       breakpoint by pressing  + .  ENTER shows you the chosen 
  115.       breakpoint on the Instruction Display.
  116.   
  117.   AUXILIARY
  118.     Using the options, then ENTER, you can get reports showing the state
  119.     of your computer.
  120.     - MAP. Shows the DOS memory allocation.
  121.     - UART. Shows the registers in the two serial ports. Reading the
  122.       IIR, interrupt identification register, clears any interrupts
  123.       pending, so the state of the serial port may change as a result
  124.       of the display. This is usually not serious.
  125.     - DISKETTE. Interprets the contents of the diskette parameter area,
  126.       pointed to by vector 1E hex.
  127.     - DRIVERS. Displays a list of device drivers known to DOS.
  128.     - CMOS. Shows your computer from ROM identification byte.
  129.     - SCREEN. Displays screen mode from BIOS info.
  130.       
  131. PORT
  132. At this line you may read, change, or monitor the contents of any i/o port.
  133. The first option may be:
  134.       - OFF.    Does nothing
  135.       - READ.   ENTER reads the port, displaying it's contents.
  136.       - WRITE.  ENTER writes the data value to the port.
  137.       - TRACE.  ENTER runs the user program until the user refers to the port.
  138.                 The Trace option does not appear in temporary. The trace will
  139.                 not stop when the port reference occurs in a lower level of 
  140.                 interrupt service, or if it occurs after an event that ends
  141.                 single stepping. You should get near the your problem using
  142.                 other methods before using TRACE. 
  143.  
  144. The second option is the data value to be sent to the port, or the value read
  145. in from the port in hex.
  146.  
  147. The third option is the port number in hex. To the right of this field is the
  148. name of the device on the port.
  149.  
  150.  
  151. FILE
  152. Use this function to read and write DOS files. The first option may be:
  153.  
  154.     - ENABLE. Quaid can intervene while DOS is in operation, and at such times
  155.       it is impossible to read or write files. When you select ENABLE, Quaid
  156.       exits to the user until DOS reaches a point where it can be called.
  157.       Quaid patches interrupt 28 hex DOC scheduler, to find out when it is
  158.       safe to call DOS.
  159.       
  160.     - OFF. This function does nothing.
  161.     
  162.     - READ. Read an entire file into memory. You can also read part of a file.
  163.     
  164.     - CREATE. Create a new file.
  165.     
  166. The actions above take place when you press ENTER.
  167.  
  168. The second option, File Origin, is the memory address corresponding to the
  169. beginning of the file. Use H to change between decimal and hexadecimal. The P
  170. key puts the data point (from the Program Display) into the File Origin.
  171.  
  172. The third option is the length of the transfer. For READ, this is normally TO
  173. END,meaning that the whole file is to be read. To read only part of it, put the
  174. cursor on the length field and press W, then edit in the length.
  175.  
  176. To reduce interference with the program being traced, we do not use the
  177. interrupts for getting control of DOS errors. Consequently, you may see the
  178. message  Abort,Retry,Fail?  on the screen. A  will abort the program being
  179. traced. To avoid problems, you should make sure the file you want to use will
  180. not cause errors before using the file facilities.
  181.  
  182. FILE NAME
  183. This appears only when the first File option is READ or CREATE. Key in the file
  184. name here. Be sure to include the drive and directory path as part of the name,
  185. because you have no control of what the current DOS defaults are. Use the BACK
  186. key to correct mistakes in the name.
  187.  
  188. HELP
  189. This is just a license screen. The LIGHT BULB option sets the entire screen to
  190. its brightest value, to help you read your notes when you work past sundown.
  191.  
  192. SCREEN
  193. The first option is FAST or SLOW. On the IBM CGA Fast will produce snow. Use
  194. RIGHT ARROW to get samples of the colors used for Quaid displays. You can
  195. change the colors with + and - or ENTER.
  196.  
  197.  
  198.   
  199.                                Program Display          
  200.  
  201.     The Program Display shows the processor registers, and lets you see
  202. memory as text or instructions. you can change the contents of memory
  203. or the registers. The F2key brings you to the Program Display.
  204.     The display is subdivided into a register area, always visable, and
  205. the Instruction Display, Memory Display and Reference Display, which
  206. overlay each other.
  207.  
  208. REGISTER AREA
  209.   Press  ESC  from the Memory Display or the Instruction Display
  210.   The left side of the screen shows the names and values of the processor
  211. registers and a few other fields. The lines marked DATA and CODE are called the
  212. data point and the code point. (These fields are used to move to other 
  213. memory locations)
  214.   Below cs:ip is the sixteen bit flags register, with the bit names above
  215. each. You can change these bits the same way you change the other registers.
  216.   Below the flags is a search field. +  changes this between hex and text
  217. format. To key in a search field in either format, press INS, then type in your
  218. search string. Do not press ENTER after the search string. The hex string is in
  219. Arabic form, right to left. Search for occurences starting from the data point
  220. by pressing  L . When you search for a string that does not occur in the
  221. remainderof the data segment, nothing changes.
  222.   The register values that you work with on this screen will be restored to
  223. the procesor registers when you select EXIT TO USER. When running from tempory
  224. memory, the registers are meaningless and will never be used.
  225.   You can change the registers in these ways:
  226.     -With the cursor on a register (the code and data points are the safest
  227.      ones), press INS. The word EDIT flashes on the right. Key in a new
  228.      hexidecimal value. Move the cursor away and the flashing EDIT disappears.
  229.     -Move the cursor to any register(except flags or search). + moves the
  230.      register and the segment to the data point (for the registers above DATA)
  231.      or or the code point (for the ones below CODE on the display). + can also
  232.      copy between the code and data points.
  233.     -When you leave the Vector Display, the interrupt on the cursor line
  234.      replaces the code point.
  235.  
  236. REGISTER KEYBOARD CONTROL
  237.  
  238. Arrow Keys      Move cursor. When you move the cursor right from the data
  239.                 point, you get the Memory Display on the right (ECS gets you
  240.                 back). when you move the cursor right from the code point, you
  241.                 get the Instruction Display on the right.
  242. INS             Start (or stop) Editing. Use this when you want to change a
  243.                 register.The word 'edit' flashes on the screen.
  244. 0 to E          Use these keys to edit the new hex value of a register. The
  245.                 new digit goes on the low order end or the value
  246. +               Move the register to the code point or the data point. For 
  247.                 most of the data registers, the segment register on the same
  248.                 line comes to the code or data point along with the data
  249.                 register. When the cursor is already in the code point, the +
  250.                 key copies it to the other.
  251. +               At the search field, change between text and arabic form
  252. L               Find the next occurance of the search string (locate). The
  253.                 search begins at the data point, and continuesuntil the end
  254.                 of the segment. When there are no occurrences, the data point
  255.                 remains unchanged.
  256. R               Produce the REFERENCE DISPLAY.
  257.  
  258.  
  259.  
  260.                                 INSTRUCTION DISPLAY
  261.  
  262. You get here by pressing RIGHT ARROW from the code point or F2. Sometimes Quaid
  263. reverts directly to this display upon intervention.
  264.  
  265. DESCRIPTION
  266.  
  267.     The INSTRUCTION DISPLAY shows the instructions in memory in a form
  268. resembling the Intel assembly language.
  269. DETAIL: We have modified the instruction mnemonics where necessary. Where Intel
  270. uses  WORD PTR  or  BYTE PTR  to specify operand length, we put  .w  or  ,b
  271. after the opcode, for example Intel  MOVE BYTE  PTR[17],45  becomes
  272. move,b[17],45. We show the rep prefix as a separate instruction. The segment
  273. prefixes are combined with the following instruction,for example,
  274. move ax,[cs:bx+12]. Intel uses  JUMP ,  CALL  and  RET  for several different
  275. instructions. We use  JUMP ,  CALL  and RET  for the near versions, within the
  276. same segment, and  JUMPF ,  CALLF  and  RETF  for the far versions, to another
  277. segment. The forms of  RET  and  RETF  that add a constant to the stack are
  278. distinguished by showing the value of the constant as the operand.
  279.     When Quaid displays instructions starting from the wrong address, edit a
  280. correct starting address at the code point and press RIGHT ARROW.
  281.  
  282. INSTRUCTION KEYBOARD CONTROL
  283.  
  284. UP and DOWN ARROWS  Use these keys to move to neighboring instructions. When
  285.                     you  move the cursor off either end of the screen, the
  286.                     screen scrolls.
  287. ESC and L ARROW     Either of these keys moves the cursor back into the
  288.                     register area.                    
  289. ENTER               Set a permanent breakpoint. Later when the user program
  290.                     resumes, you will get a report when the user reaches the
  291.                     breakpoint.
  292. DEL                 Remove a permanent breakpoint.
  293. S                   Run one instruction of the user program, but stay in this
  294.                     screen. The code point must be the same as cs:ip to use
  295.                     this key. 
  296. I                   Give control back to the user, but intervene after the next
  297.                     IRET instruction. This is usefull when invoking Quaid with
  298.                     PRTSC. Pressing F2 and I will get you out of the BIOS, to
  299.                     the point where the keyboard interrupt intervened. DOS 3.3
  300.                     replaces the vector for interrupt 9 with its own procedure,
  301.                     so you have to press I twice to get to the true point.
  302. G                   Give control back to the user, but intervene when he
  303.                     reaches the instruction at the cursor.
  304. R                   Produce the Reference Display.
  305.  
  306.                               MEMORY DISPLAY
  307.                               
  308.     To see the Memory Display, press the RIGHT ARROW at the data point.
  309.  
  310. DESCRIPTION:
  311. Memory appears in one of three forms:
  312.         -Text, left to right.
  313.         -Arabic form, showing hexadecimal characters left to right. The letters
  314.          a to f are in lower case.
  315.         -Roman form, showing hexadecimal characters left to right. To help you
  316.          distinguish Arabic and Roman, the letters A to F of the Roman form
  317.          are in upper case.
  318.  
  319. MEMORY KEYBOARD CONTROL
  320.  
  321. ESC             Move the cursor to the register area.
  322. +  -            Switch the display form. Pressing + repeatedly will cycle
  323.                 thru the three forms.
  324. ARROW KEYS      Move cursor.
  325. INS             Start editing. After you press INS the word EDIT flashes on the
  326.                 screen to warn you of danger. Your next keystrokes will go
  327.                 directly into memory. If you mistakenly type into a sensitive
  328.                 area, your computer will stop immeadiatly. In Arabic and Roman
  329.                 form, any of the hex digits 0 to F go into memory. In text form
  330.                 any of the typewriter keys go into memory. Press ESC to end
  331.                 editing.
  332. L               Find the next occurence (locate) of the search string. The 
  333.                 search begins at the cursor, and continues untilthe end of the 
  334.                 segment. When there are no occurences,the cursor does not move.
  335. G               Run the user (the program being analysed) until a given memory
  336.                 byte changes. Just point to a byte and press G. You will see
  337.                 the Memory Display just mafter the byte changes. Note: This 
  338.                 facility uses the single step. You should get close to the
  339.                 problem area with other methods before using G.
  340.                 
  341.  
  342.                               REFERENCE DISPLAY
  343.  
  344.     The Reference Display shows all mof the places in memory that refer to
  345. the code point. Press R in the Register Area or Instruction Display to get the
  346. Reference Display.
  347. DETAIL: References include short jumps within 128 bytes, near jumps and calls
  348. in the current segment, interrupt vectors, and complete segment:offset pairs
  349. anywhere in memory. It is possible for a jump or a double word pointer to reach
  350. the code point using a different segment. These references are not shown.
  351.  
  352.  
  353.                                 TRACE DISPLAY
  354.  
  355.     Each time Quade intervenes in an interrupt, it adds to the report on the 
  356. Trace Display. The screen shows a history of up to 25 lines of interrupts.
  357. After you have traced at least one interrupt, F4 gets to this display.
  358.  
  359. DESCRIPTION:
  360.     Here is the meaning of the fields on the trace display, left to right:
  361.     - A line number
  362.     - The interrupt number, sometimes preceded by asterisks, showing you the 
  363.       nesting level. Precisely, the asterisks show the number of return proxies
  364.       active.
  365.     - An interpretation of the meaning of the interrupt. This display is 
  366.       extensive for interrupt 21 hex, DOS call, and brief for the interrupts
  367.       without assigned functions.
  368.     - When you used the proxy type IN/OUT or SILENT, Quaid will, when possible,
  369.       put the result on the same line with the  interrupt entry. When not
  370.       possible, the result goes on a line of it's own, right justified.
  371.  
  372. A few of the interrupts create special displays, as mentioned below.
  373.  
  374. Keyboard Interrupt 9
  375.     For this interrupt, we list the contents of the keyboard buffer, in hex, at
  376. the completion of the interrupt.
  377.  
  378. Asynchronous Interrupts
  379.     For these interrupts, except the keyboard, we display the cs:ip value of 
  380. the interrupted program. Watching the timer interrupt with the SILENT proxy
  381. will show you where your computer is spending most of it's time.
  382.  
  383. Diskette
  384.     The Trace Display line for the diskette interrupts, 13 and 40 hex, looks
  385.     like this:
  386.     
  387.   13 BIOS disk read      a:0.0.1.2         9.27.255          0070:0281
  388.  
  389. meaning:  operation  drive C H R N      EOT.GPL.DTL        data buffer
  390.  
  391. The fields from operation to DTL will be presented to the Floppy Disk
  392. Controller in the order we show them. They mean Cylinder (Track), Head, 
  393. Record (Sector number), N (length), EOT (highest sector number on track),
  394. GPL (gap length) and DTL (must be 255, according to Intel). On the newer
  395. editions of the ROM BIOS, the GPL field in the diskette parameters is ignored
  396. except for formatting. The information reported comes from the register
  397. arguments to the diskette interrupt, except for N, EOT, GPL and DTL, which come
  398. from the diskette parameters pointed to by interrupt vector 1E. Some copy
  399. protection systems use deceptive values in the arguments to the diskette
  400. interrupt.
  401.  
  402. TRACE KEYBORD CONTROL
  403.  
  404. ENTER           This is the same as selecting EXIT TO USER at the Main Menu,
  405.                 that is, continue doing what would have happened if Quaid had
  406.                 not intervened.
  407. -               After your are familiar with Quaid, you may spend a lot of
  408.                 time at the Trace Display pressing ENTER. You can get an
  409.                 accelerated trace by pressing -. You will be asked for a 
  410.                 number, which you can put in with the digits 0 to 9, or
  411.                 modify with + and - or BACK. ENTER produces that many lines
  412.                 on the Trace Display before giving you another report. Use
  413.                 ESC to get out after pressing - by mistake.
  414.                 
  415.  
  416.                               VECTOR DISPLAY  
  417.  
  418.     This display shows you the interrupt vectors and Quaid Analyzer internal
  419. records called proxies. The F3 key gets to the Vector Display.
  420.     This section is difficult. In Quaid, when you patch an interrupt, you
  421. attach a proxy to it. The proxy type determines what action Quaid will take
  422. when the user invokes the interrupt. We suggest you preview the section on
  423. Patch Proxies before trying to understand the screen or keystrokes.
  424.  
  425. DESCRIPTION
  426. For each of the interrupt vectors or proxies, we show:
  427.     -The interrupt number or proxy number in hex. Proxies are preceded by an x.
  428.     - The companion interrupt or proxy. When you patch an interrupt, you
  429.       associate it with a proxy. This field shows the other.
  430.     - The type. This is active when you have patched interrupts. We say more
  431.       about this later.
  432.     - The vector contents. For interrupts, it is the value that would be in the
  433.       vector without any patching. For proxies, this is the location that
  434.       control would pass to if the proxy had not intervened.
  435.     - The original vector contents, if different from the current value. When
  436.       Quaid starts, it records each vector for this comparison.
  437.     - For interrupts 8 to F only, the IMR, IRR and ISR bits.
  438.     - The name of the interrupt. These names come from diverse sources, and
  439.       include specialized interrupts used only on certain members of the IBM
  440.       family, such as the PCjr or the PC AT.
  441. When you leave the Vector Display, the contents of the interrupt at the cursor
  442. replaces the code point of the Program Display.
  443.  
  444. VECTOR KEYBOARD CONTROL
  445.  
  446. UP & DOWN ARROWS    Use these keys to move the cursor to a new interrupt or
  447.                     proxy.You can continue to scroll off the end of the screen.
  448. ENTER               When used on an interrupt without a patch, ENTER patches
  449.                     the interrupt,changing it's type to PATCHED, attaches a 
  450.                     companion proxy, and moves the cursor to the proxy.
  451. ENTER               When used on the interrupt or proxy for a patched interrupt,
  452.                     ENTER moves the cursor to the other, the companion.
  453. + -                 Use these keys to change a proxy type.
  454. DEL                 Use this key to quash a proxy, or a patched interrupt.
  455.  
  456.  
  457. INTERRUPT VECTORS
  458.     There are two interrupt types, in addition to blank (quashed):
  459. PATCHED     This means you have asked for tracing. The companion proxy 
  460.             determines what kind of tracing you get. Quashing a patched
  461.             interrupt is never dangerous.
  462. KEY         This is the interrupt used for breakpoints. There is only one
  463.             interrupt of this type. To move it, highlight it with ENTER,move
  464.             it elsewhere with UP or DOWN , and deposit it with ENTER.
  465.             When you press G at the Instruction Display, or use permanent
  466.             breakpoints, Quaid temporarily inserts an instruction generating
  467.             the KEY interrupt into the user program, removing it at the next
  468.             intervention. For benign programs, interrupt 3 is the best KEY
  469.             interrupt, because the instruction to invoke it is only one byte
  470.             long. As a countermeasure, some programs frequently change the 
  471.             contents of vectors 1 and 3. You can change the KEY interrupt to
  472.             something else to trace these programs.
  473.  
  474. PROXIES
  475. Each proxie represents an address that can be placed in an interrupt vector, or
  476. can replace a return address on the stack. When the event occurs that would
  477. normally transfer control to the address in an interrupt vector or to a return
  478. address,the proxy will get controll instead.
  479.  
  480. You will note that some of the functions below depend on fine details of the
  481. BIOS. If you have a compatable computer, you may find other problems with the
  482. most difficult interrupts.
  483.  
  484. PATCH PROXIES
  485. These proxy types determine what action Quaid will take when a patched
  486. interrupt occurs. The proxy types are:
  487.  
  488. IN/OUT      Quaid reports just before, and just after, running the interrupt
  489.             service.
  490.             After the report of entry, Quaid runs the interrupt service just
  491.             as it would run otherwise, except that the return address on the
  492.             stack points to a RETURN proxy.
  493.  
  494. IN          Quaid reports just before entry into the interrupt service.
  495.             After the report of entry, it gives control to the interrupt 
  496.             service with the stack exactly as it would have been without
  497.             intervention. This is the most faithful emulation of the interrupt,
  498.             and in difficult cases, it is the only kind possible.
  499.  
  500. OUT         Quaid reports upon completion of the interrupt service.
  501.             Quaid runs the interrupt service with a proxy address substituted
  502.             for the return address on the stack, so you can get a report on the
  503.             interrupt return. Some programs treat the cs:ip value on the stack
  504.             as a pointer to data. These programs cannot be traced with the 
  505.             OUT or IN/OUT proxies.
  506.             
  507. RUN         This applies only to the DOS call, interrupt 21 hex. Quaid will
  508.             report on .com and .exe programs just before executing the first
  509.             instruction.
  510.             
  511. TROJAN      This applies only to the BIOS disk interrupt, 13 hex. Quaid reports
  512.             any attempt to alter the hard disk. If you want to go ahead with
  513.             the alteration, press ENTER at the Trace Display when you get the
  514.             report. If not, your safest course is to press CTRL-ALT-DEL to boot
  515.             load your computer.
  516.             Quaid examines the register contents at every occurance of the 
  517.             interrupt. An attempt to change a hard disk has dl>=128 and ah=3
  518.             (write), ah=5 (format) or ah=11 (write long). Service calls that
  519.             don't change the hard disk run without intervention.
  520.             We have been criticized for not patching interrupt 26 hex, but such
  521.             a patch is unnecessary. The interrupt service for 26 must 
  522.             eventually call interrupt 13 to wite to the hard disk.
  523.             
  524. SYSREQ      This applies only to interrupt 15 hex. Quaid will give you a report
  525.             when the SysRq key of the Personal Computer AT or PS/2 is pressed.
  526.             This function does not work on the COMPAQ 286, because it issues
  527.             the SYSREQ interrupt before sending the EOI to the interrupt
  528.             controller.
  529.                 
  530. SILENT      Quaid produces an entry line in the Trace Display before and after
  531.             execution of the interrupt service, but does not give a report. The
  532.             Trace Display can only be seen when another kind of report occurs.
  533.             The SILENT proxy is usefull for interrupts (such as the keyboard)
  534.             that are used by Quaid itself. The intervention is done in the same
  535.             way as for the IN/OUT proxy, except that the REVERT proxy is used
  536.             in place of RETURN.
  537.             
  538. PASS        Quaid executes the interrupt without any reports.
  539.             When a program such as SideKick changes a patched interrupt, it 
  540.             saves a proxy, and will issue calls to the proxy indefinately. 
  541.             Setting the proxy type to PASS is the only way to turn off the 
  542.             reports. When the interrupt occurs, Quaid invokes the interrupt
  543.             servive exactly as it would have been without intervention.
  544.             
  545. STOP        Quaid reports the interrupt, but does not invoke the interrupt
  546.             service. The next EXIT TO USER resumes at the instruction following
  547.             the interrupt call. This proxy is most commonly attached to the 
  548.             print screen interrupt. Thereafter, you can press PrtSc to invoke
  549.             Quaid, without disturbing your printer. 
  550.             Since the interrupt service is never called, STOP will cause 
  551.             system failure when used at the wrong place.
  552.             
  553. When the user program changes a patched interrupt, Quaid generates a new patch
  554. proxy, with the value in the new interrupt vector. If the action of the user
  555. was to insert a new value destroying the old one, it is safe to quash the old
  556. patch proxy. If the action of the user was to save the old value, and replace
  557. it with the new one, he will probably call the old proxy (which he thinks was
  558. the old interrupt vector contents) every time the interrupt occurs. In this
  559. case, it is not safe to quash the old proxy. Change it's type to PASS when you
  560. don't want to see any more tracing. You will see examples of this if you patch
  561. interrupts during the boot load.
  562.  
  563.  
  564. PENDING ACTION PROXIES
  565.  
  566. There is another kind of proxy representing pending action. These are not
  567. companions of interrupts, but records of other kinds of things to be done. The
  568. pending action proxies are:
  569.  
  570. CALL        Quaid creates this on entry into an interrupt patched with proxy
  571.             type IN/OUT. At EXIT TO USER, Quaid quashes the call and simulates
  572.             entry into the interrupt service, but with the address of a RETURN
  573.             proxy as the return address.
  574.             
  575. ENTER       Quaid creates this on entry into an interrupt patched with proxy
  576.             type IN. At EXIT TO USER, Quaid simulates entry into the interrupt
  577.             service and quashes the proxy. During a report you can change your
  578.             mind and manually change between types CALL and ENTER, or quash
  579.             either one, creating the effect of the STOP proxy.
  580.             
  581. RETURN      Quaid creates this when giving control to an interrupt service in
  582.             cases where you want a report after the interrupt; you used proxy
  583.             types OUT or IN/OUT. The proxy address substitutes for the return
  584.             address on the stack. When the interrupt service returns, Quaid 
  585.             restores cs:ip and quashes the RETURN proxy. The stack with a
  586.             RETURN proxy differs from the stack without intervention, so
  587.             proxies OUT, IN/OUT and SILENT cannot be used on interrupts that
  588.             use the cs:ip value on the stack as a data pointer. Sometimes the
  589.             return never occurs, and the RETURN proxy remains in existence
  590.             indefinitely. In that case you may quash it by hand. Be careful,
  591.             because if the user later returns, you will have to boot load your
  592.             computer.
  593.             
  594. REVERT      This is simular to RETURN, but since it is on behalf of the SILENT
  595.             proxy, no report occurs.
  596.             
  597. LOAD        Quaid uses this as its internal record of a program load when you
  598.             used the RUN proxy. You can only produce errors by quashing it.
  599.  
  600.  
  601.                                     ASCII TABLE 
  602.                                     
  603. This display shows the graphic symbols for all 256 ASCII characters. You can
  604. also can see the character codes and scan code returned for any keystroke. Any
  605. ASCII character or keystroke can be sent to the user program. The F5 key brings
  606. up the ASCII TABLE.
  607.  
  608. DESCRIPTION
  609. The main body of the display shows all 256 ASCII characters, arranged in a
  610. rectangle. Above is the character value in decimal and hex.
  611.  
  612. TABLE KEYBOARD CONTROL
  613.  
  614. ARROW KEYS  Moves the cursor to any of the characters in the table.
  615.  
  616. HOME        Moves the cursor to the top. The scan code and character code of
  617.             the keystroke will appear at the top of the screen. Use this to 
  618.             find out what your keyboard really generates.
  619.             
  620. K           Resume the user program, giving the character at the top of the
  621.             screen as input.
  622.             The scan code and character code go into the keyboard buffer, 
  623.             provided it is not full. If the last character was pointed to with
  624.             the cursor keys, not proceded by HOME, it is the same as holding
  625.             down the Alt key and keying in the character code, since the scan
  626.             code is zero.
  627.             
  628.  
  629.                             DIAGNOSTIC EXAMPLE
  630.                             
  631. We will show here how to find a problem in a program, and correct it to your
  632. liking. For our example, we will use the COMP command of DOS. This example
  633. comes from DOS 3.30; for other systems, details such as instruction addresses
  634. may differ.
  635.  
  636. When you finish a compare, DOS asks you whether you want to compare more files,
  637. making it easier to use a diskette system. On hard disk systems, the prompt is
  638. a nuisance, so we will go through the steps in finding and eliminating it. We
  639. show only the successful route to the solution, avoiding the unsuccessful
  640. efforts that are a part of any real diagnosis.With each step in our example, we
  641. show the keystrokes and explain what is being done.
  642.  
  643. We need a simple way to get to the undesired prompt.  COMP  without parameters
  644. is not helpful, but   COMP A A  gets directly to the prompt  'Compare more
  645. files (Y/N)?'
  646.  
  647. C>QA 5      Implant Quaid Analyzer in memory.
  648.  
  649. PrtSc       Bring up Quaid
  650.  
  651. F3          Get to the Vector Display
  652.  
  653. DOWN        Hold this key until reaching interrupt 21 hex, DOS call.
  654.  
  655. ENTER +     Patch interrupt 21 with a RUN proxy. This tells Quaid to stop at
  656.             the first instruction of the next user program.
  657.  
  658. F7          Getout of Quaid, and return to the DOS prompt.
  659.  
  660. C>COMP A A  
  661.             Start the compare program. Quaid will give you a report almost 
  662.             immeadiately, just before running the first instruction of COMP.
  663.  
  664. F3          Get to the Vector Display.
  665.  
  666. HOME        Get to the line with the RUN proxy.
  667.  
  668. -           Change the proxy type of the patch on interrupt 21 to IN/OUT. From
  669.             now on, Quaid will report before and after the COMP program does
  670.             each DOS call.
  671.  
  672. F4          Get back to the Trace Display.
  673.  
  674. ENTER       Press this several times, watching the Trace Display. Eventually,
  675.             you will see some processing related to the desired prompt:
  676.                 
  677.                 3b chdir
  678.                 40 write handle 2 (20) crlf Compare more files            (20)
  679.                 40 write handle 2 (8) (Y/N)?                               (8)
  680.                 0c clear buffer and keyin 01
  681.  
  682. ENTER       The next depression of ENTER will bring you back to the user screen
  683.             Control is in the keyboard processor of DOS, waiting for the
  684.             response to the prompt.
  685.  
  686. X           Give an invalid response to the prompt.
  687.  
  688. ENTER       Continue pressing ENTER several more times. The Trace Display will
  689.             continue with:
  690.  
  691.                 0c clear buffer and keyin 01                              X 58
  692.                 40 write handle 1 (2) crlf                                 (2)
  693.                 40 write handle 2 (20) crlf compare more files            (20)
  694.                 40 write handle 2 (8) (Y/N)?                               (8)
  695.                 0c clear buffer and keyin 01                              X 58
  696.                 
  697.                 Ordinarily, you would run this again, and start to look at the 
  698.                 code where it calls for the first write handle 2, but the 
  699.                 write comes from a subroutine, and the following method is
  700.                 simpler.
  701.                 
  702. F2          Display instructions just after the X response. 
  703.             By looking up function 0C in the 'DOS Technical Reference', we
  704.             find that the key you press in response to the prompt is in
  705.             register al. You will see that the program is about to call a
  706.             subroutine, and following that it converts the value in al to upper
  707.             case with an AND instruction, and goes to one of three different
  708.             places depending on the value in al:
  709.             
  710.             -a jump to 07BE, probably a large, outer, loop.
  711.             -a jump to 0B2E, a small inner loop.
  712.             -DOS terminate (int 20 hex)
  713.             
  714.             The values used to compare against al are not visible, because the
  715.             program compares al to two memory locations. By looking in the
  716.             memory locations, or by common sense inference, we see that the
  717.             program does the big loop when you type Y, does the DOS terminate
  718.             when you type N, and does the small loop when you type anything
  719.             else.
  720.             
  721.             It looks like the way to eliminate the undesired prompt is to do
  722.             the DOS terminate at the beginning of the small loop. By looking
  723.             at the object program, we see that the hex coding for the DOS 
  724.             terminate is 20CD (with 20 at the higher address), and starting
  725.             address of the small loop is cs:0B2E.
  726.             
  727. F3          Get to the Vector Display.
  728.  
  729. DOWN        Hold this until reaching interrupt 21.
  730.  
  731. DEL         Quash the patch. Quaid will no longer intervene.
  732.  
  733. F7          Get back to the COMP program.
  734.  
  735. N           Terminate COMP.
  736.  
  737. If you are cautious, you will run the COMP again, but patch the first
  738. instruction of the short loop to 20CD when the program is loaded. We have done
  739. so, and found that the COMP exits without the undesired prompt.
  740.  
  741. All that remains is to patch the com file with the DOS terminate instruction.
  742. When a com file is loaded into memory, it starts at address cs:0100. This means
  743. that the patch instruction, 20CD, goes in the file at hex address 0A2E, or 2606
  744. decimal, that is, hex CD goes at 2606, and hex 20 goes at 2607. You can make
  745. the patch with the File menu function of Quaid Analyzer, or with a file utility
  746. such as Disk Explorer, Disk Mechanic or the Norton Utilities. The new program
  747. will compare files without giving a prompt.
  748.  
  749.  
  750.  
  751.  
  752.    This typing project has been a long time coming and I just hope it is
  753.    put to some good use.
  754.                                       
  755.                                            Beamer
  756.                                            ______
  757.                                            ^    ^