HexViewerPlus
HexViewerPlus - a custom editor extension for Visual Studio Code that provides a hex viewer/editor for viewing and manipulating files in their raw hexadecimal representation, with advanced format support (SREC, IntelHex, TI-TXT, ELF).
This software is designed by 公众号:嵌入式软件实战派.
Features
Two Custom Editors
| Editor |
Type |
Use Case |
hexViewerPlus.hexEdit |
Read & Write |
Full-featured editor with undo/redo, save, backup, and disk-change detection |
hexViewerPlus.view |
Read Only |
Lightweight HTML view for quick browsing and file comparison |
| Format |
Extensions |
Description |
| S-Record (SREC) |
.srec, .s19 |
Motorola S-record, Types 0–9 with CRC validation |
| Intel HEX |
.hex, .ihex |
Extended Linear/Segment Address support, up to 48-bit addresses |
| TI-TXT |
.txt |
Texas Instruments format (@ address lines, q terminator) |
| ELF |
.elf, .out |
Minimal parser: 32/64-bit, Little/Big endian, PT_LOAD segments + entry point |
| Binary |
.bin |
Raw binary from offset 0 |
Select bytes → right-click (or Alt+Ctrl+C) → choose format:
| Format |
Example Output |
Use Case |
| Hex Octets |
00 01 02 FF |
General hex display |
| Hex |
000102FF |
Compact no-separator |
| Literal |
\x00\x01\x02\xff |
C/Go/Python string literal |
| UTF-8 |
Hello World |
Raw text content |
| C |
unsigned char name[4] = { 0x00, 0x01, 0x02, 0xFF }; |
C/C++ array init |
| Go |
var name = []byte{0x00, 0x01, 0x02, 0xFF} |
Go byte slice |
| Java |
byte name[] = { 0x00, 0x01, 0x02, 0xFF }; |
Java byte array |
| JSON |
[0, 1, 2, 255] |
JSON number array |
| Base64 |
AAECAf8= |
Base64 encoding |
File Comparison & Report
- Compare any two files (even mixed formats, e.g.
.hex vs .elf)
- Byte-by-byte diff with red-highlighted differences
- Smart collapse: identical regions ≥256 bytes, gaps ≥64 bytes auto-folded
- Export comprehensive HTML report with summary stats and row-by-row table
Advanced Navigation
| Action |
Shortcut |
| Jump to offset |
Ctrl+G |
| Select between offsets |
Command Palette |
| Copy offset as hex / dec |
Right-click context menu |
| Switch edit mode (read/write) |
Insert |
Data Inspector
Real-time decoded value of selected bytes, supporting:
- Integer types: Int8 / Int16 / Int32 / Int64 / Uint8 / Uint16 / Uint32 / Uint64
- Floating point: Float / Double
- Configurable endianness (Little / Big)
- Three display modes: Aside (next to grid), Hover (on mouseover), Sidebar (dedicated panel)
Search
- Literal search: Find byte sequences (supports wildcard
* for any byte)
- Regex search: Regular expression matching on ASCII interpretation
- Streaming results with real-time progress feedback
- Case-sensitive option
Edit Features
- Direct byte value editing in the grid
- Full undo / redo history
- Automatic backup (VSCode Hot Exit compatible)
- Disk change detection — prompts when external programs modify the file
Commands
| Command |
Shortcut |
Description |
HexViewerPlus: Open File in HexEditor |
— |
Open file as hex editor (icon button) |
HexViewerPlus: Go to Offset |
Ctrl+G |
Jump to specified address |
HexViewerPlus: Select Between Offsets |
— |
Select bytes between two addresses |
HexViewerPlus: Copy As... |
Alt+Ctrl+C |
Copy selected bytes in chosen format |
HexViewerPlus: Switch Edit Mode |
Insert |
Toggle read-only / read-write |
HexViewerPlus: Copy Offset as Hex |
— |
Copy current cursor address (hex) |
HexViewerPlus: Copy Offset as Dec |
— |
Copy current cursor address (decimal) |
HexViewerPlus: Open File in HexFormatView |
— |
Open in read-only view (right-click in Explorer) |
HexViewerPlus: Compare Selected in HexFormatView |
— |
Compare two files (double-select in HexFormatView) |
HexViewerPlus: Export Compare Report (HTML) |
— |
Export comparison result as HTML file |
HexViewerPlus: Enter License Key |
— |
Activate with license key |
HexViewerPlus: Get Activation Code |
— |
Generate and copy Machine ID + activation code |
Configuration
| Setting |
Type |
Default |
Description |
hexViewerPlus.inspectorType |
aside / hover / sidebar |
aside |
Where to show the Data Inspector |
hexViewerPlus.maxFileSize |
number |
10 |
Large file size threshold (MB) |
hexViewerPlus.dataInspector.autoReveal |
boolean |
true |
Auto-reveal Data Inspector sidebar |
hexViewerPlus.defaultEndianness |
little / big |
little |
Default byte order for decoded values |
hexViewerPlus.columnWidth |
integer (1–512) |
16 |
Column width setting |
hexViewerPlus.bytesPerRow |
integer (1–512) |
16 |
Bytes displayed per row |
hexViewerPlus.showAscii |
boolean |
true |
Show ASCII decode column |
hexViewerPlus.copyType |
string (see above) |
Hex Octets |
Default Copy As format |
hexViewerPlus.showDecodedText |
boolean |
true |
Show decoded text column |
hexViewerPlus.showOpenFileButton |
boolean |
false |
Show open-file button in editor title bar |
How to Use
There are several ways to open files with HexViewerPlus:
Method 1: From Explorer (Recommended)
- Right-click any file in the VSCode Explorer
- Choose "Open File in HexFormatView" (read-only) or "Open File in HexEditor" (read-write)
Method 2: Command Palette
- Press F1 or Ctrl+Shift+P
- Run "HexViewerPlus: Open File in HexEditor" or "HexViewerPlus: Open File in HexFormatView"
Method 3: Reopen With
- Open a file with any other extension first
- Press F1 → "Reopen With..." → select HexViewerPlus
Set as Default Editor
Associate specific file extensions with HexViewerPlus via workbench.editorAssociations:
"workbench.editorAssociations": {
"*.hex": "hexViewerPlus.hexEdit",
"*.s19": "hexViewerPlus.hexEdit",
"*.bin": "hexViewerPlus.hexEdit",
"*.elf": "hexViewerPlus.hexEdit"
}
Comparing Two Files
- In HexFormatView, double-click two files in the Explorer to select them both
- Right-click → "Compare Selected in HexFormatView"
- Review the side-by-side diff, then "Export Compare Report (HTML)" for a shareable report
License Activation
HexViewerPlus uses machine-bound license keys for large file access (>1 MB).
Activation Flow
- Run command "Get Activation Code" — your unique Machine ID and activation code are copied to clipboard
- Send the activation code to your license provider(GET LICENSE)
- Receive back an HexVP-XXXXXXXX license key
- Run "Enter License Key" → paste the key → validate
The license is stored locally at ~/.hexviewerplus/license.json and automatically loaded on subsequent startups. The license is bound to your machine fingerprint (Windows: MachineGuid, macOS: IOPlatformUUID, Linux: /etc/machine-id).
HexViewerPlus is engineered for extremely large firmware files. Key optimizations:
- O(n) segment merging (vs. O(n²) incremental): 152K segments merged to 2 in ~72ms (was ~118s)
- Segment-driven virtual scroll: iterates only over data segments, skipping 90%+ gap areas
- Batch base64 encoding: single allocation + encode instead of 152K small chunk encodes
- Binary search for byteAt: O(log n) lookup vs. O(n) linear scan
Benchmark: Appl.hex — 152,652 lines, 4.8 MB source, 11.2 MB address span, ~43% data density.
Known Issues
To track existing issues or report a new one, please visit the issue tracker.
Third-Party Licenses
This extension includes code derived from the following open-source project:
vscode-hexeditor
The full copyright notice and license text are reproduced below.
MIT License
Copyright (c) Microsoft Corporation. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
This extension itself is proprietary software. Its license terms are
available in the LICENSE.md file included in the extension package.