22.01.2018 (Monday)


Extracts DFM, LFM and FRM forms from executable files compiled by Delphi, Lazarus and CodeTyphon.

DfmExtractor is a small command line utility which allows you to extract DFM, LFM and FRM forms from executable files compiled by Delphi, Lazarus and CodeTyphon.

License: Freeware, OpenSource.

The application does NOT contain any malicious software. VirusTotal.com scan results:
Windows 32-bit portable

This program was made for my private use, but it may also be useful to someone.

When translating one program written in Delphi, I needed DFM forms to make it easier to work with the Poedit program, so I decided to write a small program to extract DFMs.

DfmExtractor version 1.0 [32-bit] (2018.01.11)

Usage: DfmExtractor.exe -i=FILE [-n=NAME] [-idx=X] [-o=FILE] [-e=EXT] [-p=STR] [-a] [-d=DIR]
[-l] [-h] [-V] [--home]

Mandatory arguments to long options are mandatory for short options too.
Options are case-sensitive. Options in square brackets are optional.

Input/output options

-i, --input-file=FILE An executable file containing Delphi, Lazarus or CodeTyphon forms (DFM, LFM, FRM).
-n, --form-name=NAME Form name or form class name to extract.
-idx, --form-index=X The index of the form to extract. Non-negative integer.
-o, --output-file=FILE The output file with extracted form.
-e, --extension=EXT The default extension of the output file(s). If not specified, DFM will be used.
-p, --prefix=STR Output file(s) name prefix (for the -a option).
-a, --save-all Saves all forms from the specified executable file to the given (or current) directory.
-d, --output-dir=DIR Output directory (for the -a option).
-l, --list Displays a list of all forms in the given input file.


-h, --help Show this help.
-V, --version Show application version.
--home Opens program homepage in the default browser.


  1. List all forms in the file AudioExtractor64.exe:
      DfmExtractor.exe -i AudioExtractor64.exe -l
    Forms: 10
    Index |  Lines | Form name        | Form class
        0 |    451 | CustomizeFrm     | TCustomizeFrm
        1 |    343 | FormAbout        | TFormAbout
        2 |     49 | FormCmdLine      | TFormCmdLine
        3 |    345 | FormErrors       | TFormErrors
        4 |  1 621 | FormFileInfo     | TFormFileInfo
        5 |    474 | FormListFileEdit | TFormListFileEdit
        6 |  6 035 | FormMain         | TFormMain
        7 |    790 | FormOptions      | TFormOptions
        8 |    422 | FormProgress     | TFormProgress
        9 |    169 | FormToolsInfo    | TFormToolsInfo
  2. Save all forms from the AudioExtractor64.exe file to files with the LFM extension:
      DfmExtractor.exe -i AudioExtractor64.exe -a -e lfm
    File saved: CustomizeFrm.lfm
    File saved: FormAbout.lfm
    File saved: FormCmdLine.lfm
    File saved: FormErrors.lfm
    File saved: FormFileInfo.lfm
    File saved: FormListFileEdit.lfm
    File saved: FormMain.lfm
    File saved: FormOptions.lfm
    File saved: FormProgress.lfm
    File saved: FormToolsInfo.lfm
  3. Save form FormMain from the AudioExtractor64.exe file to main form.dfm file:
      DfmExtractor.exe -i AudioExtractor64.exe -n FormMain -o "main form.dfm"
    The form with name/class "FormMain" has been saved to file: main form.dfm
  4. Save form with index 4 from the AudioExtractor64.exe file to a DFM file:
      DfmExtractor.exe -i AudioExtractor64.exe -idx 4
    The form with index 4 has been saved to file: FormFileInfo.dfm

Tech Info

To compile program from source, you need:
  1. Delphi with simple type record helpers support (XE4 or higher). You can use a free Delphi Starter version.
  2. JEDI Code Library (JCL)
  3. My Delphi units from units directory (in the archive with source).
How to build:
  1. Install JEDI Code Library.
  2. Extract 7z archive with source files.
  3. Open src\DfmExtractor.dpr file in Delphi.
  4. Add units directory to project's "Search path" (menu Project->Options...: Delphi Compiler / Search path).
  5. In the Project Manager set target platform to Win32.
  6. Build project (menu Project->Build All).


Version 1.0 (2018.01.11)
Initial release.