SuperZap File Utility for Windows z390 SuperZap File Utility
for Windows and Linux
z390 Portable Mainframe Assembler and Emulator
 

Superzap is a z390 utility to verify, replace, find, and dump the content of any Windows or Linux file up to 2 GB. The utility is written in structured z390 mainframe assembler and consists of 800+ lines of code which are included in the z390 download from z390.sourceforge.net.  The commands supported by SUPERZAP using either the GUI interface or the command line interface are as follows:

  • NAME file - open file and load it into memory (file can include path and spacey names in "...")
  • VER offset value - verify the file contents at specified offset.  The value can be hex or 'text' up to 256 bytes in length.  The default text mode is EBCDIC but ASCII command will switch to ASCII text mode.  The offset can be hex or *+hex or *-hex where * refers to current base offset.
  • REP offset value - replace the file contents at specified offset if no verify errors have occurred
  • ASCII - set text mode to ASCII
  • EBCDIC - reset text mode to EBCDIC
  • BASE offset - update base for hex offsets
  • DUMP offset length - dump the contents of file at specified offset for specified length showing hex and text
  • FIND value - find next occurrence of value starting at current base location in file and update base if found
  • LOOP - repeat command from previous FIND until verify error occurs or end of file is reached.
  • HELP - list commands

Use the z390 batch command ZAP.BAT with the name of a ".ZAP" type superzap ascii command file in order to run superzap in batch creating a corresponding ".RPT" type ascii file showing results.  Run the z390 regression test RTUTIL.BAT to regenerate the superzap utility from source and verify results of demo.  SUPERZAP can be run from command line using the command ez390 util\superzap\SUPERZAP parm(CON).  The output will appear on console and on the SUPERZAP.LOG file.  In order to use SUPERZAP with files larger than 1 MB, add the MEM(mb) option to the execution command in order for z390 to allocate the specified memory size in MB.  For example, if the file is up to 16 MB, specify MEM(16).  If the file is over 16 MB, specify the size plus 16 since 31 bit memory allocation starts at 16 MB line.  For files large than about 50 MB, the additional java runtime explicit memory allocation option -Xmx? will need to be added to the execution command (? is the requested memory size in bytes).

Note that SUPERZAP is a very useful utility to see exactly what is in a file and to change it if necessary in order to get an application working.  However it is a dangerous program and should not be used on files that cannot be easily recreated if needed.

SUPERZAP is installed as part of the open source z390 portable mainframe assembler tool which can be downloaded from www.z390.org.

Example 1 - The following 3 commands will dump the ZAP.BAT file showing hex and ASCII characters:

name ZAP.BAT
ascii
dump

If the above 3 commands are placed in an ASCII file named DUMPZAP.ZAP, then the commands can be executed in batch using the command ZAP DUMZAP and the output will appear in file DUMPZAP.RPT as follows:

SUPERZAP V1.0 04/13/07 Z390 FILE UTILITY
name zap.bat
ascii
dump
00000000 *72656D2072756E2073757065727A6170* *rem run superzap*
00000010 *207573696E672025312E5A415020736F* * using %1.ZAP so*
00000020 *7572636520696E7075742066696C6520* *urce input file *
00000030 *616E642025312E525054206F75747075* *and %1.RPT outpu*
00000040 *740D0A7365742020535953494E3D2531* *t..set SYSIN=%1*
00000050 *2E5A41500D0A73657420205359535052* *.ZAP..set SYSPR*
00000060 *494E543D25312E5250540D0A63616C6C* *INT=%1.RPT..call*
00000070 *20257E64707330657A33393020757469* * %~dps0ez390 uti*
00000080 *6C5C73757065727A61705C5355504552* *l\superzap\SUPER*
00000090 *5A415020253220253320253420253520* *ZAP %2 %3 %4 %5 *
000000A0 *25362025372025382025390D0A * *%6 %7 %8 %9.. *
SUPERZAP ENDING

 

Example 2 - Search the SUPERZAP.390 executable binary file and dump each occurance of the EBCDIC string 'SUPERZAP'

name util\superzap\SUPERZAP.390
find 'SUPERZAP'
dump * 10
loop

The resulting output report looks like this:

SUPERZAP V1.0 04/13/07 Z390 FILE UTILITY
name util\superzap\SUPERZAP.390
find 'SUPERZAP'
dump * 10
00000064 *E2E4D7C5D9E9C1D7F0F161F0F261F0F5* *SUPERZAP01/02/05*
loop
find 'SUPERZAP'
dump * 10
000001DE *E2E4D7C5D9E9C1D740C3D6D4D4C1D6D5* *SUPERZAP COMMAON*
loop
find 'SUPERZAP'
dump * 10
00000D84 *E2E4D7C5D9E9C1D740E5F14BF040F0F4* *SUPERZAP V1.0 04*
loop
find 'SUPERZAP'
dump * 10
00000DD4 *E2E4D7C5D9E9C1D740C5D5C4C9D5C740* *SUPERZAP ENDING *
loop
find 'SUPERZAP'
dump * 10
000010AC *E2E4D7C5D9E9C1D740C3D6D4D4C1D5C4* *SUPERZAP COMMAND*
loop
find 'SUPERZAP'
FIND VALUE NOT FOUND
dump * 10
000010AC *E2E4D7C5D9E9C1D740C3D6D4D4C1D5C4* *SUPERZAP COMMAND*
loop
LOOP SKIPPED DUE TO ERROR
SUPERZAP ENDING

References:

 

This page last updated Wednesday January 16, 2008 Webmaster 
Copyright 2007 Automated Software Tools Corporation

z390 and SuperZap are distributed under OSI compliant GPL license

This site is a member of WebRing.
To browse visit Here.