# （帖子已‭被作‭者删除）

**URL:** <https://forum.freemdict.com/t/topic/44758>\
**Category:** 闲聊吹水\
**Created:** [2026 年8 月 9 日 10:21 UTC](https://forum.freemdict.com/t/topic/44758 "2026-08-09T10:21:09Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![xingxingla](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/x/ccd318/32.png) [@xingxingla](https://forum.freemdict.com/u/xingxingla)\
**Post date:** [2026 年8 月 9 日 10:21 UTC](https://forum.freemdict.com/t/topic/44758/1 "2026-08-09T10:21:09Z")

</div>

# MdictMdd：在 7-Zip 中打开与编辑 MDict 资源文件(.mdd)

 ![image](https://forumcdn.freemdict.com/uploads/default/original/3X/5/5/5569ed4d79a562b7fb9bc2b5512239542e45c83d.png)

## 简介

把 MDict 词典的资源文件(.mdd)当作压缩包，在 7-Zip 中直接浏览、解压、增删文件、重新打包。另附一个独立脚本用于查看/修改词典的名称与简介。  
**本程序完全参考mdict-utils编写，可能会与部分平台不兼容**

本包只提供二进制插件和使用脚本。  
注意：本程序仍属测试时期，请勿在生产环境使用。使用时请提前备份好数据，避免mdd文件损坏。

## 文件说明

Formats\MddFmt.dll 7-Zip 插件(MDD 格式的读写处理)，核心。  
mdd\_rename.py 独立脚本：查看/修改 .mdd 的标题(Title)与简介(Description)。

## 系统要求

平台：Windows x64  
7-Zip：26.02(x64) 或兼容版本。需使用完整版 7zFM.exe / 7z.exe  
(7za.exe 独立版不支持加载外部格式插件)  
MDD 格式：仅支持 Engine 2.0、无加密 的 MDD(见下方"兼容性")。

## 安装

1. 找到 7-Zip 的安装目录(或便携版目录)。
2. 把 Formats\MddFmt.dll 放进该目录下的 Formats\ 子文件夹。

目录结构示例：  
\<7-Zip\>  
7zFM.exe  
7z.exe  
7z.dll  
Formats  
MddFmt.dll ← 放到这里

1. 重启 7-Zip。

## 使用方法

浏览 / 解压：  
图形界面：双击 .mdd(或用 7-Zip 文件管理器7zFM.exe打开)，即可看到内部的图片、字体、  
脚本等资源，可预览、拖出、提取。  
命令行：  
7z x file.mdd 解压到当前目录  
7z l file.mdd 列出内容

增删文件后保存：  
在 7-Zip 中打开 .mdd，添加/删除/替换文件后保存，将按 MDD 规范重新打包。  
未改动的文件会被保留.

选择压缩方式(写入时)：  
7-Zip 的"添加压缩包"对话框底部有 Parameters(参数)输入框，在其中填写压缩方式：  
m=0 无压缩  
m=1 LZO  
m=2 zlib(默认，与常见 .mdd 一致)  
命令行等价写法：7z a -tMdictMdd -mm=0 out.mdd folder

查看/修改标题与简介：  
MDD 的名称(Title)与简介(Description)存在文件头，7-Zip 界面不便编辑。  
mdd\_rename.py 是纯函数式模块，不提供命令行，需在 Python 代码中 import 后调用：

```
  import mdd_rename as M

  # 读取 .mdd 的标题、简介与全部资源
  info = M.get("input.mdd")
  info.title # 标题(str)
  info.description # 简介(str)
  info.entries # 资源字典 {资源名: 字节内容}

  # 修改标题/简介并另存为新文件
  M.rename("input.mdd", new_title="新标题", new_description="<b>新简介</b>",
           out_path="output.mdd")

  # 修改标题/简介并覆盖原文件
  M.rename("input.mdd", new_title="新标题", new_description="新简介")

  # 只改标题，保留原简介
  M.rename("input.mdd", new_title="新标题", out_path="output.mdd")

  # 底层接口：直接写一组资源成 .mdd，可指定压缩方式(0/1/2)
  M.write_mdd("out.mdd", info.entries, title="新标题",
              description="新简介", compression_type=2)

```

简介支持中文、换行及任意 HTML。rename / write\_mdd 只改头部元数据，文件内容  
逐字节保留。  
依赖 Python 3 与 mdict-utils(pip install mdict-utils 安装)。

## 兼容性

读取/写入支持：

- 引擎版本 Engine 2.0 (绝大多数词典资源均为此版本)
- 加密 无加密 (不支持加密 的 MDD，虽然基本上所有词典都是加密的)
- 压缩方式 无压缩 / LZO / zlib 三种 (zlib 最常见)
- 读取 打开、浏览、解压
- 写入 增删文件后重新打包

不支持的场景：

- 加密的 MDD(需要密钥)
- Engine 3.0(新格式布局，未实现)
- 7za.exe 独立版(不加载外部格式插件，请用完整版 7z.exe / 7zFM.exe)

已知说明：

- LZO 编码：未测试。
- 大文件内存：打开时会把整个 .mdd 读入内存，超过 1GB 的资源文件会占用相应内存。
- mdict-utils 的无压缩写入瑕疵：mdict-utils(writemdict)生成的无压缩(compression=0)  
MDD，连它自己的 readmdict 都可能无法读回(key index 未用 zlib)。这不是本插件的  
问题；若用第三方工具生成 MDD，建议使用默认 zlib。

由于打包的mdd Goldendict-ng可以显示但是欧路有加载问题。所以弃坑。。

比较尴尬的一点是，官方默认好像就是有加密的。虽说不难绕。所以基本上打不开市面上的mdd。对mdict-utils打包的mdd反而友好。mdict-utils本身只有解密逻辑的但是没来得及写。

---

<div class="post-metadata">

**Author:** ![xingxingla](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/x/ccd318/32.png) [@xingxingla](https://forum.freemdict.com/u/xingxingla)\
**Post date:** [2026 年8 月 9 日 10:49 UTC](https://forum.freemdict.com/t/topic/44758/2 "2026-08-09T10:49:21Z")

</div>

![image](https://forumcdn.freemdict.com/uploads/default/original/3X/7/2/724bb3480c953a04451684396ed2562cf67b83fe.png)

Funny

---

<div class="post-metadata">

**Author:** ![EddieLi](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/e/e5b9ba/32.png) [@EddieLi](https://forum.freemdict.com/u/EddieLi)\
**Post date:** [2026 年8 月 9 日 10:53 UTC](https://forum.freemdict.com/t/topic/44758/3 "2026-08-09T10:53:44Z")

</div>

干脆把mdx support也加上？

---

<div class="post-metadata">

**Author:** ![xingxingla](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/x/ccd318/32.png) [@xingxingla](https://forum.freemdict.com/u/xingxingla)\
**Post date:** [2026 年8 月 9 日 11:01 UTC](https://forum.freemdict.com/t/topic/44758/4 "2026-08-09T11:01:28Z")

</div>

mdx还是用mdict-utils和db数据库或者txt互转更合适吧

至于mdd修改标题和简介，我决定还是额外写一个简易python程序实现。  
目前提取或者增改资源不需要全量解压打包了好耶

---

<div class="post-metadata">

**Author:** ![EddieLi](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/e/e5b9ba/32.png) [@EddieLi](https://forum.freemdict.com/u/EddieLi)\
**Post date:** [2026 年8 月 9 日 11:04 UTC](https://forum.freemdict.com/t/topic/44758/5 "2026-08-09T11:04:37Z")

</div>

主要是读取方面，mdx和mdd差不多的，能直接打开看到里面的txt挺方便的。

---

<div class="post-metadata">

**Author:** ![xingxingla](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/x/ccd318/32.png) [@xingxingla](https://forum.freemdict.com/u/xingxingla)\
**Post date:** [2026 年8 月 9 日 11:44 UTC](https://forum.freemdict.com/t/topic/44758/6 "2026-08-09T11:44:54Z")

</div>

以后自己就用这个来修改自己的词典了…mdd 还是按照mdict-utils来的，可能和官方格式有出入。

欧陆和Goldendict-ng都是可读mdd的。其他软件未测试。

---

<div class="post-metadata">

**Author:** ![xingxingla](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/x/ccd318/32.png) [@xingxingla](https://forum.freemdict.com/u/xingxingla)\
**Post date:** [2026 年8 月 9 日 11:47 UTC](https://forum.freemdict.com/t/topic/44758/7 "2026-08-09T11:47:57Z")

</div>

只建议修改2GB以下大小的，因为是全量读取到内存里的

---

<div class="post-metadata">

**Author:** ![xingxingla](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/x/ccd318/32.png) [@xingxingla](https://forum.freemdict.com/u/xingxingla)\
**Post date:** [2026 年8 月 9 日 11:51 UTC](https://forum.freemdict.com/t/topic/44758/8 "2026-08-09T11:51:09Z")

</div>

情况有点小尴尬，貌似有的mdd不支持。我排查一下ing

* * *

原来是这样，那不关我事了，反正我也只用来改自己的词典qwq

 ![image](https://forumcdn.freemdict.com/uploads/default/original/3X/c/3/c39b6d8522f0475c996740b7a3f61872f822258b.png)

虽然加密形如虚设但是我平时也用不到。跑路咯

---

<div class="post-metadata">

**Author:** ![HMPTWM](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/hmptwm/32/78836_2.png) [@HMPTWM](https://forum.freemdict.com/u/HMPTWM)\
**Post date:** [2026 年8 月 9 日 11:51 UTC](https://forum.freemdict.com/t/topic/44758/9 "2026-08-09T11:51:18Z")

</div>

这个可以有！  
看来mdd就是简单的压缩咯？

---

<div class="post-metadata">

**Author:** ![xingxingla](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/x/ccd318/32.png) [@xingxingla](https://forum.freemdict.com/u/xingxingla)\
**Post date:** [2026 年8 月 9 日 11:59 UTC](https://forum.freemdict.com/t/topic/44758/10 "2026-08-09T11:59:42Z")

</div>

更推荐是复制formats文件夹到7zip安装版目录下，这样右键一个一堆文件可以直接通过右键菜单打包成mdd（虽说不支持重命名mdd名称和简介，还得用额外提供的python程序）

---

<div class="post-metadata">

**Author:** ![YYDWHY](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/y/6a8cbe/32.png) [@YYDWHY](https://forum.freemdict.com/u/YYDWHY)\
**Post date:** [2026 年8 月 9 日 12:26 UTC](https://forum.freemdict.com/t/topic/44758/11 "2026-08-09T12:26:46Z")

</div>

这个有深度，貌似大家打包资源做词典用，我不大懂你们交流的，但还是不禁要赞👍
