WpfHexEditorControl

Wpf Hexeditor is a powerful and fully customisable user control for editing file or stream as hexadecimal, decimal and binary. Can be used in Wpf or WinForm application

View project on GitHub

Core/CharacterTable

Custom character table (.tbl) support for game hacking and ROM editing.

๐Ÿ“ Contents

  • TBLStream.cs - TBL file parser and character mapper
    • Loads .tbl files (game character tables)
    • Maps byte sequences to custom characters
    • Bidirectional lookup (byte โ†” character)
    • Multi-byte character support (DTE encoding)
    • Default table fallback
  • DTE.cs - Dual Tile Encoding entry class
    • Represents multi-byte character mappings
    • Format: byte sequence โ†’ display character
    • Used in game localization and ROM hacking
    • Example: 88=ร… or 8899=โ„ข
  • Enum.cs - Character table enumerations
    • Default table types (ASCII, EBCDIC)
    • TBL entry types and formats
    • Character encoding options

๐ŸŽฏ Purpose

TBL (Table) files are used in ROM hacking and retro game editing to define custom character encodings. Many old games use proprietary encodings where byte values donโ€™t correspond to standard ASCII/Unicode.

๐Ÿ“– TBL File Format

Example .tbl file:

00=<NULL>
0A=<LF>
20=<SPACE>
41=A
42=B
88=ร…
8899=โ„ข

Format: HEX_VALUE=CHARACTER

๐Ÿ”— Integration

HexEditor
    โ””โ”€โ”€ ByteProvider
        โ””โ”€โ”€ TBLStream (optional)
            โ”œโ”€โ”€ Loads: .tbl files
            โ””โ”€โ”€ Provides: Custom character display

๐ŸŽ“ Usage Example

// Load a TBL file
var tblStream = new TBLStream("pokemon_gen1.tbl");

// Map byte to character
string character = tblStream.FindTBLMatch(0x88);
// Returns: "ร…"

// Map multi-byte sequence
byte[] sequence = new byte[] { 0x88, 0x99 };
string multiChar = tblStream.FindTBLMatch(sequence);
// Returns: "โ„ข"

// Reverse lookup (character to bytes)
byte[] bytes = tblStream.FindTBLMatch("ร…");
// Returns: [0x88]

// Use in HexEditor
hexEditor.LoadTblFile("game.tbl");
// Now hex view shows custom characters instead of ASCII

๐ŸŽฎ Use Cases

  • Game Localization: View/edit game text with proper characters
  • ROM Hacking: Modify retro game dialogue and text
  • Data Analysis: Understand proprietary text formats
  • Reverse Engineering: Map unknown encodings
  • Save File Editing: Edit game saves with special characters

โœจ Features

  • Multi-Byte Support: DTE (Dual Tile Encoding) for compressed text
  • Bidirectional Mapping: Byte โ†’ Char and Char โ†’ Byte
  • Default Fallback: Uses ASCII when no TBL loaded
  • Format Validation: Checks .tbl file syntax
  • Encoding Preservation: Maintains original byte values

๐Ÿ“š TBL File Resources

Popular TBL files for classic games:

  • Pokรฉmon Red/Blue/Yellow
  • Final Fantasy series
  • Dragon Quest/Warrior
  • Chrono Trigger
  • Super Mario RPG

TBL files available at: https://www.romhacking.net


โœจ Custom character table support for game hacking and ROM editing