This interface is implemented by the intrinsic parser object, provided to scripts running as part of the Structure Viewer structure binding under the name parser
. The name may be omitted and the methods below may be called directly.
interface IParser {
// Methods
${abort}(message: string): void;
${alert}(message: string): void;
${bind}(typeName: string, varName: string, offset: number): void;
${eval}(Expression: string): boolean | number | string;
${print}(varName: string, varValue: string): void;
${add_coloring_scheme}(name: string, frontColor: object, backColor: object, outlineColor: object, roundEdges: boolean): void;
}
// This interface is not available in managed environment
// This interface is not available in native environment
abort(message: string): void;
// This method is not available in managed environment
// This method is not available in native environment
message
Abort current binding. Behaves like the $assert directive.
alert(message: string): void;
// This method is not available in managed environment
// This method is not available in native environment
message
Display informational message in a popup message box. Should be used only for debugging purposes.
Expression evaluation
function f()
{
var a = eval("pe_header.e_lfanew.sections[0].Name");
alert("First PE file section name is \"" + a + "\"");
return 0;
}
bind(typeName: string, varName: string, offset: number): void;
// This method is not available in managed environment
// This method is not available in native environment
typeName
varName
offset
Bind a given structure to a given address. Hex Editor Neo performs delayed binding, that is, a new structure is bound only after the current one is successfully finished binding.
Binding a structure
function f()
{
bind("struct A","a",0);
}
eval(Expression: string): boolean | number | string;
// This method is not available in managed environment
// This method is not available in native environment
Expression
Expression evaluation result.
Calculate expression value. You may reference global constants, enumerations, field values of already bound types and so on.
Expression evaluation
function f()
{
var a = eval("pe_header.e_lfanew.sections[0].Name");
alert("First PE file section name is \"" + a + "\"");
return 0;
}
print(varName: string, varValue: string): void;
// This method is not available in managed environment
// This method is not available in native environment
varName
varValue
Add a virtual field to the output.
Adding virtual fields
function f()
{
print("var1",10);
print("var2","Hello, World");
}
add_coloring_scheme(name: string, frontColor: object, backColor: object, outlineColor: object, roundEdges: boolean): void;
// This method is not available in managed environment
// This method is not available in native environment
name
frontColor
backColor
outlineColor
roundEdges
true
to round outline edges, false
otherwise.Create new binding-local coloring scheme. FrontColor
, BackColor
and OutlineColor
must be JavaScript objects with r
, g
, b
and a
properties. If any of the property is omitted, its value is defaulted to 0, except for a
, which value is defaulted to 255. All values must be within [0..255] range.
Creating new color scheme
function f()
{
// Create a coloring scheme Red on Blue, no outline (0 alpha = full transparent), no round edges
parser.add_coloring_scheme("my scheme",{ r:255, g:0, b:0, a:255 },
{ r:0, g:0, b:255, a:255 }, { a:0 }, false);
}