 |
 |
This page describes content of the BARfly
Silver and BARfly Gold builds. |
 |
Editing in subnode view is very straightforward. Select the line item in
the tree you wish to edit, and either select Edit.Edit Field from
the menu or press F2 to bring up the modify field dialog box.
The value that appears in the dialog
box to the left is the same value that appears in the subnode browser tree
control. By changing the value and clicking "OK," you will modify
the original field. The tree control is then updated with the new value.
You can enter either numbers or strings this way. More complex data types,
such as substructures or multidimensional arrays, cannot be edited.
Subnode view only allows the values to be entered and updated on an individual
basis. If you press F2 for a high-level field, the
dialog box will not appear.
Even though the F2 key is also used to accept changes, there is
no conflict with that functionality in subnode view. In subnode view,
accepting of changes occurs only when the top item of the tree (the structure
or block selected in the node browser) is also selected in the subnode
browser. All other items, when selected, interpret F2 as
a request to edit a field.
BARfly has parsing rules for editing scalar and array types. If you
enter a value that does not satisfy these rules, BARfly does not update the
original field, and an error is reported in the log. The parsing rules
are discussed in the following sections.
Editing Scalar Values
A scalar value is any single character, short integer, long integer, longlong
integer, or 4-byte or 8-byte floating-point field. Single fields never
have children in the tree: they are always at a low
level.
Scalar Value ::= (Numerical Digits) | (Enumerated Constant) | (Short String)
BARfly has versatile parsing capabilities for scalar values. You can enter
a scalar value in three different ways:
-
Numerical digits
in one of four numerical bases (decimal, hexadecimal, octal, or binary).
-
Enumerated constants
defined in the I.F.
-
Short strings
Numerical Digits ::= ['-']? (Base Identifier)? (Base Digits)+ (['.'] (Base
Digits)*)?
Base Digits ::= (Decimal Digits) | (Hexadecimal Digits) | (Octal Digits) |
(Binary Digits)
Numerical digits are the most intuitive way to enter a number. You can
precede all numbers with an optional hyphen to signify a negative number; the
lack of a hyphen makes the number positive. The remainder of the number
is composed of a possible base identifier and digits of that base.
You can enter an integer value by providing base digits, but no period.
If you append a period to the digits, you can make the number a floating-point
value. You can enter additional digits of the same base to the right of
the period to make a fractional value.
Base identifiers always begin with a zero and end with a character in the
alphabet. Identifiers are defined as follows:
Base Type Identifier ::= Hexadecimal Identifier | Octal Identifier |
Binary Identifier
Hexadecimal Identifier ::= '0x' | '0X'
Octal Identifier ::= '0o' | '0O'
Binary Identifier ::= '0b' | '0B'
If there is no base identifier, the number is assumed to be in the default decimal
base. Remember: "X" for hexadecimal, "O" for octal, and "B" for
binary.
The digits of each base are fairly easy to understand. For decimal, you
can use the standard Arabic numerals 0-9. For octal, you can only use
0-7. For binary, you can only use 0 and 1. For hexadecimal, you use
0-9 for the first ten digits, and the letters A-F for the last six digits.
Decimal Digits ::= [0-9]+
Hexadecimal Digits ::= [0-9A-Fa-f]+
Octal Digits ::= [0-7]+
Binary Digits ::= [0-1]+
Please keep in mind that the fractional portion of the number (to the right of
the period, if a period is present) is always of the same base as the whole
portion (to the left of the period). This means the number 0b0.11 in
binary actually equals 1/2 + 1/4 = 3/4, or 0.75 in decimal. Similarly,
the number 0.5 in decimal actually equals 0x0.8 in hexadecimal.
Enumerated Constant ::= (Any enumerated constant name defined in I.F.)
If you know an enumerated constant name, you can enter the name into the dialog
box and have it automatically translate to a value in the original field.
You can do this regardless of whether or not the field is derived from a simple
type with a dedicated enumerated constant block being used to report its value.
If you don't know any enumerated constant names, you can open the I.F. and use
Information.View File Info (or Alt+J) to display
the enumerated constant blocks, names, and values for the I.F. Not all
implementation files will have enumerated constants, but for those that do,
looking them up is a trivial task.
Short String ::= String
Strings are discussed in the next section. If you enter a string in the
dialog box when a number is expected, BARfly processes the characters you had
entered and copies them into bytes occupied by the value. Since values
only range from 1 to 8 bytes in size, the strings that BARfly will accept are
limited to a relatively small number of characters. If you attempt to
enter a string that has more characters than what the type can store, BARfly
clips your entry to a smaller size.
One example of a short string would be the 'MZ' identifier that identifies Win32
and DOS executable files. The characters 'M' and 'Z' are copied to the
short integer field, in ascending byte order, to make the integer value
23,117. If you had entered 'MZING' instead of 'MZ', you would still get
the same result, because BARfly recognizes that the field is only two bytes
long, which is enough to store only 'M' and 'Z', the first two characters.
Editing String Values
A string value is any one-dimensional array of characters or child of a
two-dimensional array of characters. In this sense, characters are of
type "char" and one byte in size. BARfly does not process arrays of any
other types as strings (i.e. you cannot enter an array of "wide" characters as
a string).
String ::= (No-markup String) | (['] (Markup String) [']) | (["]
(Markup String) ["])
No-markup String ::= [^#x22#x27]) [#x0-#xFF]*
Markup String ::= (Markup Sequence | Ordinary Character)*
Ordinary Character ::= [^#x5C#x22#x27]
Markup Sequence ::= [#x5C] ([abtnvfr] | [#x5C#x22#x27] | ('x'
(Hexadecimal Digits)) | (Octal Digits))
BARfly has versatile parsing capabilities for string values. String
values are always delimited by a pair of quotes (either single or
double). Which type you use depends on how you want the string to be
terminated.
-
Double quotes ("example") automatically
append a null byte as the last byte of the data.
-
Single quotes ('example') DO NOT append a
null byte as the last byte of the data.
In the first example above, an array would have eight characters copied:
seven for the word, and one for the null byte. In the second example,
only seven characters would be copied: only the seven for the word, with
NOTHING terminating the string.
You can place just about any printable character between the quotes. Of
course, sometimes you need quotes to be part of the string itself, and
sometimes you need to enter unprintable characters. For these cases, you
can employ the following markup. All markup begins with a backslash
character.
\a |
ASCII 7. Bell (or "alarm") character. |
\b |
ASCII 8. Backspace character. |
\t |
ASCII 9. Horizontal tab character. |
\n |
ASCII 10. Line feed (or "newline") character. |
\v |
ASCII 11. Vertical tab character. |
\f |
ASCII 12. Form feed character. |
\r |
ASCII 13. Carriage return character. |
\" |
ASCII 34. Double quote character. |
\' |
ASCII 39. Single quote character. |
\\ |
ASCII 92. Backslash character. |
\xnn |
ASCII code determined by nn, which is a hexadecimal number between 00 and FF. |
\nnn |
ASCII code determined by nnn, which is an octal number between 00 and 377. |
If the size of your entry exceeds the array dimensions, BARfly clips the result
to the number of characters the array can hold. Keep this in mind if you
have elected to use a double-quoted string, because if you enter the same
number of characters as the array dimensions, the null byte will be lost.
You might need that byte!
BARfly does not update the latter unused portion of the array if your entry
is smaller than the array dimensions. Any character present
before that did not need to be overwritten are left as they were.
If you have neglected to place quotes around your entry, BARfly gives you the
benefit of the doubt. If there are no bounding quotes, all characters
in your entry are taken verbatim, with no markup processed.
You do not get an automatic null placed at the end of the string, either.
The maximum size of your entry in the modify field dialog box is 256
characters. If you try to enter more than this amount, BARfly generates
an error.
Click here for information about changing subnode
view settings.
Click here for general information about subnode view.
See also: [Editing data in the data
display view] [Editing - Subnode view]
[Editing - Dump view] [Editing
- Text view] [Editing - Raw view] [Copying
and pasting data]
|