[fa.info-vax] To fix /TRACEBACK images...

KVC@engvax.UUCP (09/27/85)

For anyone having problems with installing images with traceback
handlers, such as

> EUNICE_VFORKCLI:/OPEN/HEADER/SHARED/PRIV=(CMKRNL,CMEXEC)
> %INSTALL-E-FAIL, failed to CREATE entry for
>                  DISK$VAXVMS:<SYS0.SYSEXE>CLISETUP.EXE
> -INSTALL-E-IMGTRACED, /TRACEBACK image cannot be privileged or
>                       execute_only

This does not answer all the problems in the above referenced message,
but it may help somewhat.  I picked this off the Digital Software
Information Network.  Note than when invoking this command file to
patch an image, you must give ONLY the image filename, do NOT include
the .EXE file type or patch will attempt to journal to the .EXE file...
For example:

    $ @zap_traceback imagename

-----------------------  ZAP_TRACEBACK.COM  -----------------------------
$ ! This procedure calls PATCH/ABSOLUTE to modify the transfer
$ ! address array for an image.  It deletes the first transfer
$ ! address in the array by moving the following 3 entries in
$ ! the array up on position, while placing a zero in the last
$ ! position vacated.
$ !
$ ! This procedure only operates on images containing the address
$ ! SYS$IMGSTA in the first entry in the transfer address array.
$ !
$ ! This procedure is useful for converting an image linked with
$ ! /TRACEBACK into one that no longer has /TRACEBACK.  Because
$ ! this procedure uses certain image header offsets as hard-coded
$ ! values, it will remain correct only for Version 4.0 of VAX/VMS
$ ! and for subsequent releases as long and the image header
$ ! offsets remain valid.
$ !
$ ! This procedure requires the specification of one parameter:
$ !
$ !  P1 = Name of the image to be modified
$ PATCH /ABSOLUTE /NOOUT /NOJOU 'P1'
!
! Determine if the image is linked /TRACEBACK with the
! S0 flavor of SYS$IMGSTA.
!
EXAMINE /WORD 2
DEFINE BASE = \
REPLACE /LONG BASE
80000168
EXIT
80000168
EXIT
EXIT
$ IF $STATUS THEN GOTO PATCH_IMAGE
$ PATCH /ABSOLUTE /NOOUT /NOJOU 'P1'
!
! Determine if the image is linked /TRACEBACK with the
! P1 flavor of SYS$IMGSTA.
!
EXAMINE /WORD 2
DEFINE BASE = \
REPLACE /LONG BASE
7FFEDF68
EXIT
7FFEDF68
EXIT
EXIT
$ IF $STATUS THEN GOTO PATCH_IMAGE
$ EXIT
$
$PATCH_IMAGE:
$ !
$ ! At this point, we have an image that was linked /TRACEBACK.
$ ! Now, modify the transfer address array so that the image
$ ! appears to the system as if it was linked /NOTRACEBACK
$ !
$ PATCH /ABSOLUTE /OUT='P1' /JOU='P1' 'P1'
!
! Retrieve offset to transfer address array
!
EXAMINE /WORD 2
DEFINE BASE = \
!
! Move the second, third and fourth array elements up one
! longword in the array, thus clobbering the first entry
! (which is SYS$IMGSTA for images linked with /TRACEBACK).
! Since the fourth array element contains a zero, the third
! will contain a zero as well once we're done.
!
EXAMINE /LONG BASE + 4
DEFINE CONTENTS = \
DEPOSIT /LONG BASE + 0 = CONTENTS
!
EXAMINE /LONG BASE + 8
DEFINE CONTENTS = \
DEPOSIT /LONG BASE + 4 = CONTENTS
!
EXAMINE /LONG BASE + 0C
DEFINE CONTENTS = \
DEPOSIT /LONG BASE + 8 = CONTENTS
!
UPDATE
EXIT
$ EXIT