home *** CD-ROM | disk | FTP | other *** search
/ PowerPlay 1996 October / PowerPlay1096.BIN / tools / psedit / psedit.doc < prev    next >
Text File  |  1994-12-07  |  46KB  |  972 lines

  1.                                     PSEDIT
  2.                               Binary File Editor
  3.                                  USER'S GUIDE
  4.  
  5.                   Copyright 1990, 1993 by Gary C. Crider and
  6.                                Parity Solutions
  7.                                
  8.  
  9.  
  10. TABLE OF CONTENTS:
  11.  
  12.         What is PSEDIT? .................................. 1.0
  13.         Customizing PSEDIT ............................... 2.0
  14.           The PSEDIT.INI Configuration File .............. 2.1
  15.           The PSEDIT Command Line and Switches ........... 2.2
  16.           Customizing On A Network ....................... 2.3
  17.         Operational Notes and Requirements................ 3.0
  18.         The Keyboard and Display ......................... 4.0
  19.         Modifying Data ................................... 5.0
  20.           Filling a block of data ........................ 5.1
  21.         Deleting Data .................................... 6.0  
  22.         Inserting Data ................................... 7.0  
  23.         Using the clipboard (Cut, Paste, Copy) ........... 8.0
  24.         Locating Data .................................... 9.0
  25.           Go to a Position in the File ................... 9.1
  26.           Search for Data ................................ 9.2
  27.           Find and Replace Data .......................... 9.3
  28.         Print the File ................................... 10.0
  29.         Save the File .................................... 11.0
  30.         Hex/Decimal Conversions and Calculations.......... 12.0
  31.         Exiting PSEDIT ................................... 13.0
  32.         Help ............................................. 14.0
  33.         A Useful Example - 
  34.           Modification of DOS 5's EDIT ................... 15.0
  35.         Installation ..................................... Appendix A
  36.         Disclaimer ....................................... Appendix B
  37.         Support .......................................... Appendix C
  38.         Registration ..................................... Appendix D
  39.  
  40.  
  41.  
  42. 1.0 What Is PSEDIT?
  43.  
  44.    One thing most of us learned early while working on our first PC
  45. was that EDLIN, while useful, stank (stunk?)... was malodorous as an editor 
  46. of text files.  Soon there were hundreds of full screen text editors 
  47. available everywhere.  Even Microsoft finally came around and included EDIT 
  48. in DOS 5 to get us away from EDLIN.
  49.  
  50.    An early lesson that most who aspire to be power users learn is that not
  51. all changes we desire to make are in text files.  Sooner or later we end
  52. up patching an executable program, database, or strange format file that
  53. text editors will not handle.  Enter DEBUG.  Just as EDLIN was a pain for
  54. editing text files, DEBUG is a pain for editing binary files.  Strangely,
  55. few people have jumped out with binary editors and some of the few I have 
  56. seen are not much better than DEBUG.  
  57.  
  58.    PSEDIT is a very easy-to-use full screen editor for binary (or text) 
  59. files.  You simply type over the hex or ASCII data much as you would with
  60. any text editor.  PSEDIT ensures that you enter hex characters (0-9 and A-F)
  61. while you are in hex entry mode.  You will be able to see the hex and ASCII
  62. representations at all times whether you are editing in hex or ASCII.  
  63.  
  64.    Using PSEDIT is so intuitive, I don't know why I'm writing this documen-
  65. tation or why you are reading it.  Perhaps we both like to move cautiously.
  66.  
  67.    You see a full screen of data at all times, not just a few bytes.  Paging
  68. through the file is as easy as hitting PgUp and PgDn, you don't have to
  69. enter hex displacements to get to the next page.
  70.  
  71.    I think you'll find, as we have at a Fortune 100 company (my day job),
  72. that PSEDIT becomes one of the handiest tools you have.  You will use it
  73. much more than you now expect that you will.
  74.  
  75.    PSEDIT automatically detects and uses any available conventional, expanded
  76. or extended memory.  It will also use disk space to simulate memory when it
  77. runs short.  This shared memory pool is referred to as virtual memory.  It 
  78. allows very large files to be edited (up to 64 megabytes).
  79.  
  80.    PSEDIT was formerly distributed under the name BEDIT.
  81.  
  82.  
  83. 2.0 Customizing PSEDIT
  84.  
  85.    There are two ways to customize PSEDIT to fit your preferences and your
  86. environment.  The first and most recommended is to make your settings in
  87. the PSEDIT.INI file.  These become your default settings.  Sometimes you
  88. may want to override one or more of them temporarily.  The command line 
  89. switches will override the PSEDIT.INI file.  More options are configurable 
  90. in the PSEDIT.INI file than with command line switches.
  91.  
  92.  
  93.  
  94. 2.1 The PSEDIT.INI Configuration File
  95.  
  96.    A sample PSEDIT.INI file comes with PSEDIT and is initialized to all of
  97. the defaults.  The defaults are used when the PSEDIT.INI file cannot be found
  98. or when a particular setting is missing from the file.  
  99.  
  100.    The PSEDIT.INI file can be changed with any text file editor and should be
  101. saved in a directory that is specified in DOS's PATH= environment variable.
  102. Or you can use a SET statement such as follows to tell PSEDIT where to look 
  103. for the PSEDIT.INI file:
  104.  
  105.    SET PSEINI=D:\PSEDIT\
  106.  
  107.    Do not specify a file name, only the directory where PSEDIT.INI is
  108. located.  The trailing backslash is only required if you want to specify
  109. a root directory.  Place the SET statement in your AUTOEXEC.BAT file.
  110.  
  111.    If the PSEDIT.INI file is in a directory on your path, you do not need to
  112. use the PSEINI= environment variable.
  113.  
  114.    As a last resort, if PSEDIT.INI is not found on the path or in a PSEINI=
  115. variable, it also looks in the same directory from which PSEDIT.EXE was
  116. loaded.  Thus, if you keep PSEDIT.EXE and PSEDIT.INI in the same directory,
  117. PSEDIT should never have trouble locating it.
  118.  
  119.    You have a lot of latitude in where to place the PSEDIT.INI file, but try 
  120. to only have one, as you can get confused as to which one is being used if 
  121. there is more than one.
  122.  
  123.    All of the settings and values for the PSEDIT.INI file are documented
  124. within the PSEDIT.INI file provided with PSEDIT.EXE.  If you wish to add 
  125. comments to the file, the first non-blank character on the line should be 
  126. a semi-colon (;).
  127.  
  128.  
  129.  
  130. 2.2 The PSEDIT Command Line and Switches
  131.  
  132.  
  133.    Format: PSEDIT [[path]filename] [/B] [/I] [/V /?] 
  134.  
  135.    The filename is the file name of the file that you want to edit.  The path
  136. is required if a file is specified and is not in the current directory.  See 
  137. BackupMode= in the PSEDIT.INI file for information about automatic or 
  138. prompted backups of the file.
  139.  
  140.    If no file name is specified, a pick list is displayed of all of the 
  141. files in the current directory.  To select a file, use the arrow keys to
  142. move the selection bar to the file you want, and press enter.  If a file is
  143. specified, but not found, a pick list will be displayed of all files in
  144. the specified directory.
  145.    
  146.    /? Display command line help prompt.
  147.    
  148.    /B reverses the effect of the MonochromeVideo setting in PSEDIT.INI.
  149.       If you have specified monochrome display, /B forces color display.  
  150.       If you have not selected monochrome, black and white (monochrome) 
  151.       display is forced.
  152.  
  153.    /I reverses the effect of the InternationalChars setting in PSEDIT.INI.
  154.       if you have specified international characters, /I will cause 
  155.       international characters to not be recognized.  If you have not 
  156.       specified international characters, /I forces recognition of
  157.       international characters.
  158.  
  159.    /G reverses the effect of the GraphicsChars setting in PSEDIT.INI.  If you 
  160.       have specified graphics characters, /G will cause international and 
  161.       graphics characters to not be recognized.  If you have not specified 
  162.       graphics characters, /G forces recognition of international and graphics 
  163.       characters.
  164.  
  165.    /V reverses the effect of the BIOSWrites setting in PSEDIT.INI. If you have 
  166.       specified BIOS writes, /V will force direct video memory reads and writes 
  167.       for the edit window.  If you have not specified BIOS writes, /V will 
  168.       force BIOS reads and writes.
  169.  
  170.  
  171.    Brackets ([]) indicate optional parameters.  Do not include the brackets
  172. in the command line.
  173.  
  174.  
  175. 2.3 Customizing On A Network
  176.  
  177.    In a LAN environment, PSEDIT would normally be installed on a file server
  178. in a directory that is on the search path.  A master copy of the PSEDIT.INI 
  179. file should also be in this directory and will have the default config-
  180. uration for all users.  
  181.    
  182.    In order for an individual user to customize PSEDIT without impacting 
  183. others, use the PSEINI= environment variable to point to a local or private 
  184. directory that will contain the PSEDIT.INI file to be used.  The PSEINI=
  185. variable does not have to be specified if the personal PSEDIT.INI file is
  186. placed in a directory that precedes the directory with the master INI file
  187. in the search path.  
  188.    
  189.  
  190.  
  191. 3.0 Operational Notes and Requirements
  192.  
  193.    PSEDIT's only firm requirement is that it be run on an Intel-compatible
  194. system that is 286-equivalent or newer (386, 486, Pentium...).  The 8086/
  195. 8088 CPUs are no longer supported.
  196.    
  197.    See section 2.4, The PSEDIT Command Line and Switches, for instruction
  198. on how to start PSEDIT.
  199.  
  200.    Please look at the BackupMode= parameter of the PSEDIT.INI file to decide
  201. how you would like PSEDIT to handle backing up your file.  You can specify
  202. that backups are never taken, that you are prompted to create a backup, or
  203. that backups are automatically made whenever a file is loaded.  While never
  204. taking backups is very dangerous, always making backups is slower and can
  205. clutter up your disk with a bunch of backup files when all you wanted to do 
  206. was view or print a file.  The prompted mode is the default and most flexible.
  207. It only requires one extra keystroke each time a file is loaded.  You may
  208. also specify what directory is to contain you backups.  This can keep down
  209. the clutter somewhat.  All backup files are named the same as the loaded file
  210. except with a .BAK extension.
  211.  
  212.  
  213.    If you intend to modify a file with PSEDIT, I highly recommend making
  214. a backup file for obvious reasons.  Since PSEDIT will allow you to change 
  215. any file in any way, it is obviously a very dangerous weapon in the hands of 
  216. the unskilled or careless as well as a very powerful tool in the hands of the 
  217. skilled and careful.  Please be careful!
  218.  
  219.    PSEDIT reads the entire file into virtual memory before any edits are 
  220. performed.  All changes are made only to the copy in memory until a SAVE is 
  221. done. PSEDIT uses VMM, a virtual memory manager by Parity Solutions.  VMM 
  222. lets you utilize as much conventional, expanded and extended memory as you 
  223. have, then overflows onto disk to simulate the remaining required memory.  
  224. Assuming you have enough memory and disk space, you can edit files up to 64 
  225. megabytes in size.
  226.  
  227.    PSEDIT must have at least one byte in its data buffer to function,
  228. therefore, if you load a file with a length of 0, or delete all bytes in a
  229. file, one byte will show up on the screen and its value will be x00.
  230.  
  231.    PSEDIT has three different display modes and three different ways of 
  232. selecting the one you prefer.  The normal default mode is to display U.S. 
  233. English characters and punctuation.  The second adds international characters 
  234. and the third adds graphics characters.  If you wish to change the default, 
  235. use the PSEDIT.INI file. If you want to change the initial mode for a single 
  236. execution of PSEDIT, use the command line switches /I or /G as described 
  237. under "Customizing PSEDIT."  If you want to change the characters displayed 
  238. after you have already loaded PSEDIT, use the ALT-I and ALT-G toggles as 
  239. described below under "The Keyboard and Display."
  240.  
  241.   The reason the U.S. English letters and punctuation were selected as the 
  242. default is first because most of the PSEDIT users are in the U.S., and
  243. second, because when most users refer to the ASCII portion, they are looking 
  244. for a particular text string or phrase.  Not displaying the graphics and
  245. international characters makes the phrase or word easier to spot.  If you
  246. know exactly what you are looking for, use the search feature to locate it
  247. quickly.  International users should not feel slighted, because you can 
  248. easily change the default to display international characters.  Unfortunately,
  249. you must display all international characters, not just the ones used in
  250. your language.
  251.  
  252.  
  253.  
  254. 4.0 The Keyboard and Display
  255.  
  256.    The top line of the display shows the name, size, date and time of the
  257. file being edited.  It also shows whether case-sensitivity is set on or off.  
  258. There is also an area that will toggle between "HEX" and "ASCII" depending on 
  259. which edit mode you are in.  The upper-right corner contains two numbers in
  260. the format ddddddd:xhhhhhh.  This is the current cursor location in both
  261. decimal (ddddddd) and hex (hhhhhh).  The bottom line contains a quick 
  262. reference of function keys and their usage.  Other key functions can be 
  263. displayed by pressing F1 (Help).
  264.  
  265.    Down the left side of the display is the offset from the start of the   
  266. file to the first byte displayed on that line.  The offset is in hex.   
  267.  
  268.   HINT: The easy way to see where your cursor is currently located is to
  269. press ALT-D or ALT-H, rather than adding the horizontal offset to the offset on the
  270. left of the screen.  The hex/decimal conversion windows will pop up with 
  271. the current cursor location displayed in the operand field.  ALT-D displays
  272. the offset in Decimal, ALT-H displays it in hex.
  273.  
  274.    There are two modes of editing in PSEDIT.  When you first load a file, the
  275. screen appears with both hex data and its ASCII representation displayed in 
  276. separate sections of the screen.  The cursor is initially placed in the hex 
  277. portion of the screen for editing in hex.  The character (represented by two 
  278. hex digits) at the cursor location appears red on color monitors.  The same 
  279. character on the ASCII (right) side will be light cyan.  All other data 
  280. characters are yellow.  As the cursor moves, you will see the light cyan 
  281. highlighting on the ASCII display move with the cursor and red letters of the 
  282. hex display.  Pressing TAB places the cursor in the ASCII portion and the 
  283. display at the cursor becomes red.  The corresponding position in the hex 
  284. data becomes light cyan.  TAB toggles the cursor back and forth between the 
  285. two editing areas.
  286.  
  287.    The ASCII display does not display every displayable character, but only
  288. letters and numbers and the more common punctuation symbols that are common
  289. to most printers.  All other characters appear as periods.  You can only 
  290. enter these characters on the ASCII side.  To enter exotic characters you 
  291. must use the hex representation on the hex side.  If a blank appears on the
  292. ASCII display, it is  because there is a true blank (hex 20) at that position.
  293.  
  294.    The following keys function as shown during editing:
  295.  
  296.    Page Down    - Display the next page of data.
  297.    Page Up      - Display the previous page of data.
  298.    Home         - Position the cursor at the start of the file.
  299.    End          - Position the cursor at the end of the file.
  300.    Down Arrow   - Move the cursor down one line.
  301.    Up Arrow     - Move the cursor up one line.
  302.    Right Arrow  - Move the cursor right one byte.  If at the end of a line, 
  303.                   move to the first byte of next line.
  304.    Left Arrow   - Move the cursor left one byte.  If at the start of a line,
  305.                   move to the last byte of the previous line.
  306.    Enter        - Same as right arrow.
  307.    Tab          - Swap the edit cursor between hex and ASCII modes.
  308.    Back Tab     - Clears the byte.  You must then type something in the byte
  309.                   before the cursor can be moved.
  310.    Insert       - Insert one byte.  Everything beyond this byte is shifted one 
  311.                   position and a hex 00 byte is inserted at the cursor.
  312.    Delete       - Delete one byte at the cursor.
  313.  
  314.    Function keys:
  315.  
  316.    F1     - Display the help screen.
  317.    F2     - Save any changes to the file on disk.
  318.    F3     - Insert a specified number of bytes at cursor.
  319.    F4     - Delete a specified number of bytes at cursor.
  320.    F5     - Move the cursor to a specified address within the file.
  321.    F6     - Print the file to LPT1:.  It appears in basically the same format
  322.             as displayed.
  323.    F7     - Toggle case-sensitivity for ASCII string searches.
  324.    F8     - Specify a search argument and locate the first occurrence of it in
  325.             the file.
  326.    F9     - Locate the next occurrence of the search argument.
  327.    F10    - Display status of clipboard, blocked data and the virtual
  328.             memory manager.
  329.    
  330.    
  331.    Alt keys:
  332.  
  333.    ALT-C  - Hex/decimal calculator 
  334.    ALT-D  - Decimal to hex conversion
  335.    ALT-H  - Hex to Decimal conversion
  336.    ALT-X  - Exit PSEDIT.
  337.    ALT-V  - Toggle between 25-line and 43/50 line display modes.
  338.    ALT-F6 - Print an address range.
  339.    ALT-I  - Toggle displaying of international characters.
  340.    ALT-G  - Toggle displaying of international and graphics characters.
  341.    
  342.    Block keys:
  343.  
  344.    CTL-K B - Mark the start of a block to be deleted.
  345.    CTL-K K - Mark the end of a block to be deleted.
  346.    CTL-K H - Unmark a currently marked block.
  347.    CTL-K F - Fill a block with a given value.
  348.  
  349.    Clipboard function keys:
  350.  
  351.    CTL-INS  - Copy blocked data to clipboard.
  352.    CTL-DEL  - Cut blocked data from the file and into the clipboard.
  353.    SHFT-INS - Paste clipboard contents at current cursor location.  The
  354.               contents are inserted.  Existing data is not overlaid.
  355.  
  356.    ESCAPE - Exit PSEDIT.
  357.  
  358.  
  359. 5.0 Modifying Data
  360.  
  361.    Modifying data is very simple, just type over it.  Use the TAB key to 
  362. select the hex or ASCII area.  A MODE indicator on the top line will change 
  363. to indicate whether you are in hex or ASCII edit mode.  When typing in the 
  364. hex area, only valid hex characters, 0-9 and A-F are allowed and upper case 
  365. is forced.  When entering data in the ASCII portion, only common printable 
  366. characters are allowed and upper or lower case may be used.
  367.  
  368.  
  369.  
  370. 5.1 Filling a block of data   
  371.  
  372.    You may mark a block of data (see Deleting Data below) and then press
  373. CTL-K F.  You will be prompted for a fill value (in HEX or ASCII depending 
  374. on your edit mode) to overlay the contents of the blocked data. You may press 
  375. ESCAPE at the prompt to abort the fill operation.  Once you enter the value 
  376. and press enter, the blocked area is filled with the value you specified.
  377.  
  378.  
  379.  
  380. 6.0 Deleting Data
  381.  
  382.    First place the cursor on the first byte of the data that you want to 
  383. delete.  Pressing the DELETE key deletes one byte of data at this position.
  384. Press DELETE repeatedly to delete several bytes.  If a large block needs to
  385. be deleted, press the F4 key and reply to the prompt with the number of bytes 
  386. (up to the clipboard size as specified in PSEDIT.INI) you want to delete 
  387. starting with the byte at the cursor.
  388.  
  389.    There is also a facility to mark a block and then delete it.  Press 
  390. CTL-K B to mark the first byte of a block, then press CTL-K K to mark the
  391. last byte of a block.  Then press DELETE or F4 to delete the block.  You
  392. can unmark a block by pressing CTL-K H.  You can also change the start or 
  393. end of the block at any time before the block is deleted or unmarked.  These 
  394. keys conform to WordStar-type conventions used in many text editors and word 
  395. processors today.  You can mark and delete blocks up to the size of the
  396. clipboard as specified in PSEDIT.INI.
  397.  
  398.    PSEDIT cannot handle a file with no data.  If you delete all bytes in the
  399. file, PSEDIT will display a file with one byte of x00.
  400.  
  401.  
  402.  
  403. 7.0 Inserting Data
  404.  
  405.    PSEDIT, rather than using an insert mode, lets you insert bytes of binary 
  406. zeros, hex 00, into the file.  You can then type over the inserted bytes with 
  407. the data that you require, or you can use the fill function to fill the area
  408. with another value.
  409.  
  410.    Inserting data causes the file to grow.  To allow for this growth, an
  411. additional 64k of virtual memory was acquired.  Thus, if you insert more than
  412. 64 kilobytes, you must save the file and reload it to acquire another 64k
  413. expansion area.  The size of the expansion area can be increased as high
  414. as 256k in the PSEDIT.INI file.
  415.  
  416.    Place the cursor at the byte where you want the data inserted.  The data
  417. is inserted BEFORE the byte at the cursor.  Pressing the INSERT key inserts 
  418. one byte at a time.  If a large block needs to be inserted, press F3 and 
  419. specify the number of bytes you want inserted up to the size of the clipboard
  420. as specified in PSEDIT.INI.  Once the null bytes appear, type over them if 
  421. necessary.
  422.  
  423.    In order to add bytes to the end of the file, press END to go to the last
  424. byte of the file then press the right arrow.  Each press of the right arrow
  425. adds a byte to the file.  To enter a large block at the end of the file,
  426. press the right arrow once, then press F3 and specify the number of bytes
  427. needed less one (since you already added one when you pressed the right
  428. arrow).
  429.  
  430.    You can insert data from the clipboard by placing the cursor where you
  431. want the inserted data to begin and pressing SHIFT-INSERT.  If the clipboard
  432. is empty, nothing will happen.  Otherwise, the new data will appear inserted
  433. at the cursor location and marked as a block.  This is so that if you made a
  434. mistake and placed it improperly, you can just press DELETE to delete it,
  435. reposition your cursor and hit SHIFT-INSERT again to reinsert it.  Press
  436. CTL-K H to unmark the block.  The data remains in the clipboard, so it can 
  437. be inserted at multiple locations.
  438.  
  439.  
  440.  
  441. 8.0 Using the Clipboard (Cut, Paste, Copy)
  442.  
  443.    PSEDIT contains a clipboard for use in cutting, pasting and copying
  444. marked blocks. It's size may range from 0 to 48k and is specified in 
  445. PSEDIT.INI.  The clipboard uses CUA keyboard conventions.
  446.  
  447.    First, mark a block of data (see Deleting Data for instructions on
  448. marking blocks), then press CTRL-INSERT to copy the block to the clipboard.
  449. Press SHIFT-DELETE if you want to copy the block to the clipboard and 
  450. delete it from its current position in the file (Cut).
  451.  
  452.    Once you have cut or copied data into the clipboard, you may paste 
  453. (insert) it anywhere in the file by using SHIFT-INSERT.  See Inserting Data
  454. for details on using the paste feature.
  455.  
  456.    If you try to cut or copy a block that is greater than the clipboard size,
  457. a message window will pop up and the current block marks must be adjusted
  458. to select a smaller block.
  459.  
  460.    You can also save the clipboard contents to another file or append them
  461. to the end of another file.  First mark a block and either cut or copy it
  462. to the clipboard.  Then press CTL-K W to write or CTL-K A to append.  You
  463. will be prompted for the name of the file.  If you elect to append and the
  464. file does not exist, it will be created.
  465.  
  466.  
  467.  
  468. 9.0 Locating Data
  469.  
  470.    There are basically three ways to move the cursor to an area you want
  471. to edit.
  472.  
  473.    First you can use Page Down and Page Up to visually look for that area you
  474. want.  Primitive, but effective.
  475.  
  476.    Second, if you know the offset into the program of the area you want to 
  477. modify, press F5 and type the offset in hex.  
  478.  
  479.    The third method is to let the computer search for a known byte config-
  480. uration.
  481.  
  482.  
  483.  
  484. 9.1 Go to a Position in the File
  485.  
  486.    An offset or displacement is measured from the start of the file.  The
  487. first byte is offset 0, the second is 1, etc.  When you press F5, you are
  488. prompted for an offset which you provide in hex.  The cursor is then placed 
  489. at that address and display is updated to show the data at the cursor.
  490.  
  491.    This method is often used in applying documented patches supplied by a 
  492. software vendor.
  493.  
  494.  
  495.  
  496. 9.2 Search for Data
  497.  
  498.    Pressing F8 pops up a dialogue box that requests entry of a search argument.
  499. After supplying this argument, the cursor is positioned to the first 
  500. occurrence of that value in the file.  If it is not found, the cursor will 
  501. appear on the last byte of the file.  If a first occurrence is found, pressing
  502. F9 searches for the next occurrence.  If a second is found, pressing F9 again
  503. searches for the third occurrence, and so on.
  504.  
  505.    If the cursor is in the hex editing area, you will be prompted for up to
  506. 30 hex bytes of search argument (60 hex digits).  When the cursor is in
  507. the ASCII editing area, you may enter up to 60 ASCII characters for a search
  508. argument.  Admittedly the search arguments are small, but I have found that
  509. when editing binary files, you are generally not looking for long strings.
  510.  
  511.    Hex data is normally entered in sets of two hex digits (nibbles) since it
  512. takes two hex digits to represent one byte.  If you enter an odd number of hex 
  513. digits, a zero nibble is prepended to the argument.  For example, if you
  514. enter 18A, the resulting two bytes that are located are 01 8A.  
  515.  
  516.   No byte swapping is ever done to accommodate the PC's low-high storage 
  517. scheme of integer data.  So if you are looking for an integer value of 
  518. 1000 (decimal), hex 3E8, which is stored as hex E8 03, the search argument 
  519. you would provide is E803.  If you don't have a clue what this means, you 
  520. probably don't need to be concerned about using PSEDIT in this manner.
  521.  
  522.   The F7 key is used to enable or disable case-sensitive searches when in
  523. ASCII character mode.  The current state is shown on the top line of the 
  524. display.  If ON, upper/lower case letters must match exactly.  If OFF,
  525. upper and lower case letters are equivalent.  The CASE mode has no effect
  526. on hex mode searches.
  527.  
  528.   When searching in ASCII mode, and you want any number of trailing blanks 
  529. in the search string, you must terminate the string with a double quote (").
  530. If you want the last character to actually be a double quote, you must
  531. terminate the string with two double quotes ("").  Example:
  532.  
  533.   ABC""  = [ABC"]
  534.   ABC  " = [ABC  ]
  535.   ABC    = [ABC]
  536.  
  537.   In hex mode you specify trailing blanks with the hex characters 20.
  538.  
  539.  
  540.  
  541. 9.3 Find and Replace Data
  542.  
  543.    ALT-F8 invokes the search/replace procedure.
  544.  
  545.    The search/replace procedure works much like the search procedure des-
  546. cribed above.  Please read that section.  In addition, you will be prompted
  547. to input a replace string.  The rules for trailing blanks and quotes described
  548. above also apply to the replace string.
  549.  
  550.    When you proceed, each occurrence of the search string is located and you
  551. are prompted to see if you want to replace the instance of the search string
  552. at the current cursor location with the replace string you specified.  If you
  553. reply Y, the contents are replaced and the next search string is sought,
  554. repeating this procedure until all instances of the search string have been
  555. found.  You do not have to press F9.  If you reply N to a replace prompt,
  556. the file is not modified and the next instance of the search string is 
  557. sought.  If you press ESC while the replace prompt is displayed, the search/
  558. replace process is terminated.
  559.  
  560.   The initial window that prompts for the search and replace strings also
  561. contains a filed labeled "Prompt?".  If you place a Y here, processing is as
  562. described above.  If you place an N here, you are never prompted when an
  563. instance of the search string is located, and it is automatically replaced 
  564. with the replace string.  Every instance in the file is replaced.  You will
  565. see the search strings as they are located, but they will pass quickly.
  566.  
  567.  
  568. 10.0 Print the File
  569.  
  570.    Printing the file is easy.  You just press F6 and a window will pop up
  571. that tells you how many pages will be printed.  You may abort at this time
  572. by pressing ESCAPE or replying N to the "Continue? (Y/N)" prompt.  As pages
  573. are sent to the printer, the page number will be displayed.  You may press
  574. any key to cancel printing at the end of the current page.
  575.  
  576.    The output is sent to standard print (PRN).  The format is side-by-side 
  577. hex/ASCII like that displayed on the screen with offset addresses (dis-
  578. placements) at the start of each line.  880 (hex 370) bytes are printed on 
  579. each page.  The pages are numbered and the file name, size, date and time 
  580. appear at the beginning of each page.
  581.  
  582.    ALT-F6 allows you to supply a starting and ending address range to print.  
  583. The actual pages printed will probably not start and end with the addresses 
  584. you provided.  Rather the pages (as if you had printed the entire file) that 
  585. contain your starting address through your ending address will be the only
  586. pages printed.
  587.  
  588.    
  589.  
  590. 11.0 Saving the File
  591.  
  592.    Prior to pressing F2 to save the file, all modifications are only done in 
  593. virtual memory.  F2 writes the file image in memory over the file that was 
  594. originally loaded, and the changes become permanent.
  595.  
  596.    You may, however, change the file name at save time.  A dialogue box will
  597. appear with the current file name.  Accept it as is by pressing ENTER or
  598. modify it first.
  599.  
  600.    If the saved file name already exists you will be asked for verification
  601. before overwriting.
  602.  
  603.  
  604.  
  605. 12.0 Hex/Decimal Conversions and Calculations
  606.  
  607.    Pressing ALT-D (Decimal-to-hex) pops up a window into which up to eight-
  608. digit decimal numbers can be entered.  Pressing ENTER displays the results 
  609. of converting this number to hexadecimal.  Pressing ESC exits the window.
  610. Initially, the current cursor position is displayed in the operand field.
  611.  
  612.    Pressing ALT-H (Hex-to-Decimal) pops up a window into which up to eight-
  613. digit hexadecimal numbers can be entered.  Pressing ENTER displays the 
  614. results of converting this number to decimal.  Pressing ESC exits the window.
  615. Initially, the current cursor position is displayed in the operand field.
  616.  
  617.    ALT-C pops up a hex/decimal calculator which will add, subtract, multiply 
  618. or divide two hex, decimal or mixed values.  The result is displayed in both\
  619. hex and decimal.  When entering the values to be calculated, precede hex 
  620. values with an X (i.e. X31A0) and preceed decimal values with a D (i.e. 
  621. D4095).  Enter a plus (+) or minus (-) sign in the operator field.  Press 
  622. CTRL-ENTER when ready to calculate (or ENTER at the operator field).
  623.  
  624.    Since it is designed primarily to help you figure displacements within a
  625. program, the calculator operates on unsigned long (4-byte) integer values.
  626. Thus decimal points and negative numbers are not allowed.  If you subtract a 
  627. number from a smaller number, the result will be the 32-bit two's compliment
  628. of the negative result, usually a very high number.  For instance, if you 
  629. subtract 1 from 0, the result will be 4,294,967,295, the maximum for an
  630. unsigned long integer.  If you compute a number with results higher than
  631. the above number, the results will be inaccurate.  Let's hope you are not
  632. trying to edit any 4 Gb files!
  633.  
  634.   When you first invoke the calculator, the hex displacement of the current
  635. cursor location will be in the first operand.  This facilitates calculating
  636. displacements forward or backward from the cursor.  You can change the value
  637. to anything you like.
  638.  
  639.   HINT: The easy way to see where your cursor is currently located is to
  640. press ALT-D or ALT-H, rather than adding the horizontal offset to the offset 
  641. on the left of the screen.  The hex/decimal conversion windows will pop up 
  642. with the current cursor location displayed in the operand field.  ALT-D 
  643. displays the offset in Decimal, ALT-H displays it in hex.
  644.  
  645.  
  646.  
  647. 13.0 Exiting PSEDIT
  648.  
  649.    To quit PSEDIT, press ESC or ALT-X from the main edit screen.  If your 
  650. file has been modified since the last save, you will see a prompt: "Save 
  651. file? (Y/N)".  Pressing ESC again will return you to the point you were when 
  652. you pressed ESC.  A Y response invokes the save procedure then returns you to 
  653. DOS or to the file name pick list if the editor was entered via the pick list. 
  654. An N response bypasses the save procedure.  To exit from the pick list screen 
  655. to DOS, press ESC.  Once you exit to DOS or the pick list, any unsaved 
  656. modifications in the editor are lost.
  657.  
  658.  
  659.  
  660. 14.0 Help
  661.  
  662.    Pressing F1 pops up a help screen describing the editing and function keys.
  663. Pressing ESCAPE (or any key when last page is displayed) removes the help
  664. window and returns you to the editor.  Page Down and Page Up can be used to 
  665. move between help pages.
  666.  
  667.  
  668.  
  669. 15.0 A Useful Example - Modification of DOS 5's EDIT
  670.  
  671.    I prefer DOS 5's EDIT command by leaps and bounds over the EDLIN of
  672. previous DOSes, but there is one thing I especially don't like about it.
  673. When you select File/Open, it comes up with a default file list specification
  674. of *.TXT, like that is the only extension ever used for ASCII text files.  I
  675. would prefer *.* and let me choose from all of my files.  After reviewing
  676. all of the options, it appeared to me that there was no way to set this
  677. value to *.*.
  678.  
  679.    My next thought is that since there doesn't appear to be any type of
  680. configuration file for EDIT, the *.TXT string must be in the program, so
  681. I'll just pull out my trusty PSEDIT and zap it to *.*.  Let's do it.
  682.  
  683.    Go to your directory where you keep DOS (usually C:\DOS).  Type PSEDIT
  684. EDIT.COM.  Since we know we are looking for an ASCII string of *.TXT, press
  685. TAB to swap the cursor to the ASCII area and press F8 to search.  Enter
  686. *.TXT and press ENTER.  You now find that your cursor is positioned on the 
  687. last byte of the file.  This means it didn't find the string we were
  688. looking for.  Strange.
  689.  
  690.    But look! Right above our cursor are some messages that EDIT.COM displays.
  691. One of them reads, "Can not find file QBASIC.EXE."  Oh yeah, I read somewhere
  692. that the EDIT editor with DOS 5 was a version of the QBASIC editor.  Let's
  693. press ESCAPE, answer 'Y' and get back to the DOS prompt.  Now let's enter
  694. PSEDIT QBASIC.EXE.
  695.  
  696.    Again let's go to the ASCII area with TAB and search for *.TXT with F8.  
  697. Bingo! We found it.  
  698.    
  699.    In my copy of DOS 5.0's QBASIC.EXE, I am now at a displacement of hex 
  700. 3BCCA into the program and the cursor is positioned on the * of string *.TXT.  
  701. Hit the right arrow twice to position the cursor on the first T.  Type an 
  702. asterisk (*).  The string now shows *.*XT and the cursor is on the X.
  703. Lets change the X and T to hex 00s, which in most languages is used to 
  704. terminate a string.  Since we can't enter a binary zero field in the ASCII
  705. area, press TAB to switch the cursor back to the hex area.  Now type
  706. four 0s.  As you can see you have now changed the XT characters from
  707. hex 54 58 (the hex representation of X and T) to hex 00 00.
  708.  
  709.    This is what we wanted to do, so now let's save the file by pressing
  710. F2.  Since the file was not backed up beforehand, type in a new file name
  711. (QBASIC.1) just to make sure it works before we destroy the original. Exit 
  712. to DOS by pressing ESCAPE and Y.  Rename the original to QBASIC.BAK and 
  713. QBASIC.1 to QBASIC.EXE.  Now type EDIT and go to the File/Open screen.  Lo 
  714. and behold!  It now reads *.* and all of the files in the current directory 
  715. are displayed in the pick list.
  716.  
  717.    You can go delete QBASIC.BAK now.
  718.  
  719.  
  720.  
  721. APPENDIX A
  722.  
  723. Installation
  724.  
  725.     PSEDIT is distributed in a self-extracting ZIP file called PSEDT.EXE.  It 
  726. contains the following files:
  727.  
  728.         PSEDIT.EXE         The executable file for PSEDIT.
  729.         PSEDIT.INI         Configuration file for PSEDIT.
  730.         PSEDIT.DOC         The documentation file.
  731.         PSEDIT.HST         Modification descriptions for previous versions
  732.                            of PSEDIT. 
  733.         PSEDIT.Vnn         Modification descriptions for current version nn.
  734.         PRODUCTS.DOC       A description of other Parity Solutions products
  735.                            available on CompuServe and ZiffNet.
  736.  
  737.     For best results, extract the file into a directory on your PATH.  If you
  738. don't use a directory in your path, you will have to designate the directory
  739. containing PSEDIT.EXE when executing the program.
  740.  
  741.     If you have a utility directory that is on your PATH, this is an excellent
  742. location for PSEDIT.  An example installation would be:
  743.  
  744.     C:
  745.     CD \UTIL
  746.     copy [path]PSEDT.EXE
  747.     PSEDT
  748.     DEL PSEDT.EXE
  749.  
  750.     If they are not currently in your path, simply copy all of the files to a
  751. directory in your path.  Keep the PSEDT.EXE file anywhere you like, but give 
  752. plenty of copies, as is, to your friends.  If you register PSEDIT, you are not 
  753. licensed to give your serial number to anybody without first removing the 
  754. serialization from your copy.
  755.  
  756.  
  757.  
  758.  
  759. APPENDIX B
  760.  
  761.  
  762. Disclaimer
  763.  
  764. BECAUSE OF THE DIVERSE NATURE OF COMPUTER EQUIPMENT AND EXPERTISE OF USERS,
  765. PARITY SOLUTIONS AND GARY C. CRIDER MAKE NO WARRANTY ON THE PSEDIT PROGRAM
  766. WHATSOEVER, EXPRESS OR IMPLIED.  THE USER ASSUMES ALL RISK OF DAMAGE TO DATA 
  767. OR EQUIPMENT RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OR MISUSE OF THIS 
  768. PROGRAM PRODUCT.  THE USER MUST BE AWARE THAT USING PSEDIT TO MAKE ALTERATIONS 
  769. TO PROGRAMS OR DATA CAN RENDER THAT PROGRAM OR DATA USELESS.
  770.  
  771. USERS ARE ADVISED TO TEST MODIFICATIONS MADE WITH PSEDIT THOROUGHLY ON FILES 
  772. FOR WHICH A BACKUP EXITS.  ANY LIABILITY OF THE AUTHOR OR PARITY SOLUTIONS IS 
  773. LIMITED TO REPLACEMENT OR REFUND OF THE REGISTRATION FEE.
  774.  
  775. Any of the above disclaimers may not apply in your state if your state dis-
  776. allows such limits on product liability.
  777.  
  778.  
  779.  
  780. APPENDIX C
  781.  
  782.  
  783. Support
  784.  
  785.     I have tried to test the program to the fullest, but I am limited as to
  786. systems and configurations with which to test.  I have been programming for 18
  787. years and the one thing I know for sure is that bug free programs are very few
  788. and far between.  I can only promise to support the program to the best of my
  789. ability and provide fixes as expeditiously as possible.  PSEDIT has been used
  790. at my home and work site extensively for several years and has proven to be a
  791. reliable tool.
  792.  
  793.     Anyone can report problems and suggest changes.  Registered users get top
  794. priority in resolving their problems.  There are three ways you can report
  795. problems.  The preferred method is to contact me through CIS mail (not forum
  796. messages).  My CIS ID is 71760,3413.  You can also write me at:
  797.  
  798.    Gary C. Crider
  799.    Parity Solutions
  800.    1903 Pavia Court
  801.    Arlington, TX 76006
  802.  
  803.     The last method is to phone (817) 261-9552.  Since I am the sole technical
  804. support and the line is also used for my network consulting business, it is
  805. often hard to get through to me.  Please call and leave a message between 7:30
  806. am and 5:30 pm Central time.
  807.  
  808.     No matter which method you use, please give a brief description of your
  809. problem, the release number of your program, your registration serial number 
  810. if you are registered, and your phone number.  If I need more information, I 
  811. will contact you as soon as I can.  When I have a solution, I will contact 
  812. you however you prefer.
  813.  
  814.     I work full time, have a consulting business to run in my spare time and
  815. write programs instead of sleeping.  So please be a little patient with me.
  816.  
  817.     Program updates are available on CompuServe or can be requested from us
  818. for a $5 shipping and handling charge.  Add $1 for international shipping
  819. outside the U.S., Canada and Mexico.  A distribution disk of all Parity 
  820. Solutions products will be sent to you.  Specify disk size and format.
  821.  
  822.  
  823.  
  824. APPENDIX D
  825.  
  826.  
  827. Registration
  828.  
  829.  
  830.     I begin with an apology.  I hate programs that in any way inhibit func-
  831. tionality or performance for the shareware version.  But when it came down to
  832. feeding the family and paying the bills, I had a change of heart and inserted
  833. a pesky notice that pops up at the beginning and gets on your nerves.  I
  834. chose this approach above that of limited functionality.  The program's full
  835. capabilities are available for you to evaluate before you invest your hard-
  836. earned money.
  837.  
  838.     Registered users will receive a unique serial number and instructions on
  839. how to serialize the program.  Serialization can be re-applied to updated
  840. versions and in no way hinders your use of the program.  You can compress or
  841. decompress the program with no effect.  It is already compressed before 
  842. distribution.
  843.  
  844.     As a registered user, you will be able to update without re-registration
  845. or additional fees.
  846.  
  847.     To register your copy, please send $24 US ($95 per file server on LANs) 
  848. check or money order (sorry, no credit cards yet) to:
  849.  
  850.    Gary C. Crider
  851.    Parity Solutions
  852.    1903 Pavia Court
  853.    Arlington, TX 76006
  854.  
  855.     Purchase orders for amounts of $72 or more are accepted from U.S. or
  856. Canadian companies and institutions.
  857.  
  858.     Add $1 to total order for postage outside the U.S., Canada and Mexico.
  859.     
  860.     Or, you can register single-use licenses online quickly and easily in 
  861. Compuserve.  Simply GO SWREG and register ID #751.  Your registration will be 
  862. added to your Compuserve bill.  International exchange was never easier, and
  863. you save the $1 postage charge.
  864.  
  865.     If you send your CIS ID or register via SWREG, your registration will be 
  866. sent to you via CIS mail, along with instructions on how to serialize your copy 
  867. of PSEDIT.  This usually involves one day or less turnaround.
  868.  
  869.     Program diskettes are not normally shipped.  Normal distribution is via 
  870. CompuServe.  If you need a diskette, please see the instructions under Support 
  871. above.  You will receive a serial number and instructions for serializing your 
  872. copy of the program.
  873.     
  874.     Each license gives you or your company a single use permit for PSEDIT. It 
  875. is not restricted to a single machine as long as no two users can be simul-
  876. taneously using the program.  As Borland says, "treat it like a book."  As an 
  877. example, if you register PSEDIT for your home computer, but during the day you 
  878. use a portable or a computer at work,  you may keep PSEDIT on both machines as 
  879. long as no one is at home using it on your home computer.
  880.  
  881.     LAN licenses grant rights to all users of a file server.  If inter-
  882. networking, a license must exist for each file server that contains a copy
  883. of PSEDIT.EXE.  If two or more file servers exist on a single LAN strictly for
  884. mirroring data and fault-tolerance, these will be counted as a single file
  885. server for licensing purposes.  If in doubt, contact me.  We can work out
  886. an agreement.
  887.  
  888.     Site licensing is also available on a negotiated price basis.  I guarantee
  889. it will be an economical alternative to buying licenses for each user.
  890.  
  891.     You may freely distribute the original PSEDT.EXE file in any way you see
  892. fit other than selling it.  Users' groups and shareware distribution services
  893. may charge a reasonable fee for the medium and duplication costs.  Bulletin 
  894. boards may not charge additional fees for downloading this specific program, 
  895. other than normal connect-time and/or membership charges.
  896.  
  897.     You are NOT licensed to give anyone your serial number unless you first
  898. remove all serialization from your computer.  You may then no longer use that
  899. serial number.  Only Parity Solutions has the authority to issue serial
  900. numbers.
  901.  
  902.     Modification of PSEDIT.EXE in any way is prohibited and unlawful.
  903.     
  904.     Licensees of Parity Solutions' BEDIT program may serialize PSEDIT by
  905. renaming BEDIT.SER to PSEDIT.SER.
  906.  
  907. ==============================================================================
  908.                 
  909.                           ORDER FORM FOR PSEDIT
  910.  
  911. Send checks payable to:
  912.  
  913.   Parity Solutions                
  914.   1903 Pavia Court
  915.   Arlington, TX 76006
  916.  
  917.  
  918.  
  919. BILLING ADDRESS:                        SHIP TO (If different):
  920.  
  921. NAME:    _____________________________  NAME:      ___________________________
  922.       
  923. COMPANY: _____________________________  COMPANY: _____________________________
  924.  
  925. STREET:  _____________________________  STREET:  _____________________________
  926.  
  927.          _____________________________           _____________________________ 
  928.         
  929. CITY/ST: _____________________________  CITY/ST: _____________________________
  930.  
  931. ZIP/POSTAL CODE: _____________________  ZIP/POSTAL CODE: _____________________
  932.  
  933. COUNTRY: _____________________________  COUNTRY: _____________________________
  934.  
  935. PHONE:   _____________________________  PHONE:   _____________________________
  936.  
  937.  
  938. CompuServe/Internet ID: ________________________________________(Optional)
  939.  
  940.  
  941.    NOTE: Parity Solutions sends a serial number for each registration and 
  942.          instructions for serializing your program.  A diskette containing
  943.          the latest releases of all Parity Solutions shareware products is
  944.          available for $5.00 U.S.  The current release of PSEDIT is avail- 
  945.          able for downloading on CompuServe in the IBMSYS forum.
  946.  
  947.  
  948.    QTY   DESCRIPTION                             PRICE EA.   TOTAL PRICE
  949.  
  950.    ___   PSEDIT license and registration           $24.00    ___________
  951.  
  952.    ___   PSEDIT Network license and registration    95.00    ___________
  953.  
  954.    ___   Parity Solutions shareware diskette         5.00    ___________
  955.  
  956.          International postage outside U.S.,         1.00    ___________
  957.          Canada and Mexico.                
  958.  
  959.                              
  960.                                           Total Enclosed:    ___________
  961.  
  962.  
  963. Diskette size (if ordered): __ 5.25" 1.2M  __ 3.5" 1.44M
  964.  
  965.  
  966. Thank you for doing business with Parity Solutions.  (817) 261-9552
  967.  
  968. Parity Solutions is a partnership of Gary C. Crider and Russell L. McCloud.  
  969. Federal tax identification number 75-2468376.
  970. ==============================================================================
  971.  
  972.