home *** CD-ROM | disk | FTP | other *** search
/ Black Box 4 / BlackBox.cdr / fileutil / hexedit2.arj / HEXEDIT.DOC next >
Encoding:
Text File  |  1992-03-10  |  22.3 KB  |  541 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.                                HEXEDIT
  24.  
  25.  
  26.  
  27.                            DOS File Editor
  28.  
  29.  
  30.  
  31.                              Version 2.0
  32.  
  33.  
  34.  
  35.                  Copyright 1991,1992 by Larry Michaels
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.                          Table of Contents
  47.  
  48.  
  49.           INTRODUCTION...................................1
  50.  
  51.           SHAREWARE NOTICE...............................1
  52.  
  53.           REGISTRATION FORM..............................2
  54.  
  55.           NOTES ON USING HEXEDIT.........................3
  56.  
  57.             FILES........................................3
  58.  
  59.             CHANGING FILE READ/WRITE MODE................3
  60.  
  61.             CHANGING FILE HIDDEN ATTRIBUTE...............4
  62.  
  63.             EDITING ANOTHER FILE.........................4
  64.  
  65.             IMPORTING FILES..............................4
  66.  
  67.             DISPLAYING THE DIRECTORY.....................4
  68.  
  69.             CONFIGURATION FILE...........................4
  70.  
  71.             SCREEN LAYOUT................................5
  72.  
  73.             EDITING......................................5
  74.  
  75.             CURSOR MOVEMENT..............................5
  76.  
  77.             SEARCH AND REPLACE...........................6
  78.  
  79.             BLOCK OPERATIONS.............................6
  80.  
  81.             PRINTING.....................................6
  82.  
  83.             FILE TRUNCATION..............................7
  84.  
  85.             REPEAT CHANGE................................7
  86.  
  87.             UNDO.........................................7
  88.  
  89.             SCREEN ATTRIBUTES............................7
  90.  
  91.             HELP.........................................7
  92.  
  93.             DOS SHELL....................................7
  94.  
  95.          LIST OF HEXEDIT COMMANDS........................8
  96.  
  97.  
  98.  
  99.                                   1
  100.  
  101.  
  102.     INTRODUCTION
  103.  
  104.     HEXEDIT is a simple, easy to use editor with which you can create,
  105.     view, and edit DOS files in both hex and ASCII formats.  I wrote
  106.     HEXEDIT to fill a need which I often have to be able to create and
  107.     edit binary files such as the input and output files for other
  108.     applications which I am developing.  After looking through both the
  109.     commercial and shareware markets, and asking other software developers,
  110.     I came to the conclusion that there was no product available for
  111.     editing binary files as easily as text files.  I added a few special
  112.     features such as the ability to set read/write and hidden attributes,
  113.     jump to any file offset, search for/replace strings in both hex and
  114.     ASCII formats, insert the contents of another file into the file being
  115.     edited, and truncate the file after the cursor to facilitate specific
  116.     tasks which frequently need to be done.
  117.  
  118.     I hope that you will try out HEXEDIT, and find it usefull.  I am
  119.     anxious to receive comments and suggestions from users.  Version
  120.     2.0 includes a few new features not in version 1, as well as a few
  121.     bug fixes.  This document describes HEXEDIT's features.  While running
  122.     HEXEDIT, help can be obtained by pressing F1.
  123.  
  124.  
  125.     SHAREWARE NOTICE
  126.  
  127.     HEXEDIT is SHAREWARE software.  This means that you are free to
  128.     try it out for 30 days to decide whether or not you wish to use it.
  129.     If you decide to use it, you are urged to please send a very modest
  130.     $16 US registration fee, along with any comments or suggestions you
  131.     may have.  Your registration will inform me that you are using my
  132.     software, and help pay my rent.  Software development is my only
  133.     source of income, so your cooperation in registering will be greatly
  134.     appreciated.  A registration form is included in this document, and
  135.     can also be printed out by pressing 'P' from the startup screen.
  136.  
  137.     You are free (and encouraged) to distribute HEXEDIT to friends,
  138.     co-workers, neighbors, etc. with the following conditions:
  139.  
  140.     - This file (HEXEDIT.DOC) is included, and the files are left as they
  141.       are without any modifications,
  142.     - If any fee is charged, it should be minimal,
  143.     - The recipients know, or are informed about, the shareware concept.
  144.  
  145.     I have made a sincere effort to remove all bugs from this software.
  146.     If any bugs are found however, I apologize and request that they be
  147.     brought to my attention.  No warranty, either explicit or implied
  148.     is (or can be) made on this software.  I assume no financial
  149.     responsibilty for any loss of data, time, profits, or other damages
  150.     resulting from the use (or misuse) of HEXEDIT.
  151.  
  152.     Thank you for trying HEXEDIT; I hope that you will find it useful.
  153.  
  154.                                         Larry Michaels
  155.                                         P.O. Box 59379
  156.                                         Chicago, IL  60659   U.S.A.
  157.  
  158.     A registration form can be printed by pressing 'P' from the startup
  159.     screen.  A copy of the form is also included on the    following page.
  160.  
  161.  
  162.  
  163.                     INVOICE FOR HEXEDIT VER 2.0
  164.  
  165.   Remit to:                        From:
  166.  
  167.   Larry Michaels                   _______________________________
  168.   P.O. Box 59379
  169.   Chicago, IL 60659                _______________________________
  170.  
  171.                                    _______________________________
  172.  
  173.                                    _______________________________
  174.  
  175.                                    _______________________________
  176.  
  177.                                    _______________________________
  178.  
  179.                                    Phone:_________________________
  180.  
  181.  
  182.   Where did you get your copy of HEXEDIT? ________________________
  183.  
  184.  
  185.   Registration $16US per user    Quantity:____ x $16 = ___________
  186.  
  187.   IL residents add 7% sales tax:                       ___________
  188.  
  189.   Total:                                               ___________
  190.  
  191.  
  192.   Comments:
  193.  
  194.  
  195.                                   3
  196.  
  197.  
  198.     NOTES ON USING HEXEDIT
  199.  
  200.     FILES
  201.  
  202.     HEXEDIT will accept any file which can be opened and read by DOS.  The
  203.     file name may be supplied on the command line.  If no file name or an
  204.     invalid file name is specified, the file "NONAME.###" will be created
  205.     (or opened, if it already exists).  If a non-existent file is
  206.     specified, a new file will be created.  For files which do not have
  207.     write permission, HEXEDIT will display the file, but will not accept
  208.     any commands to alter it.  On the top line, the words "READ ONLY" will
  209.     appear.  The read/write mode of the file can be changed to allow
  210.     editing using the Change File Mode command described later.
  211.  
  212.     For files which are not read-only, HEXEDIT automatically creates a
  213.     backup file upon startup.  All changes are made to the backup file,
  214.     and the original file is not altered until the user presses a save
  215.     key (Alt S or Alt Z).  If HEXEDIT detects upon startup that there is
  216.     not enough disk space to create a backup file, it will open the file
  217.     in read-only mode.
  218.  
  219.     The backup file is given the same name as the original file with the
  220.     file extension ".BAK".  If the original file has the extension ".BAK"
  221.     the backup file is given the extension ".BAC".
  222.  
  223.     During an edit session, HEXEDIT may create a temporary storage file
  224.     with the same name as the original file and the extension ".$@!".
  225.     This file is automatically deleted upon exit.  If HEXEDIT runs out of
  226.     disk space during a disk write, the user will be informed, and the
  227.     results may be unpredictable.  The user should make sure that there is
  228.     at least enough free disk space to accommodate a backup file of the
  229.     same size as the original plus a temporary file of about 120 Kbytes.
  230.     Large block operations will require more disk sapce.
  231.  
  232.     To save the file (ie. update the original file) without leaving
  233.     HEXEDIT, Alt S is used.  Alt Z will save the file and exit.  Alt A
  234.     will save the file under a new name provided by the user.
  235.  
  236.     HEXEDIT may be exited without affecting the original file (providing
  237.     that Alt S has not been pressed already) by pressing Alt X.  If any
  238.     changes have been made during the editing session (or since the last
  239.     save), the user will be prompted whether or not those changes should
  240.     be abandoned.  Pressing "Y", will cause HEXEDIT to close without
  241.     saving, while "N" will cause the file to be updated.  ESCAPE will
  242.     cancel the request.
  243.  
  244.  
  245.     CHANGING FILE READ/WRITE MODE
  246.  
  247.     As mentioned, HEXEDIT will open both files with read-write and
  248.     read-only permission.  The user may change the read/write permission
  249.     mode of the file by pressing Alt M and selecting the desired file
  250.     mode.  A read-only file which is changed to read-write will be changed
  251.     immediately to read-write, a backup file will be created, and
  252.     modifications will then be allowed.  A file with read-write permission
  253.     which is changed to read-only will not actually be changed until one
  254.     of the save commands are issued by the user.  Therefore, changes to the
  255.     file will still be allowed until the file is saved.
  256.     
  257.                                   4
  258.  
  259.  
  260.     CHANGING FILE HIDDEN ATTRIBUTE
  261.  
  262.     HEXEDIT provides the facility to set the hidden attribute bit of the
  263.     file being edited.  Files with their hidden attribute bit set will not
  264.     be listed by the DOS DIR command nor by many other applications.  The
  265.     user may set this attribute by pressing Alt H.  When the file's
  266.     hidden attribute is changed, HEXEDIT will indicate the change on the
  267.     top line by placing parentheses around the file name (for hidden files),
  268.     or by removing the parentheses.
  269.  
  270.  
  271.     EDITING ANOTHER FILE
  272.  
  273.     At any time, the user can switch to a different file for editing by
  274.     pressing Alt E.  If changes have been made to the current file since
  275.     the last save, the user will be prompted as to whether or not the
  276.     changes should be abandoned.  The user will then be prompted to enter
  277.     a file name.  If a valid file name is entered, the current file will
  278.     be closed, the specified new file will be opened (or created), and
  279.     editing will proceed with the new file.
  280.  
  281.  
  282.     IMPORTING FILES
  283.  
  284.     HEXEDIT can insert the contents of any file into the file currently
  285.     being edited.  When Alt I is pressed, the user will be prompted for
  286.     the name of the file to import.  The contents of that file will be
  287.     inserted in the current file, starting at the current offset.
  288.  
  289.  
  290.     DISPLAYING THE DIRECTORY
  291.  
  292.     Whenever the user is in a file name prompt field (import file,
  293.     save as, edit another file), the contents of the directory can be
  294.     displayed by either pressing F7, or by entering a path name on the
  295.     prompt line and pressing ENTER.  Disk drive specifiers can be
  296.     included in the path.  Up to about 4500 files per directory can
  297.     be displayed.  The names of hidden files and directories (ie.
  298.     those which have their hidden attribute bit set) are displayed
  299.     enclosed in parentheses.  The upper left corner of the directory
  300.     screen shows the current drive and directory.
  301.  
  302.     While viewing the directory, the arrow keys, PgUp, PgDn, Ctrl PgUp,
  303.     and Ctrl PgDn are be used to move around the directory.  The TAB key
  304.     is used to toggle between the directory display and the prompt line.
  305.     By entering a different path on the prompt line, a different
  306.     directory can be displayed.  The currently selected file can be
  307.     deleted by pressing DELETE.
  308.  
  309.  
  310.     CONFIGURATION FILE
  311.  
  312.     HEXEDIT reads and writes a startup file named HEXEDIT.CFG.  This file
  313.     specifies the screen attributes and the printer setup parameters. Upon
  314.     startup, HEXEDIT looks in the current directory for this file and if
  315.     it is not found there, it searches the DOS path for it.  If the file
  316.     is not found, default values are used.  Upon exit, HEXEDIT updates
  317.     this file if any configuration changes have been made, or creates a
  318.     new file if none already exists.
  319.     
  320.                                   5
  321.  
  322.  
  323.     SCREEN LAYOUT
  324.  
  325.     The HEXEDIT screen is broken into three main sections.  The top line
  326.     displays the name of the file being edited on the left side, and the
  327.     Insert/Overtype mode on the right.  If the file's hidden attribute bit
  328.     is set, the file name will appear enclosed in parentheses.  The bottom
  329.     line normally displays the file offset of the byte at which the cursor
  330.     is positioned.  This line is also used to prompt the user for
  331.     information and to display messages.
  332.  
  333.     The main part of the screen is broken into three columns.  On the
  334.     left of each row is displayed the file offset of the first byte on
  335.     that line.  In the middle are the hex representations of up to 16
  336.     bytes, while on the right, the ASCII character repesentations of
  337.     the same bytes are displayed.  The cursor may be positioned on any
  338.     byte in either the hex of ASCII fields.  The cursor can be toggled
  339.     between fields by pressing ALT T.
  340.  
  341.  
  342.     EDITING
  343.  
  344.     The actions taken upon a keystroke depend on the current location of
  345.     the cursor and the Insert/Overtype mode.  When the Insert mode is set
  346.     and the cursor is in the hex portion of the screen, only they keys
  347.     0-9, a-f (besides control keys) are accepted.  If the cursor is on
  348.     the upper nibble of a byte, a new byte will be inserted with the
  349.     lower nibble the same as the original byte and the upper nibble
  350.     depending on the key pressed.  The cursor will then be positioned at
  351.     the lower nibble of the new byte.  The next keystroke will set the
  352.     lower nibble of that byte.  If the cursor is on the lower nibble of
  353.     a byte when a key is pressed, a new byte will be inserted with the
  354.     upper nibble the same as the original byte, and the lower nibble
  355.     depending on the key pressed.  In Overtype mode, the nibble at which
  356.     the cursor is positioned will be overwritten.
  357.  
  358.     If the cursor is in the ASCII field when a key is pressed, a new byte
  359.     will be inserted at the current position.  Any byte value (0-255) will
  360.     be accepted in this field.  In Overtype mode, the current nibble or
  361.     byte will be overwritten with the new one.
  362.  
  363.     The Insert/Overtype mode can be toggled by pressing the INSERT key, and
  364.     is displayed on the top line of the screen.
  365.  
  366.     In Insert mode, pressing the DELETE key will cause the current byte to
  367.     be deleted.  In the hex field, BACKSPACE will cause the previous byte
  368.     to be deleted.  In the ASCII field however, since Backspace is a valid
  369.     ASCII byte, pressing BACKSPACE will cause a backspace byte (08h) to be
  370.     inserted.  To backspace in the ASCII field, Shift BACKSPACE is used.
  371.  
  372.  
  373.     CURSOR MOVEMENT
  374.  
  375.     The arrow keys move the cursor one byte, nibble, or line at a time.
  376.     Page Up and Page Down will position the cursor one page up or down.
  377.     Ctrl Pg Up moves to the beginning of the file and Ctrl Pg Dn moves to
  378.     the end of the file.  The Home key causes the cursor to be positioned
  379.     on the first byte on the current line, while the End key positions the
  380.     cursor at the last byte on the line.  Alt T toggles the cursor between
  381.     the hex and ASCII fields.
  382.     
  383.                                   6
  384.  
  385.  
  386.     SEARCH AND REPLACE
  387.  
  388.     HEXEDIT allows the user to jump to any given file offset or search for
  389.     a string of bytes.  Strings may also be replaced one at a time or
  390.     globally.
  391.  
  392.     To go to a particular byte offset, Alt G is used.  The user will be
  393.     prompted for an offset value which must be given in hex.  Preceeding
  394.     zeroes need not be entered.  Pressing ESCAPE while in the will prompt
  395.     field will cancel the operation while ENTER will execute the operation.
  396.  
  397.     Strings for search and replace may be specified in either hex or ASCII.
  398.     To specify a search string in hex, the F2 key is used, while Alt F2
  399.     is used for ASCII.  The keys F3 (hex) and Alt F3 (ASCII) request
  400.     search and replace.  When entering a string in ASCII format, to escape,
  401.     backspace, or execute, Shift ESCAPE, Shift BACKSPACE, and Shift ENTER
  402.     resectively must be used since the ESCAPE, BACKSPACE, and ENTER keys
  403.     produce valid bytes which will be included in the strings.
  404.  
  405.     After a match of the search string has been found, the next or
  406.     previous matches may be found by pressing F4 or Ctrl F4 respectively.
  407.  
  408.     HEXEDIT will also search the file to count the number of occurrences
  409.     of a string.  The keys F9 (hex) and Alt F9 (ASCII) are used.  This
  410.     function works much the same way as a global string replace, except
  411.     that occurrences of the string are counted, but not    replaced.
  412.  
  413.     For all string search and replace functions, searching begins at the
  414.     current offset and proceeds in the forward direction.  To search the
  415.     file before the current offset Ctrl F4 (find previous) is used.
  416.     Whenever the current offset lies within a selected block when a search
  417.     is initiated, the user will be prompted whether the entire file should
  418.     be searched, or only the block.  If the user selects the block only
  419.     option, further F4 (find next) commands will only cause the blocked
  420.     part of the file to be searched.
  421.  
  422.  
  423.     BLOCK OPERATIONS
  424.  
  425.     Any section of the file may be blocked.  Blocks may be created and
  426.     resized using Alt B, or by using the cursor control keys while holding
  427.     the Shift key.  To copy a block into the block buffer Alt C is used.
  428.     Shift DELETE will cause the block to be deleted and copied into the
  429.     block buffer.  To remove the block highlight (unblock), Alt R is used.
  430.  
  431.     Once a block has been copied or deleted, Shift INSERT will cause the
  432.     block to be inserted at the current offset.
  433.  
  434.  
  435.     PRINTING
  436.  
  437.     HEXEDIT can print all or part of the file being edited.  Alt P causes
  438.     the entire file be printed, while ALT L prints only the blocked bytes.
  439.     The file is printed in the same format as is displayed on the screen
  440.     with the exception that bytes with values below 20h and above 7fh are
  441.     replaced with space characters in the ASCII field to avoid confusing
  442.     the printer.
  443.  
  444.     The printer port, lines per page, and end of page character can be set
  445.     by pressing ALT O.  These values are stored in the startup file
  446.     HEXEDIT.CFG, and read upon startup.
  447.     
  448.                                   7
  449.  
  450.  
  451.     FILE TRUNCATION
  452.  
  453.     HEXEDIT provides a fast and simple way of truncating a file.  By
  454.     pressing F10, the file will be truncated following the cursor (ie.
  455.     the current byte will become the last byte of the file).
  456.  
  457.  
  458.     REPEAT CHANGE
  459.  
  460.     Single-byte changes can be repeated an indefinite number of times by
  461.     pressing F8.  In Insert mode, the last byte inserted or changed (ie.
  462.     the new value) will be inserted at the current cursor position.  In
  463.     Overtype mode, the current byte will be changed to the value of the
  464.     last changed or inserted byte.  This feature is useful for entering
  465.     multiple instances of special bytes which can not otherwise be
  466.     produced with a single keystroke, such as those entered using the
  467.     numeric keypad with Alt.
  468.  
  469.  
  470.     UNDO
  471.  
  472.     Pressing Alt U will cause the last change to be undone.  This works
  473.     for single byte changes as well as replaces and block insertions and
  474.     deletions.
  475.  
  476.  
  477.     SCREEN ATTRIBUTES
  478.  
  479.     The screen attributes may be changed by pressing F5 (foreground) and
  480.     F6 (background).  The foreground and background attributes of the
  481.     top and bottom lines (and help screens) are changed with Alt F5 and
  482.     Alt F6.
  483.  
  484.  
  485.     HELP
  486.  
  487.     Help screens can be displayed by pressing F1.
  488.  
  489.  
  490.     DOS SHELL
  491.  
  492.     A DOS shell may be opened by pressing Alt D.  Typing "ESCAPE" at the
  493.     DOS prompt while in the shell will return control to HEXEDIT.  Be
  494.     careful not to alter the file being edited, the backup file, or the
  495.     temporary file ("xxx.$@!") while in the DOS shell as the results will
  496.     be unpredictable.
  497.  
  498.                                   8
  499.  
  500.  
  501. The following is a list of HEXEDIT commands:
  502.  
  503. Change Scrn FG color  F5        Changes the foreground color of the screen.
  504. Change Scrn BG color  F6        Changes the background color of the screen.
  505. Change Scrn FG color  Alt F5    Changes the foreground color of lines 1&25.
  506. Change Scrn BG color  Alt F6    Changes the background color of lines 1&25.
  507. Configure Printer     Alt O     Allows printer parameters to be set.
  508. Copy Block            Alt C     Copies the selected block to the block buffer.
  509. Count Occurrs (ASCII) Alt F9    Counts the # of occurrences of an ASCII str.
  510. Count Occurrs (hex)   F9        Counts the # of occurrences of a hex string.
  511. Delete Block          Shift DEL Moves the selected block to the block buffer.
  512. DOS Shell             Alt D     Goes to DOS.
  513. Edit Another File     Alt E     Opens a different file for editing.
  514. Find Next             F4        Finds next occurrence of search string.
  515. Find Previous         Shift F4  Finds previous occurrence of search string.
  516. Goto File Offset      Alt G     Jumps to to given file offset
  517. Help                  F1        Displays help screens.
  518. Import File           Alt I     Inserts the contents of the specified file.
  519. Insert Block          Shift INS Inserts the contents of the block buffer.
  520. Print All             Alt P     Prints entire file.
  521. Print Block           Alt L     Prints selected block.
  522. Quit                  Alt X     Quits without saving.
  523. Remove Block Markers  Alt R     Unselects block.
  524. Repeat Last Byte      F8        Repeats last byte insert/change
  525. Replace ASCII String  Alt F3    Searches for and replaces an ASCII string.
  526. Replace Hex String    F3        Searches for and replaces a hex string.
  527. Save and Quit         Alt Z        Saves file and quits.
  528. Save As               Alt A     Saves file under specified name.
  529. Save File             Alt S     Saves file and continues.
  530. Search for ASCII Str  Alt F2    Searches for a string entered in ASCII format.
  531. Search for Hex Str    F2        Searches for a string entered in hex format.
  532. Set Block Marker      Alt B     Sets and moves block start and end.
  533. Set File Mode         Alt M     Sets the current file's read/write mode.
  534. Set File Hidden Attr  Alt H     Sets the current file's hidden attribute.
  535. Show Directory        F7        When in file name fields displays directory.
  536. Toggle Field          Alt T     Toggles between hex and ASCII fields
  537. Togl Ins/Ovrtype mode INSERT    Toggles between Insert and Overtype modes.
  538. Truncate File         F10       Truncates the file after the current offset.
  539. Undo                  Alt U     Undoes last change/insert/delete.
  540.  
  541.