GView configuration file
GView is configured via GView.ini file (that should be located next to GView executable). If the file is missing, running a simple GView reset command from the CLI should restore it.
The following section should be seen in a GView.ini file:
[GView]- a section with the general configuration for GView. Typically it contains associated key for changing the view, cache size, etc.[AppCUI]- a section with the general configuration for AppCUI framework (color, frontend, etc)[Type.<XXX>]- various sections that describe characteristics of each supported type in GView[View.<xxx>]- various section for each smart view
Types
A [Type.xxx] section usually contains the following:
a Description field that explains the type of the plugin
a Extension field that can be a simple string or a list of strings containing the list of extensions associated with this field.
Extension = exe
or
Extension = ["h","hpp","cpp","c"]
a
Patternfield that provides some rules that if match the entire plugin is loaded in memory and checked against the content. This ensures quick validation of the content so that not all plugins are loaded in memory. A pattern is a string with the following format: rule:parameters, where rule can be one of the following:
Rule |
Type |
Usage |
Example |
|---|---|---|---|
magic |
Binary Files |
Identifies a binary magic from the start of the file. A magic must be followed by a list of hex values separated with spaces |
magic:FF 20 30 |
startswith |
Text Files |
Checks if a file starts with a specific text |
startswith:#include |
linestartswith |
Text Files |
Checks if one of the first 10 lines from a text file starts with a specific text |
linestartswith:#define |
Examples:
Pattern = "magic:4D 5A" ; identifies possible Windows binary files (that starts with a ``MZ``)or
Pattern = ["startswith:ABC","linestartswith:test"] ; identifies a text file where either the first line starts with `ABC` ; or there is a line within the first 10 lines that starts with `test`