Hex Editor Neo is a constantly developing application. Structure Viewer in version 4.71 adds support for the following:
When evaluating expressions, dynamic typing rules are used. For example, adding two integers produces an integer, but adding a floating-point number and an integer number produces a floating-point number. The same rules apply to other types and other operators.
Note that this feature introduces a breaking change: the syntax for defining constants has changed.
You can now define constant or variable arrays and reference their elements in expressions:
const Months[]={
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December"
};
public struct A
{
short month;
$print("Month as string",Months[month]);
};
You may now call functions written in Javascript or VBScript from the Structure Viewer expressions. In addition, a number of internal functions are provided. Structure Viewer makes two objects, parser and document, available to the running script.
functions.js:
function ScriptAdd(a,b)
{
return a+b;
}
function IsModified()
{
return document.Modified;
}
structure.h:
#pragma script("functions.js")
struct A
{
if (IsModified())
$print("warning","The document has been modified!");
char array[ScriptAdd(10,8)]; // equivalent to char array[10+8];
};
#pragma byte_order
Arrays of simple integer types are now optimized by the parser, reducing the binding time and memory consumption. In addition, you may refer to character arrays (arrays of type char and wchar_t) in expressions. In this case, the contents of an array is represented as a string:
struct A
{
char TagName[10];
if (TagName == "#Default")
// do something
};
This variable evaluates to a current array index when used in an user-defined type. For example:
struct B;
struct A
{
B b[10]; // array of 10 B's
};
struct B
{
int b;
if (array_index == 3) // fourth element contains another integer
int c;
};