Plugin API reference

The shared callback interface for custom native plugins.

DE Decompiler uses the shared VB Decompiler plugin ABI. Exported names retain the VBDecompilerPlugin prefix. Shared compiler identifiers and legacy VB/FRX command names are API identifiers; they do not define the input formats supported by the product. Check each operation against the data available in the current DE Decompiler project.

This documentation describes the plugin interface shared by VB Decompiler and DE Decompiler. The plugin system allows you to analyze, modify, or extend the decompiled code and internal structures of the application via a shared library (DLL).
1. Architecture Overview
The plugin system operates on a callback model:
  • The host decompiler loads your DLL plugin.
  • It calls your exported functions to retrieve the plugin name and author info.
  • It calls VBDecompilerPluginLoad, passing a pointer to its internal Callback Engine.
  • Your plugin interacts with the host by calling this Engine function using specific Action IDs (vlType constants).
2. Exported Functions
Your DLL must export the following stdcall functions:
VBDecompilerPluginName
Called by the host to retrieve the display name of your plugin.
void __stdcall VBDecompilerPluginName( HWND VBDecompilerHWND, // Handle to main window HWND RichTextBoxHWND, // Handle to the code editor window char* Buffer, // Target buffer (100 bytes, ANSI) int Reserved // Reserved );
Usage: Copy a standard ASCII string (max 100 chars) with your plugin name into Buffer.
VBDecompilerPluginAuthor
Called to retrieve author contact information.
void __stdcall VBDecompilerPluginAuthor( HWND VBDecompilerHWND, HWND RichTextBoxHWND, char* Buffer, // Target buffer (ANSI) int Reserved );
Usage: Copy a string like "Author Name, email@domain.com" into Buffer.
VBDecompilerPluginLoad
The main entry point where your plugin logic is executed.
void __stdcall VBDecompilerPluginLoad( HWND VBDecompilerHWND, HWND RichTextBoxHWND, char* Buffer, // Reserved/Buffer void* PluginEngine // <--- Pointer to the Callback Function );
Usage: Store the PluginEngine pointer. You will use it to invoke GetValue / SetValue commands (see "Callback Engine" below).
3. The Callback Engine
Communication with the host is handled via a single callback function pointer provided in PluginEngine.
Function Signature:
typedef wchar_t* (__stdcall *TVBDPluginEngine)( int vlType, // Command ID (Action) int vlNumber, // Primary Index (Form/Module ID) int vlFnNumber, // Secondary Index (Function ID) char* vlNewValue // Value to set (ANSI string) or NULL for Get commands );
Note: The engine accepts ANSI strings (char*) for inputs but returns Unicode strings (wchar_t*) for results.
4. Command Reference (vlType)
The following constants are used as the vlType argument to perform specific actions.
Global Project Commands
Operations related to the project file or global settings. vlNumber and vlFnNumber are usually 0.
IDConstantDescription
1GetVBProjectGet the full text of the decompiled project file.
2SetVBProjectReplace the project file content.
3GetFileNameGet the full path of the file being analyzed.
4IsNativeCompilationReturns "1" if the target is compiled to Native Code, "0" for P-Code.
5ClearAllBuffersClears internal decompiler structures. Use this if your plugin implements a full custom decompiler for a new language.
6GetCompilerReturns compiler type: 1=VB, 2=.NET, 3=Delphi, 4=Unknown.
7IsPackedReturns "1" if the file is packed/compressed, "0" otherwise.
56GetVBDecompilerPathReturns the path to the DE Decompiler executable.
100UpdateAllCommit changes and refresh the GUI. Required after setting values to ensure the user sees changes.
64GetProductNameOptional loaded host identity, independent of the inspected compiler; see SDK 26.6 below.
UI Control
Control elements of the DE Decompiler interface.
IDConstantDescription
8SetStackCheckBoxValueSet Parse stack parameters checkbox state. "1" = Checked, "0" = Unchecked.
9SetAnalyzerCheckBoxValueSet Procedure analyzer and optimizer checkbox state. "1" = Checked, "0" = Unchecked.
50GetActiveTextGet text currently displayed in the active code window.
51SetActiveTextSet text in the active code window.
52GetActiveDisasmTextGet the raw disassembly text of the disassembler window.
53SetActiveDisasmTextSet the raw disassembly text to the disassembler window.
54SetActiveTextLineScroll or jump to a specific line number (passed as string in vlNewValue).
55GetActiveModuleCoordinatsGet IDs of the active view. Validate the returned value before using it.
58SetStatusBarTextDisplay a custom message in the application status bar.
Forms
Operations on recovered forms. vlNumber: Form Index (0-based).
IDConstantDescription
10GetVBFormNameGet the name of the form.
11SetVBFormNameRename the form.
12GetVBFormGet the decompiled properties of the form.
13SetVBFormSet the properties of the form.
14GetVBFormCountReturns total number of forms in the project.
Modules
Operations on Standard Modules (.bas) or Class Modules (.cls). vlNumber: Module Index (0-based).
IDConstantDescription
30GetModuleNameGet the name of the module.
31SetModuleNameRename the module.
32GetModuleGet the decompiled declarations header of the module.
33SetModuleSet the decompiled declarations header of the module.
34GetModuleStringReferencesGet list of string references used in this module.
35SetModuleStringReferencesSet string references.
36GetModuleCountReturns total number of modules.
Procedures / Functions
Operations on specific functions within a module.
vlNumber: Module Index.
vlFnNumber: Function Index (0-based) within that module.
IDConstantDescription
20GetSubMainGet the code for the entry point (Sub Main). (Index args ignored).
21SetSubMainSet the code for the entry point.
40GetModuleFunctionNameGet the name of a specific function.
41SetModuleFunctionNameRename the function.
42GetModuleFunctionAddressGet the memory address (VA) of the function.
43SetModuleFunctionAddressSet the function address.
44GetModuleFunctionGet the decompiled code of the function.
45SetModuleFunctionSet the code of the function.
46GetModuleFunctionStrRefGet string references specific to this function.
47SetModuleFunctionStrRefSet string references for this function.
48GetModuleFunctionCountReturns number of functions in the specified module.
57GetModuleFunctionCodeGet function code in "Fast Decompilation" mode (if this function is not processed at this time).
70GetModuleFunctionDisasmGet the disassembly (ASM) of the function.
71SetModuleFunctionDisasmSet the disassembly of the function.
Resources (FRX)
Access to binary form resources (icons/images). vlNumber: Icon Index.
IDConstantDescription
60GetFrxIconCountNumber of registered original pictures (zero-based indexes), including native ImageList bitmap sheets.
61GetFrxIconOffsetLegacy adjusted offset: actual picture offset minus 8. Add 8 before reading.
62GetFrxIconSizeLegacy adjusted size: actual picture byte count plus 8. Subtract 8 before reading.
63GetFrxImageListInfoOptional IL1 metadata for a registered native DFM ImageList color bitmap; see SDK 26.6 below.
5. Native images and optional SDK 26.6 commands
This shared SDK revision is implemented by VB Decompiler 26.6 and DE Decompiler 26.6. Commands 63 and 64 are optional, read-only getters. The callback signature, exported symbols and existing command numbers are unchanged. Invoke the callback on the host application's main thread.
Registered pictures: commands 60–62
Image indexes are zero-based. GetFrxIconCount returns the number of registered original pictures, not the number of logical icons inside ImageLists. Read their original bytes from the executable or DLL returned by GetFileName (command 3).
For an image at actual file offset P with actual byte count N, command 61 returns P - 8 and command 62 returns N + 8. Add 8 to the returned offset and subtract 8 from the returned size:
Offset := GetInteger(GetFrxIconOffset, ImageIndex);
Size := GetInteger(GetFrxIconSize, ImageIndex);
FileStream.Position := Offset + 8;
ImageStream.CopyFrom(FileStream, Size - 8);
Validate the index, adjusted range and payload signature before reading. These legacy adjustments do not imply a physical FRX header in a Delphi executable. The resulting payload begins with its BMP, PNG, JPEG, GIF, ICO or CUR signature; DFM property prefixes and ImageList container headers are excluded.
DE Decompiler registers pictures while decoding binary DFM form values. Independently encoded collection pictures have separate entries. A native ImageList's original color bitmap and optional mask remain ordinary bitmap entries, so existing plugins can continue to display or export the complete sheets.
63 — GetFrxImageListInfo
Pass an existing picture index in vlNumber; pass zero for vlFnNumber and a null input pointer. For a recognized native DFM ImageList color bitmap, the current response is:
IL1;<Count>;<Width>;<Height>;<Flags>;<MaskOffset>;<MaskSize>
FieldMeaning
CountNumber of logical images, excluding spare capacity.
Width, HeightCell dimensions in pixels.
FlagsOriginal ImageList flags. Bit 0 indicates a mask; color format $20 indicates ILC_COLOR32.
MaskOffsetActual file offset of the mask BMP signature. Do not add 8.
MaskSizeActual mask BMP byte count. Do not subtract 8.
Numeric fields are decimal and separated by semicolons. Both mask fields are zero when no mask is present. Color data still uses commands 61–62 and their legacy adjustment. Command 63 returns metadata only: it does not change indexes, rasterize cells or duplicate picture data in the host.
The current IL1 implementation recognizes native stream version $0101 with BMP sheets. An ordinary picture, unsupported stream or older host can return an empty string; invalid indexes return Error. Treat empty, Error, malformed and unknown-version replies as unsupported and retain whole-picture handling wherever the original picture entry is available.
For a cell index K, use logical top-left coordinates:
Columns := ColorBitmap.Width div CellWidth;
X := (K mod Columns) * CellWidth;
Y := (K div Columns) * CellHeight;
Require 0 <= K < Count. Validate geometry and file ranges and account for bottom-up DIB scanlines. Apply the matching one-bit mask or premultiplied alpha. Older 32-bit lists can contain an entirely zero alpha channel, in which case the mask remains the fallback.
The supplied shared/PluginSDK.pas and shared/modFrxImageList.pas provide the getters, parser and ImageList reader used by the updated viewer. The following excerpt assumes that FileStream is open on the analyzed file:
InfoText := GetString(GetFrxImageListInfo, ImageIndex);
if ParseFrxImageListInfo(InfoText, Info) then begin
  ColorOffset := GetInteger(GetFrxIconOffset, ImageIndex) + 8;
  ColorSize := GetInteger(GetFrxIconSize, ImageIndex) - 8;
  Images := TFrxImageList.Create(FileStream, ColorOffset, ColorSize, Info);
  try
    Icon := Images.Icon(0);
    try
      Icon.SaveToFile('Image_0.ico');
    finally
      Icon.Free;
    end;
  finally
    Images.Free;
  end;
end;
The reader validates ranges and geometry and uses Windows common controls to decode a native list. Enumerate each recognized list once. Suppress its separate mask entry by comparing the mask's actual offset with each picture's adjusted offset plus 8. Exported cell ICO files are derived images with the list's masks/alpha; standalone pictures retain their original payloads.
64 — GetProductName
Pass zero for both indexes and a null input pointer. The result is VB Decompiler or DE Decompiler, taken from the loaded host's identity independently of the inspected file's compiler.
Copy every returned UTF-16 string immediately: the pointer belongs to the host and remains valid only until the next callback. The supplied DecompilerProductName helper validates the response and falls back to VB Decompiler on older hosts. Keep historical SDK exports, registry paths and localization keys unchanged.
Compatibility and downloads
  • Existing plugins continue to use commands 60–62 without changes.
  • The updated viewer retains whole-picture behavior with older hosts.
  • Recognized native DFM lists use command 63 for individual cell previews and ICO export; independently encoded collection pictures remain ordinary entries.
  • VB5/6 and .NET graphics retain their existing extraction paths.
  • These new getters do not modify the input file, recovered code, forms or current selection.
Download the shared SDK, including the optional-command reference and Delphi helpers. Read the supplied SDK 26.6 additions. See FRX Image Viewer for the user workflow.

SDK 26.6: displayed items, marks and full addresses

DE Decompiler 26.6 supports the following optional commands through the existing PluginEngine callback. Call the API on the main application thread. Copy each returned UTF-16 string before the next callback; input strings retain the existing null-terminated ANSI convention.

IDConstantArguments and result
65GetDisplayedTreeItemNo arguments. Returns TREE1;kind;module;function;form for the opened content, independently of tree selection; empty if no current item is available.
66GetModuleFunctionMarkModule and function indexes. Returns 0 or 1, or empty if the function is not represented in the current tree.
67SetModuleFunctionMarkModule and function indexes; input 0 or 1. Returns 1 on success, or empty if the function is absent from the current tree.
68FindModuleFunctionByVAHexadecimal address as input; zero-based match ordinal in the module argument. Returns module,function for an exact match, or empty when no match remains.
69GetModuleFunctionVAModule and function indexes. Returns the full unsigned virtual address as a decimal string, including the PE ImageBase for x64.

TREE1 kinds include function, module, unit, form, usercontrol, otherform, submain, root and other. Unused indexes are -1; a Delphi unit is not exposed as a module index. Command 55 still returns the last active procedure coordinates and can retain them while a form is displayed.

Function marks use the same decoration as the Space-bar action. Reading or setting a mark does not open or decode the function or move the selection or caret. Rebuilding the tree can remove marks; these commands do not add VDD persistence.

Address input is hexadecimal, even when it contains digits only; optional 0x and $ prefixes are accepted. Lookup is exact and can enumerate functions sharing one address. For x64, both the full VA and compatibility-model VA are accepted. Command 42 keeps its historical signed 32-bit result. These are native-code addresses, not metadata tokens.

Older hosts return an empty string for unknown commands. Invalid indexes or input, a rejected call outside the main thread or a prohibited write return Error. An unavailable full x64 address also returns Error. Handle empty and Error results explicitly and retain the existing fallback behavior.

Current := GetString(GetDisplayedTreeItem);
Coords := FindFunctionByVA('0x89CB90');
State := GetString(GetModuleFunctionMark, 4, 51);
Reply := SetStringResult(SetModuleFunctionMark, '1', 4, 51);
FullVA := GetString(GetModuleFunctionVA, 4, 51);