From: pvr@wang.com ()
Subject: Re: Modifying binary file
Organization: Wang Labs, Lowell MA, USA
Date: Mon, 16 Nov 1992 16:52:20 GMT

jjamison@bellahs.com (John Jamison RD AC) writes:

>I'd like to be able to "patch" a binary image after it has been linked by ld.
>What are some possible strategies for doing this? I'm envisioning patching the
>image in order to subtitute a "version number" and "link date/time" into the 
>image.

	If you want to do it by hand you could try BEAV.   If you want
to have some automated way of doing it you could write a macro
in BEAV or write a C program.   The following is my standard advertisment
for BEAV;

	BEAV (Binary Editor And Viewer), is a full featured binary file 
editor.	  Just about any operation that you could want to do to a binary 
file is possible with BEAV.   You can insert or delete in the middle of 
a file thereby changing it's size.   You can edit multiple files in 
multiple windows and cut and paste between them.   You can display and 
edit data in hex, octal, decimal, binary, ascii, or ebcdic formats.   You 
can display data in byte, word, or long word formats in either Intel or 
Motorola byte ordering.   You can send the formatted display mode to a 
file or printer.

	BEAV is based on the source for emacs for display and keyboard handling 
functions.   The binary file handling and display formats are special
to BEAV.   There is a full manual included in this release.   There
are makefiles for unix, xenix 286, AmigaDOS, and MSC 5.1 under DOS.   The 
old Wang PC is supported.   This has been tested on 286 and 386 PC's under 
SCO UNIX and XENIX and AIX on a RS6000.   There are a number of makefiles 
included, select the appropriate one and rename it to makefile.

	BEAV is available various archives, on WSMR-SIMTEL20.ARMY.MIL it is;

	PD1:<MDSOS.FILUTL>BEAV133.ZIP	MSDOS executable and doc

	PD1:<MDSOS.FILUTL>BEAV133S.ZIP	source and doc


      Version 1.33 (8/9/92) of BEAV contains the following
enhancements;

*			A new command, screen-rows, allows you to change the
	  number of rows BEAV uses in the current screen.   The command
	  can be issued anytime, the current windows will be adjusted
	  or killed as necessary.

*			Floating point numbers can be displayed.

*			BEAV uses the current screen color setting and does
	  not change them on exiting.   Thanks to Derek Millar,
	  dmillar@ocf.berkeley.edu

*			The processing of the beavrc file has been enhanced
	  to allow the processing of most commands.

*			The default key binding for "n-way-combine" command 
	  has been changed to ESC Ctl P.   This makes ESC Ctl F 
	  available for the "display-float" command.

*           The copy-mark-to-cursor command would corrupt data if
      the region to be copied was greater than 4096 bytes.   This
      is fixed.

*           The replace command would fail to find all occurances
      of a search pattern if the pattern fell on the boundary of
      certain internal data structures.   This is fixed.

*           The memory used to handle screen images is now
      allocated at load time rather than staticaly allocated.
      This will allow systems with any screen size to be filled.
      This depends on the variable "nrow" being properly set by
      whatever terminal output file you have configured.   The
      default for "nrow" is the #define "NROW" as set in the
      def.h file.   The colunms remain fixed at 80.

*           Under Unix, BEAV will use the full screen as reported
      by the ioctl inquiry of the tty device.   Previously, the
      bottom line was not used.

*           The prompt line is now erased properly.

*           Not new to this release, but important for foreign
      language users.   All English text in BEAV is contained in
      the file "text.c".   It should be relatively easy to
      translate and recompile.   If someone wants to send me a
      translated version of "text.c", I will include it in my
      next release.


	I am willing to maintain BEAV and will entertain suggestions for
modifications and/or bug fixes.   I can be reached at;

		pvr@wiis.wang.com

or at;

		Peter Reilley
		19 Heritage Cir.
		Hudson, N.H. 03051
--
>>>>>>>>>>>> Peter Reilley ..... pvr@wiis.wang.com ..... KA1LAT <<<<<<<<<<<<<
                     Well, that about says it.
Newsgroups: comp.unix.aix