home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Professional
/
OS2PRO194.ISO
/
os2
/
prgramer
/
ddump
/
ddump.doc
next >
Wrap
Text File
|
1989-09-18
|
22KB
|
688 lines
---------------------------------------------
DDUMP: Dual Dump File Utility
with Limited Editing.
---------------------------------------------
Copyright (c) 1989, Christopher Laforet
All Rights Reserved
Chapter 1 Chapter 1
Introduction and Legal Stuff Introduction and Legal Stuff
1.1 Introduction 1.1 Introduction
This utility was inspired somewhat by a similar utility
available in the DOS world called CABLE. CABLE was written by
David Mitchell, an employee of IBM in England, a number of years
ago. The utility was just so well designed and thought out that
it became quite a favorite among those programmers who had a
chance to use it. The basic thrust of CABLE was to permit the
user to pull in one or two files for searching, editing (in ASCII
and hex), or simply for comparison.
DDUMP is a similar utility for OS/2 programmers, a utility
to permit one to search for patterns in a file, to make minor
editing changes (in ASCII or in hex), to browse around, or to
compare two files. DDUMP will work at the OS/2 command line or
will run in a text window in Presentation Manager. I may make a
"pure" PM version at some time. It is my hope that the users of
DDUMP will find it as powerful a little tool for their personal
toolkits as I found CABLE.
1.2 Copyright and Registration 1.2 Copyright and Registration
DDUMP and all of its associated files including but not
limited to the executable and this documentation are copyrighted
material of their author, Christopher Laforet. This program is
distributed under the shareware concept and is not Public Domain
material. What this means is that you are encouraged to share
the original distribution files (including this documentation)
with your friends or to provide them on diskette or by means of
BBSes to other users. You are allowed to use the program for a
period of time without registering it until you decide that you
really have a use for it. This period of time can vary, but I
suggest that if you use it for a period of over a month, you
ought to do the honest thing and register your copy.
Registration entitles you to the latest copy of DDUMP on
diskette and the means to contact me for reporting bugs or making
suggestions. To register, please print, fill out, and mail the
---------------------------------------------
Dual Dump File Utility Usage Page Two
Copyright (c) 1989, Christopher Laforet
accompanying REGISTER.DOC and enclose a check or money order made
out to Christopher Laforet for the amount of $15 US (NC residents
add 5% sales tax or $0.75) to the following address:
Christopher Laforet
511-D Poplar St
Graham, NC 27253
1.3 Warranty and Disclaimer 1.3 Warranty and Disclaimer
The LOG program and all accompanying documentation are
provided on an "AS IS" basis. This means that Christopher
Laforet does not warrant, guarantee, or make any other
representations regarding the use, or results of use, of LOG or
the documentation in terms of accuracy, reliability, correctness,
currentness, or otherwise. Christopher Laforet will not be held
responsible for any direct, indirect, incidental, or
consequential damages including damages for loss of business
profits, business interruption, loss of business information, or
otherwise arising from the use or inability to use LOG, even if
Christopher Laforet has been advised of the possibility of such
damages. The use of this product is on an "AT YOUR OWN RISK"
basis.
1.4 Contacting Me and Support 1.4 Contacting Me and Support
Non-registered users can feel free to forward suggestions or
bug reports to me at the above address, through Compuserve Email
(76120,110), through FidoNet mail (1:151/402), or can call my BBS
and leave me a message (Chris Laforet, The Programmer's Oasis,
919-226-6984 HST,2400,1200). Flames will be sent directly to
NUL!
If there is a decent response (as measured in registrations)
to this product, I will continue to upgrade it as new versions of
OS/2 arrive and as bugs appear (God forbid!). It is for this
reason that I urge you to register your copy.
---------------------------------------------
Dual Dump File Utility Usage Page Three
Copyright (c) 1989, Christopher Laforet
Chapter 2 Chapter 2
Using DDUMP Using DDUMP
2.1 Starting DDUMP 2.1 Starting DDUMP
To run DDUMP, type DDUMP in the protected mode shell of
OS/2. After signing-on, you will be presented with the main
screen which consists of a pull-down menu along the top, a status
line on the bottom, and two sections for files. At this point
you may load a file (or files) to browse and/or edit by pressing
Alt-F to pull down the Files menu and then select the Open File
option by moving the light-bar over the choice and pressing
Enter. (To load the files directly from the command line, you
may type DDUMP d:\path\file1 [d:\path\file2].)
2.2 The Files Menu 2.2 The Files Menu
As you will see in the figure below, the files menu has a
number of different entries. Alongside of the action description
(like "Open File") you can see the shortcut key (like "Alt+O")
which you may press without pulling down the menu every time you
need to complete an action. To activate the files menu, press
Alt+F from the main screen. If you are already in a menu, merely
press your left or right arrow keys to get to this menu.
Files Search Compare opTions
┌─────────────────────┐────────────────
│ Open File Alt+O │
│ Edit File Alt+E │
│ Browse File Alt+B │
│ Next File Alt+N │
│ Write File Alt+W │
│ Abs Offset Alt+G │
│ Plus Offset Alt+P │
│ Minus Offset Alt+M │
│ Exit Alt+X │
└─────────────────────┘
Figure 2.1: The Files Menu Figure 2.1
The options available include one to open a new file (if
there is already a file being browsed, the new one will replace
---------------------------------------------
Dual Dump File Utility Usage Page Four
Copyright (c) 1989, Christopher Laforet
it), an option to toggle into Editing mode, another one to cancel
Editing and return to Browse mode (the default), and one to allow
you to flip between the two files that you are browsing/editing.
If you have made an editing change to a file, you may choose
to write the changes out by selecting the "Write File" option.
The system will remind you that a file has changed whenever you
choose any option which may discard those changes and then it
will prompt you if it should write the changes out. Hence the
Write File option is merely there if you want to make sure that
you flush changes out to the disk.
To go to an absolute location in the file, choose the "Abs
Offset" option. You will be presented with a window prompting
you for the position that you wish to seek to. You may reply in
hex (if Hex Offsets option is active) or in decimal (if the
Decimal Offsets option is active). The default is to accept
offsets in hex (use the opTions menu to change this if you so
desire). If you select an invalid location, the pointer will not
be moved.
To add an offset to your current position in the file, use
the "Plus Offset" option. Depending upon the mode, you will be
prompted to enter this value either in hex or in decimal
notation. If the combined offset is beyond EOF, the pointer will
not be moved.
To subtract an offset from your current position in the
file, select the "Minus Offset" option from the menu. The same
thing that we said about previously of the hex/decimal prompting
is true of this also. If the combined offset is before the BOF,
the pointer will not be moved.
To exit DDUMP, select exit from this menu. Before you
leave, if you have made any unsaved changes to either file, you
will be prompted to save them before exiting.
2.3 The Search Menu 2.3 The Search Menu
The search menu can be activated by pressing Alt+S from the
main screen or if you are already in a menu, press the right or
left arrows until you reach this menu.
Search Compare opTions
┌─────────────────────┐──────
│ Search Fwd F5 │
│ Search Back Alt+F5 │
│ Search Next Shf+F5 │
└─────────────────────┘
Figure 2.2: The Search Menu Figure 2.2
---------------------------------------------
Dual Dump File Utility Usage Page Five
Copyright (c) 1989, Christopher Laforet
Using this menu you may ask to search forward for a specific
string pattern by selecting the "Search Fwd" option. A window
will then open in the middle of the screen and prompt you to
provide the desired pattern. The search will then proceed until
a match is found, until EOF is hit, or until you press any key to
terminate the search. The case sensitivity of the search is
dependent upon the sensitivity flag (by default sensitivity is
on) which can be set using the opTions menu. The state of the
sensitivity flag can be seen on the status line.
To do a reverse search from the current position, select the
"Search Back" option. The same comments mentioned above hold
true here also.
To repeat a previous search, select the "Search Next"
option. This will search for the previous patter in the same
direction as before.
2.4 The Compare Menu 2.4 The Compare Menu
This will be implemented in the next beta release of this
product.
2.5 The Options Menu 2.5 The Options Menu
The options menu allows you to change the state of a number
of flags. To select this menu, press Alt+T from the main screen
or use your arrow keys to select it if you already have a menu
pulled down.
opTions
┌─────────────────────┐
│ Show Ctrl-Chars F2 │
│ Case Insensitive F3 │
│ Lock Files F4 │
│ Edit in Hex F7 │
│ Offs in Decimal F8 │
└─────────────────────┘
Figure 2.3: The Options Menu Figure 2.3
The first option will show all characters in the ascii dump
portion of the file dump. This option is suppressed by default
(all characters less than a space (0x20) are shown as periods) to
present a relatively uncluttered dump. Should you desire to see
all of the characters, merely toggle the "Show Ctrl-Chars"
option. You will notice that the option will change to "Hide
Ctrl-Chars".
---------------------------------------------
Dual Dump File Utility Usage Page Six
Copyright (c) 1989, Christopher Laforet
To toggle the search flag in charge of defining if searches
are case sensitive or not, choose the second option. If they are
currently case sensitive, the option will read "Case Insensitive"
otherwise if they are case insensitive, the option will read
"Case Sensitive".
The "Lock Files" (and conversely "Free Files") options are
related to the Comparison process. When files are locked, any
scrolling that you do on one will be duplicated on the other.
This option will be implemented on the next beta release.
The "Edit in Hex" option toggles the mode for editing files
(the default is ASCII). When you select this option you can then
edit bytes in hexadecimal. The option will change to "Edit in
ASCII".
The "Offs in Decimal" option permits you to change the
number system under which you are prompted for offsets. The
default is hexadecimal. Should you select this option, it will
then become an "Offs in Hex" option.
2.6 Active Keystrokes in the Main Screen 2.6 Active Keystrokes in the Main Screen
All of the shortcut keys presented on the pull-down menus
are active on the main screen. An example of this is the option
to toggle between the two files (Files menu, Next File option).
If you wish to use the shortcut key, press Alt+N to toggle
between the top and bottom file.
To move around in the files you may use the left and right
arrow keys (moves left or right by a byte at a time), the up and
down arrow keys (moves left or right by 16 bytes at a time), the
PgUp and PgDn keys (moves left or right by one screenful at a
time), or the Home and End keys (to go to BOF and EOF
respectively).
2.7 The File Screen 2.7 The File Screen
Each of the files being browsed/edited is presented with its
pathname and filesize in hex (on the top or at the bottom
depending upon which screen position it occupies), a hexadecimal
dump (with the current offset marked with a pointer in both hex
and decimal), an ASCII dump on the right hand side, and a linear
ASCII dump (under or over the hex dump depending upon its screen
position).
Here is an example of the hexadecimal dump of a file along
with its linear ASCII dump:
---------------------------------------------
Dual Dump File Utility Usage Page Seven
Copyright (c) 1989, Christopher Laforet
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
┌─────────┐ 00 00 00 00 00 00 00 00 00 00 00 00 80 00 00 00
│0x0000040╞═0e 1f ba 0e 00 b4 09 cd 21 b8 01 4c cd 21 54 68
│ 64│ 69 73 20 70 72 6f 67 72 61 6d 20 63 61 6e 6e 6f
└────────╥┘ 74 20 62 65 20 72 75 6e 20 69 6e 20 44 4f 53 20
║
╚══════════════════╕
............Ç.....║..┤.═!╕.L═!This program cann
Figure 2.4: The Hexadecimal Dump and Linear ASCII Dump Figure 2.4
Here is an example of the block ASCII dump corresponding to the
hex dump previously presented:
................
............Ç...
..║..┤.═!╕.L═!Th
is program canno
t be run in DOS
Figure 2.5: The ASCII Dump Figure 2.5
2.8 Editing a File 2.8 Editing a File
To edit a file in ASCII, merely select the correct position
using the arrow keys and make sure that you are in ASCII Edit
mode (look at the status line). Select the "Edit File" option
from the Files menu or press Alt+E to toggle Edit mode. At this
point, merely type in the changes that you wish to make. After
each character, the current position moves to the next byte
location.
To edit a file in hex, make sure that your status line
indicates that you are in Hex Edit mode. If you are not, change
your setting using the opTions menu. Select the position in the
file where you wish to do your edit and then begin editing.
Notice that the hex editor accepts two hex numbers (since there
are two nibbles) per byte and rotate the changes leftwise through
the byte. After each two hex numbers, the current position moves
to the next byte.
Please notice that this editor does not allow you to insert
bytes or add bytes to the end of the file. It merely permits you
to change what is already there.
---------------------------------------------
Dual Dump File Utility Usage Page Eight
Copyright (c) 1989, Christopher Laforet
Chapter 3 Chapter 3
Revision History Revision History
Version 0.01:
First beta release version. This version does not support
file comparisons nor does it allow files to be "locked" together.
---------------------------------------------
Dual Dump File Utility Usage Page Nine
Copyright (c) 1989, Christopher Laforet
Contents Contents
Chapter 1 Introduction and Legal Stuff 2
1.1 Introduction . . . . . . . . . . . . . . . . 2
1.2 Copyright and Registration . . . . . . . . . 2
1.3 Warranty and Disclaimer . . . . . . . . . . . 3
1.4 Contacting Me and Support . . . . . . . . . . 3
Chapter 2 Using DDUMP 4
2.1 Starting DDUMP . . . . . . . . . . . . . . . 4
2.2 The Files Menu . . . . . . . . . . . . . . . 4
2.3 The Search Menu . . . . . . . . . . . . . . . 5
2.4 The Compare Menu . . . . . . . . . . . . . . 6
2.5 The Options Menu . . . . . . . . . . . . . . 6
2.6 Active Keystrokes in the Main Screen . . . . 7
2.7 The File Screen . . . . . . . . . . . . . . . 7
2.8 Editing a File . . . . . . . . . . . . . . . 8
Chapter 3 Revision History 9
i
Figures Figures
Figure 2.1: The Files Menu . . . . . . . . . . . . . 4
Figure 2.2: The Search Menu . . . . . . . . . . . . . 5
Figure 2.3: The Options Menu . . . . . . . . . . . . 6
Figure 2.4: The Hexadecimal Dump and Linear ASCII
Dump . . . . . . . . . . . . . . . . . . 8
Figure 2.5: The ASCII Dump . . . . . . . . . . . . . 8
ii