Hex Editor - Binary File Editing Software for Windows
Download Hex Editor Neo Hide this button

Scripting Overview

Hex Editor Neo provides a programming interface to its basic file editing features. The interface provided by the Hex Editor Neo may be used by any code written in any automation-compatible language.

Three objects, File Document Object, Multiple Selection Object and Sequence Object are provided by the application. User code can create these objects, call methods they expose and query/set their properties. As a result, it may achieve the same functionality as provided by the Hex Editor Neo's user interface, with same performance characteristics. Hex Editor Neo's window does not appear on the screen when any of exposed objects is instantiated.

File Document Object

File Document object represents a file opened for editing. It corresponds to a document in the Hex Editor Neo's user interface. A lot of editing actions may be performed on this object.

Such concepts as operation history, patch creation, Undo and Redo are fully accessible for user code via this object.

Creating File Document Object section describes how you create a File Document object and Working with File Document Object section illustrates the ways this created object may be used. The IFileDocument Interface section in Scripting Reference section contains in-depth documentation for all properties and methods exposed by the File Document object.

Multiple Selection Object

Multiple Selection object represents a multiple selection in a document. This object is used by a number of File Document object's methods to define the portion of the document on which this method operates.

Creating Multiple Selection Object section describes how you create a Multiple Selection object and Working with Multiple Selection Object section illustrates the ways this created object may be used. The IMultiSelection Interface section in Scripting Reference section contains in-depth documentation for all properties and methods exposed by the Multiple Selection object.

Sequence Object

Sequence object serves as a thin layer that helps scripting languages that lack support for pointers and arrays to construct and pass a pattern. For example, it is impossible to create pattern for a IFileDocument.Find method in JavaScript. In this case, the Sequence object comes to help.

Creating Sequence Object section describes how you create a Sequence object and Working with Sequence Object section illustrates the ways this object may be used.

Thread Safety

Any single object taken from the Hex Editor Neo may not be used by multiple threads at the same time. User code should serialize access to objects' methods and properties if it needs to access the object from different threads. In such scenario, user code may call object's methods and access object's properties from any thread, provided the access is strictly serialized.

At the same time, user code may simultaneously access two different objects from two different threads. There is no conflict in this situation.

Lengthy Operations Limitations

Unlike the Hex Editor Neo's user interface, File Document and Multiple Selection objects do not provide you with a way to cancel any lengthy operation. When a thread calls a lengthy operation, it only has an option to wait until it's finished. Object performing this operation may not be accessed from another thread until operation has finished.