2

I have an A.chm file for my windows application which runs as expected. When I decompile it using HTML workshop I get set of html files, .hhc file, .hhk file. When I compile another file B.chm from these extracted files without changing any of the files.((I want to add more html contents to this file but looks like I am losing some information after decompiling)) The output file I get is 72K where as the original file was 75K. B.chm's contents look all file when viewed in the chm viewer but the behavior is lost when when used with the application.

  1. After reading around I found that if .hhp can be extracted from a .chm file then it can be re-constructed as it is without losing any mapping or aliases. Is that true?

  2. How can I extract .hhp file from a .chm file?

Thanks, Sam

Wolf
  • 9,679
  • 7
  • 62
  • 108
Sam
  • 453
  • 2
  • 6
  • 10
  • Read the answer to [Recompile CHM file](https://stackoverflow.com/a/49323230/2932052) – Wolf Nov 20 '19 at 09:41

1 Answers1

2

No, Yes , and no.

  1. The original hhp can't be guaranteed extracted

  2. however since chm is an archive type, the project could have added all project files to the archive. I assume you already would have found them if that were the case.

  3. If the decompile process does its administration, it can regenerate the .hhp to a certain degree.

    Comments and #define names will probably be lost though, maybe more, but that should not result in problems when recompiling.

But of course it could be that the decompiler is limited. You could try some other (search for something from "keytools").

If not, then take "chmlib" and start drilling down into the format.

Wolf
  • 9,679
  • 7
  • 62
  • 108
Marco van de Voort
  • 25,628
  • 5
  • 56
  • 89
  • Thanks for you reply. I have come across chmDecompiler which claims that it can extract .hhp file. Though someone has to buy it to get this functionality. – Sam Jun 11 '10 at 15:52
  • I've whipped up a small util that extract alias data from CHMs btw. – Marco van de Voort Sep 07 '10 at 20:55
  • 2
    I had good results using keytools, from this page: http://www.grainge.org/pages/authoring/reverse_engineering/reverse_engineering.htm – tfinniga Jan 08 '15 at 12:14
  • I agree - Keytools is the best tool. But some manual adjustments are required. It can be useful, to include the *.hhp file itself into the section [FILES] of the project file (*.HHP). Thus, this is included in the Compiled Help Module (CHM) when compiling. The appropriate *.HHP file then is decompiled in addition to the other files. – help-info.de Jan 10 '15 at 11:52
  • Same for .h files that define context-ids btw. Note that many of these tasks can be done using the chmls tool, but that might require some manual reintegration. The extract alias option above can extract those from the binary representation. – Marco van de Voort Jan 12 '15 at 12:30