Logo
← Go Back to the Sections

Build your own checksum plugin

This page is for developers. A checksum/detection plugin lets Tuning Editor verify and correct integrity checksums on an ECU the built-in coverage does not include. If you only want to configure checksum handling, see the Generic Checksum plugin instead — that plugin is also the canonical worked example for this guide.

What a plugin is

A plugin is a single native shared library (.dll on Windows, .so / .dylib elsewhere) that the host loads from its plugins/ folder. The entire contract is a C ABI in one header, te_plugin.h: you include it and export a handful of extern "C" functions. There is no Qt or C++ ABI coupling, so any compiler and toolchain works.

The exports

Six functions are mandatory, one is optional:



Use the calling-convention and visibility macros from the header, and build with hidden visibility so only these symbols are exported.

The one rule that matters: memory ownership

Note — the host owns every input; the plugin allocates every result and frees it in the matching te_free_*, with the same allocator. Do not free inputs or keep pointers to them after a call returns. Getting this wrong is the most common plugin bug.

Analyze vs. correct

te_analyze is read-only: sections arrive with a read-only working buffer and an optional reference version. te_correct receives a host-owned mutable copy — write corrected bytes directly into it, do not reallocate it. The host does verify-then-commit (it re-runs analysis on your output before keeping it), so honour the dry-run flag when set. A selection names which checksum ids to correct (empty means “all you support”); keep your enumeration order stable between analyze and correct so the ids line up.

Detection and the originality verdict

te_analyze reports an ECU identity (any field may be null) and an advisory originality verdict — original, modified, or unknown. It is a verification aid only; it never forges or hides anything. A purely user-configured plugin typically reports unknown.

The optional config dialog

If you export te_plugin_configure and set the configure capability, the host shows a Configure… button and hands you the host window handle and a per-user config directory. Draw your own native, modal UI — do not start a second Qt instance. Return changed / unchanged / error so the host knows whether to re-analyse affected files. Because analyze and correct are not given the directory, derive your config location deterministically.

Building and testing

Build with CMake; the build pulls te_plugin.h from the host tree (override the path with -DTUNINGEDITOR_DIR=). Drop the built library into the host's plugins/ folder and use Help › Installed Plugins › Rescan. You do not need the GUI to test: load the library and drive the C ABI directly with synthetic sections, and run it under a leak detector to catch ownership mistakes early.

Tip — start from the example's skeleton/ (the smallest plugin that loads) and grow it. The full contract and a complete worked plugin are in the open-source repository.

The example source is published on GitHub at github.com/mtx-electronics under a permissive licence (0BSD) — use it as the starting point for your own plugin without attribution. See its PLUGIN_DEVELOPMENT.md for the complete ABI reference.

See also



Go Back to the Sections
Petrol10 - Immobilizer

Petrol10 - Immobilizer

Immobilizer deactivation software for automotive professionals. Disable factory immobilizers directly in the ECU file ideal for engine swaps, track vehicles, and module replacements.

EEProm Hex Editor

EEProm Hex Editor

A hex editor built specifically for editing EEPROM data in automotive ECUs. With real-time checksum correction, side-by-side file comparison, and plugin support for automated tasks it's the ultimate tool for professionals.

Tuning Editor

Tuning Editor

A free, modern Windows software for viewing and editing ECU calibration data - map and hex editors, tuning calculators, and online services.