Modifying Data
Cygnus provides powerful features that offer many ways to modify data.
Cygnus Main Window

Click to enlarge
Like most hex editors, the main edit window displays data in two
columns using hexadecimal and ASCII notation. Using the Tab key, you can
switch between the two columns. You can enter data in the format that
matches the column you are currently in. And while you can enter data in
overstrike mode, Cygnus also allows you to insert and delete data as
easily as with any word processor.
In addition, the Data Inspector window (shown to the left side of the
main window in the image above) makes it even easier to work with data. This
window allows you to view and edit data using defined data types. This
allows you to view and edit data in a more natural way when you know the
type of data being edited.
The Data Inspector window has two tabs: The Data View tab and the
Structure View tab. The Data View tab displays data from the current
location as several different data types. You can also edit data from the
current location as any one of those data types.
The Data Types Dialog Box

Click to enlarge
You can use the Data Types dialog box to specify which data types are
included in the Data View tab.
Data Inspector Windows showing Structure View

Click to enlarge
When you know the layout of a particular type of file, you can use the
Structure View tab of the Data Inspector window to display and edit data from the current location as a
sequence of data types, or structures.
The Structures Dialog Box

Click to enlarge
Of course, you'll probably want to create your own collection of
structures. You can do this from the Structures dialog box. You can define
structures using any of the available data types. You can even create
members that are arrays, other types of structures, or even arrays of
structures. You can also specify that Cygnus use other members of the
structure to specify the length of an array. Developers can even define
new data types by creating Cygnus
extensions
and those data types can be used as structure members.
The Add/Edit Structure Dialog Box

Click to enlarge
Structures are created and modified via the Add/Edit Structure dialog
box. This dialog box provides a complete graphical interface for defining
structures, making it very easy to create your own.
Modify Dialog Box

Click to enlarge
Cygnus also offers commands that will automatically modify a range of
data. The Modify dialog box allows you to quickly and easily modify
contiguous data in a file by treating the data as an array of a given data
type. You specify the number of items to be modified along with the data
type of each item. (Note: Data types created by writing Cygnus
extensions are not available for Modify
operations.)
Modify Actions

Click to enlarge
You also specify the action you want to perform on each item and, if
needed, an action value. For example, you could select the Add action and
an action value of 5. Cygnus would then add 5 to each item. In addition,
you can also perform actions on the action value. So, in the previous
example, if you chose to add 1 to the action value, Cygnus would add 5 to
the first item, 6 to the second item, 7 to the third item, and so on.
Insert Dialog Box

Click to enlarge
The Insert dialog box inserts a specified number of a specified data
type. You can also specify the initial value for each item that is
inserted. Cygnus determines the actual number of bytes to insert based on
the number of items and the size of each item, and initializes the value
of each item.
Delete Dialog Box

Click to enlarge
The Delete dialog box deletes a specified number of a specified type.
Cygnus determines the actual number of bytes to delete based on the number
of items and the size of each item.
Convert Data Dialog Box

Click to enlarge
The Convert Data dialog box allows you to convert the selected data. It
provides a list of available conversions and allows you to select the type
of conversion you want. In addition to the conversion types that come with
Cygnus, developers can add additional conversion types by writing Cygnus
extensions.
|