Apply template... (command File/Current File/Apply template...)


Use this command to apply a binary template on the file. A binary template consists of a text file with the extension "tpl" that contains a number of variable type+name combinations, such as this:

BYTE filetype
WORD version
DWORD filelength

This sample template file named "sample.tpl" is included in the Translhextion directory. When the command is chosen from the menu you will be prompted to choose the template file you want to apply. Translhextion will then load that file and use the code in it to give you a structured "interpretation" of the data in the currently loaded file, starting at the current byte. The result will be displayed in the edit-box of a dialogue, from where you can copy the result to the clipboard if necessary. The result looks like this:

File: C:\Data\test.dat
Template file: C:\Translhextion\sample.tpl
Applied at offset: 15


BYTE filetype = 66 (signed) = 66 (unsigned) = 0x42 = 'B'
WORD version = 30285 (signed) = 30285 (unsigned) = 0x764d
DWORD filelength = 8 (signed) = 8 (unsigned) = 0x8


-> Length of template = 7 bytes.

Following variable types are recognized: (recognition is case-sensitive, so "byte" is not recognized as type "BYTE")
- a byte-size value: "BYTE", "char".
- a word-size value: "WORD", "short".
- a longword-size value: "DWORD", "int", "long", "LONG".
- a float value: "float".
- a double value: "double".
The File/Open in text editor command:
This function attempts to call an external text editing program with the current file as argument. Default editor is the Windows Notepad. You can choose the editor in the Options/Preferences... dialogue.

Template feature developed by Raihan Kibria