home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload
/
ShartewareOverload.cdr
/
progm
/
analyze.zip
/
ANALYZE.DOC
next >
Wrap
Text File
|
1989-04-07
|
24KB
|
727 lines
ANALYZE
Version 1.1
Copyright (c) 1989 by Gary R. Pannone All rights reserved.
You may freely distribute this version of ANALYZE.
If you find this program useful, please send a contribution
($20 suggested) to the address below. For a contribution of
$25 you will receive an enhanced version of this program and
notification of planned future versions.
Gary R. Pannone
35 Park View Rd.
Hamden, CT 06514
If you have problems with this program, please send a note
to the address above.
TABLE OF CONTENTS
-----------------
1. Introduction.................................... 1
2. Starting ANALYZE................................ 1
3. The Configuration Screen........................ 2
3.1 The Configuration File.......................... 2
3.2 The Configuration Screen Keys................... 2
3.3 The Configuration Data Items.................... 3
3.4 The Configuration Function Keys................. 5
4. Displaying Data................................. 6
4.1 The Data Screen................................. 6
4.2 The Data Screen Keys............................ 7
4.3 Displaying a File "Dump"........................ 7
5. Record Types.................................... 8
5.1 Text Records.................................... 8
5.2 Fixed Length Records............................ 8
5.3 Variable Length Records with a Byte Header...... 9
5.4 Variable Length Records with a Word Header...... 9
Page 1
1. Introduction
----------------
ANALYZE is a powerful tool for programmers, or anyone that
needs to verify or determine the exact contents, or format,
of a file. ANALYZE is an interactive program that displays
the data contained in files.
ANALYZE can be used to:
1. Display the character data contained in a file.
2. Display the ASCII values of character data.
3. Display the byte values of binary data (dump).
4. Analyze a file to determine its record length,
record type, or internal (field) format.
ANALYZE's special features include:
1. Fully configurable - you select the number
base, numbering system (starts at 0 or 1),
display format, display options, etc.
2. Supports several record types (see chap. 5).
3. Scrolls up and down through data records,
scrolls horizontally within records.
4. Allows quick access to specific records by
record number.
2. Starting ANALYZE
--------------------
To start ANALYZE, type -
ANALYZE <ENTER>
You can specify the name of the data file that you would
like to display at startup time by typing -
ANALYZE filename <ENTER>
Page 2
3. The Configuration Screen
----------------------------
The Configuration Screen lets you:
. Specify the name of the data file.
. Select the data file's record type.
. Select the first record to be displayed.
. Select how the data should be displayed.
. Select whether numbering starts at 0 or 1.
. Select the number base.
. Select the screen colors.
The Configuration Screen is displayed whenever you start
ANALYZE or press the ESC key while the Data Screen is
displayed. There are two types of data items on the
Configuration Screen. Data entry items, such as the File
Name item, require you to type in data. Menu items, such as
the Include Header item, require you to choose one of
several choices.
3.1 The Configuration File
--------------------------
ANALYZE lets you save the configuration items in a file
called ANALYZE.CNF. When you start ANALYZE, the program
reads the configuration file from the current directory. If
the file does not exist in the current directory and you are
running DOS version 3.0 (or higher), the program looks in
the directory from which the program was read. If the
configuration file is not found there, ANALYZE uses a
default configuration.
See section 3.3 for details on saving the program configur-
ation.
3.2 The Configuration Screen Keys
---------------------------------
You select the data item that you want to change by
highlighting the item name. Use the ENTER or DOWN ARROW
keys to highlight the next Configuration Screen data item.
Use the UP ARROW to highlight the previous data item.
Note: Some data items may be disabled. You can
not change the value of a disabled data item. For
example, if you select the record type called
Page 3
Text, the Record Length item is disabled, and the
highlight can not be moved to the Record Length
item.
When you highlight a data entry item, you can edit the value
using the standard editing keys:
Key Description
----------- ----------------
RIGHT ARROW Move the cursor to the right
LEFT ARROW Move the cursor to the left
BACKSPACE Delete the previous character
DEL Delete the current character
INS Toggle insert mode on/off
HOME Move the cursor to the beginning
END Move the cursor to end
CTRL END Delete to end of field
When you highlight a menu item, you can select a value by
pressing the SPACE BAR, LEFT ARROW key, or RIGHT ARROW key.
3.3 The Configuration Data Items
--------------------------------
The following items are configurable:
FILE NAME - Enter the name of the data file to be displayed.
You can enter a full file specification including a drive
letter and a directory specifier.
RECORD TYPE - Choose the appropriate Record Type (see
chapter 5 for a description of the record types):
Type Description
---------- -------------------------
TEXT Records terminated by CR and LF
FIXEDLENGTH Fixed length records
BYTEHEADER Variable length with byte header
WORDHEADER Variable length with word header
START AT RECORD - Enter the number of the first record to be
displayed. This number can not be less than the configured
1ST RECORD NUMBER or greater than 65535.
Note: This value MUST be entered in the selected
NUMBER BASE.
DISPLAY TERM - Choose NO to display only actual data.
Choose YES to also display record terminators (the carriage
return and line feed at the end of text records, and the
byte or word header at the beginning of byte header or word
header variable length records).
Page 4
RECORD LENGTH - Enter the length of the data records in the
fixed length data file. This item is ignored for other
types of records. The minimum value is 1 and the maximum
value is 32767.
Note: This value MUST be entered in the selected
NUMBER BASE.
INCLUDE HEADER - Choose NO if the value of the byte header
or word header does NOT include the length of the header
itself. Choose YES if the value does include the length of
the header. See chapter 5 for details. This item is
ignored for text and fixed length records.
DISPLAY FORMAT - Choose CHARACTER to display only the
characters that correspond to each byte of data. Choose
DUMP to display the byte values above each character of
data.
1ST DISPLAY POS - Enter the number of the first character
position of each record to be displayed. The minimum value
is the configured 1ST CHARACTER POSITION and the maximum
value is 32767.
Note: This value MUST be entered in the selected
NUMBER BASE.
1ST CHARACTER POSITION - Choose ZERO if you want to number
the character positions of each record starting with
position 0 (zero). Choose ONE if you want to number the
character positions of each record starting with position 1
(one).
1ST RECORD NUMBER - Choose ZERO if you want to number the
records in the file starting with record 0 (zero). Choose
ONE if you want to number the records starting with record 1
(one).
NUMBER BASE - Choose OCTAL to display all numbers in octal.
Choose DECIMAL to display all numbers in decimal. Choose
HEX to display all numbers in hexidecimal.
Note: If you change the NUMBER BASE, be sure to
convert the START AT RECORD, RECORD LENGTH, and
1ST DISPLAY POS values to the new number base.
DISPLAY OPT - Choose NONE to display no optional
information. Choose NUM/LEN to display the record number
and record length of each record. Choose OFFSET to display
the byte offset to the beginning of the record, as well as
the number and record length of each record.
Page 5
DATA - Choose the color in which you want the character data
to be highlighted.
TEXT - Choose the color in which you want the screen text to
be displayed.
HIGHLIGHT - Choose the color in which you want the
highlighted text to be displayed.
BACKGROUND - Choose the color in which you want the screen
background to be displayed.
Note: The background color can not be the same as
one of the other colors that you have chosen.
3.4 The Configuration Function Keys
-----------------------------------
The following function keys are active in the Configuration
Screen:
F1 (DISPLAY DATA) - Displays the specified data file,
starting at the specified record, in the specified format.
F2 (SAVE CONFIG) - Displays the message "Save Configuration
? (Y/N)". If you press Y, the current configuration is
written to the CURRENT directory. If you press N, the
configuration is not saved.
Note: You can save the configuration with no file
name. This allows you to save a generic config-
uration, which can be used with several data
files.
F3 (RESTORE CONFIG) - Displays the message "Restore
Configuration ? (Y/N)". If you press Y, the configuration
information is read from the configuration file and
displayed. If you press N, the configuration is not
changed.
F4 (SET START) - Sets the starting record number to the
number of the first data record that was displayed on the
last Data Screen.
ESC (EXIT) - Stops the ANALYZE program.
Page 6
4. Displaying Data
-------------------
When you press the F1 key (Display Data) when the
Configuration Screen is displayed, ANALYZE looks for the
specified data file. If the file is found, the program
displays the specified starting record.
Note: If the record type is not FIXEDLENGTH, the
program displays the message "Reading ..." while
it searches for the starting record.
4.1 The Data Screen
---------------------------
The top of the Data Screen displays the:
1. Data file name
2. Number base
3. Record type
4. The first record number
5. The first character position
6. Whether headers are included in record lengths
The main window displays:
1. The byte offset (if configured)
2. The record number (if configured)
3. The record length (if configured). If
configured not to display terminators, the
record length will be the length of only the
actual data, and a plus sign (+) will follow
the record length.
4. One or more data records
A ruler is displayed just above the main window. The ruler
is numbered in the number base that was configured. The 1st
display position is displayed just above the left end of the
ruler. For example, if you specified that the 1st display
position is 15, the first digit on the ruler will be a 5 and
the number 15 is displayed just above the 5.
Page 7
4.2 The Data Screen Keys
------------------------
The following keys are active in the Data Screen:
CTRL LEFT ARROW - Scroll the data one window-width to the
right, if possible.
CTRL RIGHT ARROW - Scroll the data one window-width to the
left.
DOWN ARROW - Displays the next data record, if any.
HOME - Displays the beginning of the data record.
LEFT ARROW - Scroll the data one character to the right, if
possible.
PGDN - Displays the next screen of data records, if any.
PGUP - Displays the previous screen of data records, if any.
RIGHT ARROW - Scroll the data one character to the left.
UP ARROW - Displays the previous data record, if any.
ESC (EXIT) Redisplays the Configuration Screen.
4.3 Displaying a File "Dump"
----------------------------
It is often useful to display a data file in "dump" format,
that is, display every byte of the file in both its
character, and byte value, forms. To do this using ANALYZE:
1. Choose FIXEDLENGTH Record Type (even is it doesn't have
fixed length records)
2. Choose DUMP Display Format
3. Specify a Record Length less than or equal to the data
window width (for example, 50).
This method provides a way of displaying the data in fixed
length chunks, the way a typical dump program displays it.
Page 8
5. Record Types
----------------
This chapter describes the record types supported by
ANALYZE.
In the examples in the following sections, square brackets
enclose individual bytes. Numbers enclosed in square
brackets are decimal. For example:
BYTE SPEC DECIMAL VALUE
--------- -------------
[19] 19
[CR] 13 (ASCII carriage return)
[LF] 10 (ASCII line feed)
5.1 Text Records
----------------
Text records are fixed or variable length records terminated
by carriage return and line feed characters. For example:
Record 1 text[CR][LF]
Record 2 text[CR][LF]
Record 3 text here[CR][LF]
5.2 Fixed Length Records
------------------------
Fixed length records are assumed to have no terminating
characters or header characters; all data bytes are
displayed and assumed to be data. For example:
Record 1 data
Record 2 data
Record 3 data
It is often useful to display a data file as a fixed length
record file, even is it doesn't have fixed length records.
This method provides a way of displaying the data in fixed
length chunks, the way a typical dump program displays it.
This also provides a way of displaying entire data records
that are longer than the data screen window width.
Page 9
5.3 Variable Length Records with a Byte Header
----------------------------------------------
Byte Header records have a one byte prefix that specifies
the actual length of the record.
Here is data in a file with record lengths that include the
header byte:
[14]Record 1 data
[14]Record 2 data
[19]Record 3 data here
Note that the record length of the first record, 14, equals
the length of the actual data (Record 1 data) plus the
length of the header itself (which is 1 byte).
Here is the same data in a file with record lengths that do
not include the header byte:
[13]Record 1 data
[13]Record 2 data
[18]Record 3 data here
5.4 Variable Length Records with a Word Header
----------------------------------------------
Word Header records have a one word prefix that specifies
the actual length of the record.
Here is data in a file with record lengths that include the
header bytes:
[15][0]Record 1 data
[15][0]Record 2 data
[20][0]Record 3 data here
Note that the record length of the first record, 15, equals
the length of the actual data (Record 1 data) plus the
length of the header itself (which is 2 bytes).
Here is the same data in a file with record lengths that do
not include the header bytes:
[13][0]Record 1 data
[13][0]Record 2 data
[18][0]Record 3 data here