{
  "id": 21938359,
  "title": "How WinHelp files work",
  "url": "https://urgent.news/2026/11/26/how-winhelp-files-work",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-11-26T06:39:00.000Z",
  "source": {
    "name": "Lobsters",
    "slug": "lobsters",
    "url": "https://quin.fyi/posts/how-winhelp-files-work.html"
  },
  "original_language": "en",
  "account": "WinHelp files are a format used by Microsoft to store help documentation. They are not officially documented by Microsoft, but the format has been reverse-engineered by developers. Libhlp is a Rust library that allows for opening and reading WinHelp .hlp files.\n\nA .hlp file starts with a magic number, 3F 5F 03 00, followed by the position of its internal directory. The .hlp file is essentially an archive, and the directory lists the files contained within. Most file names start with a pipe character, such as |SYSTEM, |TOPIC, |FONT, and |CONTEXT. Pictures are stored in files like |bm0.\n\nThe directory itself is a B+ tree, and each index in the file is also a B+ tree. Text is stored in the |TOPIC file, which is divided into fixed-size blocks. Each block can be compressed using the LZ77 algorithm. The blocks take up the same amount of space in memory, whether they are completely filled or not. Inside the blocks, the text is a linked list of records. Some records mark the beginning of a new topic, while the rest hold paragraphs.\n\nEach paragraph consists of a formatting part and a text part. The text part can be compressed again, adding another layer of complexity to the WinHelp format. Back-references are a unique feature of WinHelp compression. They allow the text to reference previous bytes, rather than repeating them. This can lead to some quirky behavior, such as back-references reaching before the start of the data.\n\nAdditional compression can be applied to the most common phrases in the help file. WinHelp 3.1 uses a simple table in |Phrases, while Windows 95 introduced Hall compression in |PhrIndex and |PhrImage. These compression methods allow for the storage of short codes for frequently used phrases.\n\nWinHelp files also contain links, which are stored as hashes of the target topic name. To follow a link, you hash the target name using the same algorithm as WinHelp and look up the result in the |CONTEXT file, which maps the hash to the position of the target topic. The text itself is stored in the code page used by the author, which may vary depending on the language of the text. WinHelp 3.0 has some differences in its format, including block sizes and compression methods. Libhlp can read these files, but it required a separate commit to handle the format correctly.",
  "summary": null,
  "key_points": [
    "WinHelp files store Microsoft help documentation in a proprietary format",
    ".hlp files start with magic number 3F 5F 03 00 and contain an internal directory",
    "Text compression uses LZ77 algorithm, with back-references for efficiency"
  ],
  "editors_take": "Reverse-engineering the undocumented WinHelp format through the Libhlp library enables developers to preserve and access legacy Microsoft documentation that lacks official modern support.",
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}