


     BPE(1)               XENIX System V (LOCAL)                BPE(1)



     NAME
          bpe - examine and patch binary files

     SYNOPSIS
          bpe binary.file

     DESCRIPTION
          bpe allows a file to be searched and modified in either
          ASCII or hexadecimal. Each buffer is displayed in both
          modes.

        Commands - single character, no RETURN
          D - Dump one page from current file position
          S - Set current file pointer
          F - Find string in file (beginning from curr. position)
          / - Same as F
          H - locate hex bytes in file (beginning from curr. position)
          N - Display next sector
          P - Display previous sector
          + - Scroll forward 2 lines
          - - Scroll back 2 lines
          e - Edit ASCII portion of file
          E - Edit binary portion of file
          W - Write modified sector back to disk
          Q - Quit Program
          ? - help

        Editing a file
          Enter an editing mode by typing 'e' (for ASCII edit) or 'E'
          for hex edit. The cursor may be moved either by the arrow
          keys or the vi-style ^H, ^J, ^K, ^L keys, depending on
          compilation options. Place the cursor on the byte to change
          and type either a printing ASCII character or two digit hex
          value. Exit either edit mode by typing ^E. When you are
          satisfied with your editing, enter the W command to write
          the modified portion of the file back to disk.

        Searching for data
          You may search for hex data by giving the h command and
          entering a string of hex digits. The search procedes forward
          from the current location until a matching string is found.
          The display is adjusted to put the first byte at the top of
          the screen (but see configuration options). If no pattern is
          specified the previous pattern is used.

          To search for a string, enter the F (for find) command, or
          the vi style / command. At the prompt type in a string and
          press return. The search procedes as with a hex byte search.
          If you wish to repeat a string search, enter the F command
          again and press return. This will repeat the search for the
          previous string. If the starting position has not been
          adjusted the search will start one character past the



     Page 1                                           (printed 3/7/89)






     BPE(1)               XENIX System V (LOCAL)                BPE(1)



          location of the last occurence found.

        Configuration options
          The makefile contains configuration option, identifiable by
          comments.  These are all at the top of the makefile. If your
          curses supports KEYPAD definition for your terminal, you may
          use the cursor keys on the keypad.  This is generally only
          found in SysV systems with termlib versions of curses. If
          you don't have that feature the NOKEYPAD option will allow
          use of vi style cursor keys.

          When searching, if you prefer to see the pattern in context
          you may set the CLINES to the number of lines of context
          displayed before the pattern found. This may cause problems
          doing hex searches. In addition, if you want the display to
          start on a 16 byte boundary, to match od or hd output, you
          may enable the ALLIGN option.

     WARNINGS
          Illegal commands are flagged as such.

     SEE ALSO
          od, hd, possibly adb.

     DIAGNOSTICS
     LIMITATIONS
     INSTALLATION
          For Xenix and V7 just run make. There are shell scripts for
          other common systems. mksysv2 - for SysV.2, mkvat - for
          V/AT, mkbsd - for BSD4.3. In addition the makefile is
          heavily commented in the configuration section.

     AUTHOR
          Original author:
               Andreas Pleschutznig
               Teichhofweg 2
               8044 Graz
               Austria
          Contributions by:
                  maart@cs.vu.nl
               jon@jonlab
               davidsen@crdos1.uucp

          Comments and bug reports to:
               andy@mssx (mcvax!tuvie!mssx!andy)










     Page 2                                           (printed 3/7/89)



