home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 18 REXX
/
18-REXX.zip
/
rexx2exe.zip
/
REXX2EXE.INF
(
.txt
)
< prev
next >
Wrap
OS/2 Help File
|
1999-12-15
|
8KB
|
179 lines
ΓòÉΓòÉΓòÉ 1. Rexx Compiler (REXX2EXE.EXE) ΓòÉΓòÉΓòÉ
DESCRIPTION
This program is used to compile rexx ".CMD" files into ".EXE" files so that the
source is not required. I have released it as FreeWare although my original
intention was shareware. I retain (C)opyright and reserve all rights.
As the source is not required at runtime, you can distribute a binary file
which you know end users can't modify in any way.
You have the option (which is on by default) to encrypt the compiled rexx so
that its readability is reduced to zero. This ensures that not even strings
can be modified by end users (your copyright for example). This encryption
while not simple should not be relied upon to secure highly sensitive
information, its only meant to deter anyone from modifying or looking at your
code. Someone extremely keen will crack it if its worth their while...
As another precaution, the produced rexx binary is crc checked.
The rexx compiler can produce either a small dynamically linked ".exe" which
requires a runtime or a larger statically linked ".exe". The advantage with the
dynamically linked version is that most of the runtime can be shared between
multiple compiled rexx programs. The disadvantage is that the runtime must be
placed into a directory specified in the libpath (and only one version can be
active at any time, a major issue).
I suggest that you have a look at the rexx code build program PPWIZARD.EXE
(available at "http://www.ozemail.com.au/~dbareis". This tool can be used to
create the source to be compiled to an executable as it gives you much more
control (#defines, #includes etc).
If you structure your code suitably for the PPWIZARD "/pack" option then your
resultant EXE should be smaller!
SYNTAX
REXX2EXE[.EXE] SourceFile TargetFile [/C] [/D] [/P] [/2] [/K[:key]]
The "SourceFile" parameter of course specifies the input file while the
"TargetFile" specifies the name of the generated rexx executable. The
extensions must be specified as there are no defaults.
The "/C" parameter tells the compiler to actually tokenise the source code and
use the result (as was automatically done in previous versions of REXX2EXE)
rather than just attach the source code. If you move the resultant EXE to a
different machine or use "SWITCHRX.CMD", you may find that it will no longer
run.
The "/D" parameter tells the compiler to generate the target as a smaller
dynamically linked version which requires the presence of the "REXX2EXE.DLL"
support DLL (also generated). The default is to produce a standalone
statically linked program.
The "/P" parameter tells the compiler to create the EXE file as a PM program.
This makes it much easier to utilise PM routines such as "RxMessageBox()".
The "/2" parameter tells the compiler to generate code in such a way that it
will be able to run on OS/2 2.x machines. The default is to produce code which
is smaller but will only run on OS/2 Warp version 3.0 onwards.
The compiler will normally encrypt the rexx code part of the runtime with a
fixed key. If for some reason you don't want the information encrypted then
use "/K" (no subparameters). To encrypt with your own key specify a hex value
between 1 & 0xFFFFFFFF, for example "/K:1234". Note that when data is not
encrypted it is also not compressed (as this is a form of encryption) so the
generated code takes up more space.
Note that whether code is encrypted or not it is protected by a CRC and can't
be altered. If you specify a key with a value above 0xF0000000 (the default
key for example) you will not be able to recovery the code from the
executable. A value of 0 turns off encryption. You can specify your own
default value by setting the environment variable "REXX2EXE_KEY" to a
hexadecimal value.
EXTRACTING CODE FROM GENERATED EXE
This is not recommended as an archival mechanism, its intended purely as an
emergency recovery process. The process will be of little use if "/C" was
specified at compile time as all you will recover is the tokenized rexx object
(in a debug situation this could be useful).
You can only extract code if no key was used or its value was below
"0xF0000000", you must also know the value that was used at "compile" time.
The default key will create an EXE file from which you won't be able to
recover the source. It is suggested that you set the environment variable
"REXX2EXE_KEY" to the value you want in CONFIG.SYS (or a batch file) so you
never forget!
To extract the code you must set an environment variable to the value of the
key used at compile time (in hexadecimal). The name of the variable is the
full name of the EXE file. A file will be generated if the key is correct and
below 0xF0000000. An example follows:
SET C:\DB\UTILP\1.EXE=ABC123
RESTRICTIONS
There are a few restrictions with this rexx compiler (with any rexx compiler!)
as follows:
1. The return code from the rexx procedure should be numeric, for
example "exit 'An error occurred'" should not be used.
If a non numeric return code is specified then the runtime support
will generate an error message and a specific non-zero error level
set, of course the rexx code has completed.
2. If the "/C" switch was used then you can't use the "SourceLine()"
function to obtain the source line (as it doesn't exist)!
3. While a rexx procedure can delete itself on the fly you can't delete
the exe program in the same way (as its in use).
ΓòÉΓòÉΓòÉ 2. Change History ΓòÉΓòÉΓòÉ
Change History
1. Version 99.349
external commands could not be executed unless "address cmd" was
used. Bug probably intoduced in the 99.283 release.
2. Version 99.283
There was a bug where the rexx programs "arg(1)" was being
corrupted by the setting of environment variables.
3. Version 98.204
Thanks to some good feedback I have modified the program to
produce the EXE as a PM program when "/P" switch is specified.
4. Version 98.162
When producing a standalone executable and we would normally
compress, don't compress unless the gain in compression at least
makes up for the extra code required at runtime to uncompress
it. The smallest executable is now smaller by about 10K.
It is now possible to extract the code imbedded in the generated
code (if key known etc).
Can now specify your own default key in the "REXX2EXE_KEY"
environment variable.
5. Version 98.160
If the resultant EXE takes up less space than the ".CMD" then
specify the saving in the summary.
Default is now for generation of static code and use of "/D" to
generate dynamically linked output.
New "/C" option which basically tells REXX2EXE to do what it had
always done in previous releases and that is "compile" the code
and use the tokenised result. This is OK in a controlled
environment by may fail on machines with different versions of
rexx.
The REXX2EXE.DLL interfaces version number has changed and is
therefore incompatible with older EXEs.
6. Version 98.091
No longer require the rexx code to return a value, however if
none provided a non-zero value is returned by the generated
code.
7. Version 98.085
Created a "/2" option to handle way code was generated in
previous releases. The default is now to create code which is
packed using the mechanism introduced in OS/2 version 3.0, this
code will not run in previous versions of OS/2 (it is quite a
bit smaller though!).
Minor changes to generated messages.
8. Version 98.077
Initial release on my web page.