Decompile / extract CHM files

CHM files can be converted back into individual files or decompiled.

There are two possibilities. So 7zip can simply unpack a CHM file, but also the built-in Windows component of the Help Viewer can do this.

hh.exe – HTML Help Viewer

The hh.exe is the viewer for CHM files in Windows. It can not only display CHM files, but also extract CHM files. We open a command prompt and change to the directory of the CHM file.

Here we can extract the CHM file with the command:

Hh.exe -decompile output directory chmdatei.chm

The CHM file is extracted to the directory.

Unzip with 7zip

7zip can also extract CHM files. Just right-click on the file.

The result is similar in both cases.

On the left is the export with hh.exe, on the right the 7zip. Here are additional files and directories available, which are not content.

DA-HelpCreator Import

The directory structure of a CHM file created with DA-HelpCreator corresponds to what was created in DA-HelpCreator. The same directories exist. In each directory there is an “index.html” file and the corresponding files, like pictures.

This makes it easy to transfer content back into the DA-HelpCreator project. Simply copy the contents in the Explorer into the project directory. Thus contents can be reconstructed from the finished CHM file again. Please note, however, that the HTML files are the exported formats. This means that macros and placeholders are no longer available. Elements such as navigation must also be removed manually.

Import of external projects

Other CHM files create a different directory structure during export. Such a project requires a bit more effort for the import into DA-HelpCreator.

In this example, all HTML files are in one directory, including images. This requires manual sorting. First we create a new project in DA-HelpCreator. We change the default editor in the settings to “HTML Editor”.

Then we create the directory structure of the project in the Windows Explorer. Now we copy the respective HTML file into the appropriate subdirectory.

When copying, we rename the file to “index.html”.

The same applies to the pictures, by the way. The images belonging to the HTML file must also be copied. In DA-HelpCreator the folders now appear, the editor has to be changed from Markdown to HTML:

The question of conversion will be answered in the negative. The content then appears.

Links still point to the old directory structure of the CHM file and have to be adjusted manually.

Leave a Reply

Your email address will not be published.