1748239 Members
3721 Online
108759 Solutions
New Discussion

Re: Unmessage

 
SOLVED
Go to solution
David R. Lennon
Valued Contributor

Unmessage

Hi,

  Has anyone successfully gotten the unmessage utility to work under Alpha or Integrity VMS? And willing to share their code?

   I mean the unmessage program by Joe Meadows that was on DECUS tapes and on ftp sites. This program "de-compiles" system message .EXE files into their source .MSG files.

   I found this thread:

 

http://h30499.www3.hp.com/t5/Languages-and-Scripting/Changing-the-output-of-the-TYPE-command/td-p/4718882

 

   But I am unable to successfully compile the source code attached to that thread, as well..

 

Thanks,

Dave

6 REPLIES 6
H.Becker
Honored Contributor

Re: Unmessage

What's the problem compiling the sources?

 

In unmsg.h, did you remove the GNU C __attribute__?

 

$ cc/vers
HP C V7.1-015 on OpenVMS Alpha V8.3    
$ sh symb cc
%DCL-W-UNDSYM, undefined symbol - check validity and spelling
$ cc unmsg
$ link unmsg
David R. Lennon
Valued Contributor

Re: Unmessage

Thanks for the reply. Yes, but I still get this:

 

$ cc/vers

HP C V7.3-010 on OpenVMS Alpha V8.3

 

$ cc unmsg

struct mscdef

^

%CC-W-DUPTYPESPEC, In this declaration, the same type specifier occurs more than once.

at line number 12 in file TS_DEVICE:[LENNON.UNMSG]UNMSG.H;2

if (midx->midx$b_sanity != MIDX$C_SANITY)

......^

%CC-W-INCOMPDEREF, In this statement, "midx" is a pointer to an incomplete struct or union and should not be used as the left operan

d of a member dereference.

at line number 69 in file TS_DEVICE:[LENNON.UNMSG]UNMSG.C;1

if (midx->midx$b_sanity != MIDX$C_SANITY)

......^

%CC-E-NEEDMEMBER, In this statement, "midx$b_sanity" is not a member of "midx".

at line number 69 in file TS_DEVICE:[LENNON.UNMSG]UNMSG.C;1

for (i = 1; i < (midx->midx$w_size / MIDX$C_LENGTH); ++i)

...................^

%CC-W-INCOMPDEREF, In this statement, "midx" is a pointer to an incomplete struct or union and should not be used as the left operan

d of a member dereference.

at line number 74 in file TS_DEVICE:[LENNON.UNMSG]UNMSG.C;1

for (i = 1; i < (midx->midx$w_size / MIDX$C_LENGTH); ++i)

...................^

%CC-E-NEEDMEMBER, In this statement, "midx$w_size" is not a member of "midx".

at line number 74 in file TS_DEVICE:[LENNON.UNMSG]UNMSG.C;1

for (i = 1; i < (midx->midx$w_size / MIDX$C_LENGTH); ++i)

.....................^

%CC-W-INCOMPDEREF, In this statement, "midx" is a pointer to an incomplete struct or union and should not be used as the left operan

d of a member dereference.

at line number 98 in file TS_DEVICE:[LENNON.UNMSG]UNMSG.C;1

for (i = 1; i < (midx->midx$w_size / MIDX$C_LENGTH); ++i)

.....................^

%CC-E-NEEDMEMBER, In this statement, "midx$w_size" is not a member of "midx".

at line number 98 in file TS_DEVICE:[LENNON.UNMSG]UNMSG.C;1

 

 

If I use the original unmessage.h header file, it does compile but running it against a message file results in no output.

 

Thanks,

Dave

H.Becker
Honored Contributor

Re: Unmessage

I have no problems if I use the original unmessage.h:

 

$ rena UNMESSAGE.H UNMSG
$ cc unmsg
$
 
How is midx defined? It should be struct midxdef *midx; in unmsg.c, in function decompile_mscmidxdef is defined in header files, unmsg.h  and unmessage.h.
David R. Lennon
Valued Contributor

Re: Unmessage

It seemed like there was some more stuff in unmsg.h than there was in unmessage.h but yes, if I use that one it compiles, but when I try to use it, I don't get any output:

 

$ mcr []unmsg sys$message:usb$msg.exe

$

 

I added some debugging printfs and it is "failing" at line 65:

 

if (msc->msc$w_sanity != MSC$C_SANITY)

return 0;

 

Any ideas on this?

 

Thanks again,

Dave

Hoff
Honored Contributor
Solution

Re: Unmessage

Attached is some working code for unmessage, tested against OpenVMS Alpha V8.3.

 

$ cc/ver
HP C V7.3-010 on OpenVMS Alpha V8.3
$

 

This is a one-source-module configuration, with no (non-system) headers required.

 

A couple of minor source code changes were incorporated.

 

Tested against a V8.3 message file.

 

Ah, and HPSC just keeps blowing up with ITRC-style blank-pages when posting.  This is a reposting.  Hopefully.  This time, with a zipped file, in place of a text file attachment.   (edit: yep; the zip worked.  It posted.  If you can't unpack that, I'll post the text version else-host and will post a pointer here.)

H.Becker
Honored Contributor

Re: Unmessage

>>> It seemed like there was some more stuff in unmsg.h than there was in unmessage.h

 

Yes, the pragmas to make sure the struct members are no member aligned (and some other stuff to make it compile on Linux as well).

 

It works for me (on Alpha, I don' have access to an Integrity):

 

$ mcr []unmsg sys$message:usb$msg.exe
.FACILITY       USB,1905 /SYSTEM
.SEVERITY       WARNING
_07718008       "fatal error encountered; operation terminated" /IDENT=ABORT
.BASE           100
_07718320       "USB Invalid device handle" /IDENT=INVALID_DEVICE
_07718328       "USB Invalid interface handle" /IDENT=INVALID_INTERFA
_07718330       "USB Invalid pipe handle" /IDENT=INVALID_PIPE

...

 

Dump the message file, starting with VBN 2, there should be the 7B (the #define MIDX$C_SANITY 123) at offset 42.

 

[edit: the struct mscdef needs to have __nomember_alignment]