# wechat-skin
**Repository Path**: yuz_cn/wechat-skin
## Basic Information
- **Project Name**: wechat-skin
- **Description**: 微信整套皮肤 v2.9.0 · 原生 Weixin.dll 数据段换肤(零注入):七区域联动 + 24 套主题 + 跨版本自动定位。exe 见蓝奏云 https://yikz.lanzout.com/i6QX448ntsgj,源码跑 python skin/wechat_skin_v2.py 即可。archive/ 保留早期 D3D11/Frida 技术探索存档
- **Primary Language**: Unknown
- **License**: MulanPSL-2.0
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 6
- **Forks**: 0
- **Created**: 2026-09-14
- **Last Updated**: 2026-10-21
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# WeChat Skin · 微信整套皮肤
**English** · [中文](#中文)
Whole-window theming for the PC WeChat 4.x client by rewriting color constants in the `Weixin.dll` data section — no injection, no code patching, no signature change, no process hook.
- Current version: **v2.9.0** — 7 linked regions, 24 presets, version-independent auto-locate
- Prebuilt exe — GitHub Release, built on `windows-latest` by Actions:
- `wechat-skin-2.9.0-onefile.exe` — 11,745,363 bytes, SHA-256 `9c9371b98e6598741a4516856084c833f12bd263bcea13cae1644bcbc152a24f`
- `wechat-skin-2.9.0-folder.zip` — 12,064,721 bytes, SHA-256 `8869236f4de5b2bdb442651fd1675cf2f616a0128ea2016313f936c6ac803dfb`
- Source repositories: this Gitee repo (source archives under Releases) and its GitHub mirror
- Older binary copy (Lanzou, differs only in two dialog strings, same engine): — extract code `frxt`
- License: Mulan PSL v2 — see [LICENSE](LICENSE)
## Contents
- [Overview](#overview)
- [Features](#features)
- [Supported versions](#supported-versions)
- [Quick start](#quick-start)
- [Dependencies](#dependencies)
- [How it works](#how-it-works)
- [Repository layout](#repository-layout)
- [Licensing and third-party notices](#licensing-and-third-party-notices)
- [Changelog](#changelog)
- [中文](#中文)
## Overview
WeChat stores its interface colors as BGRA constants inside the data section of `Weixin.dll`. This tool locates those constants at run time and rewrites just those bytes, so it never participates in process loading and the client's own integrity checks are not involved. One apply repaints seven regions at once; one click restores the original colors from the backup taken on first run.
Safety first: if the tool cannot prove where the constants are, it refuses to write. It never falls back to hard-coded offsets.
## Features
| Region | What it colors |
|---|---|
| Chat area | message list background |
| Conversation list | left list background |
| Pinned rows | background of pinned conversations |
| Navigation rail | the vertical icon bar |
| Outgoing bubble | your own bubbles |
| Incoming bubble | the other side's bubbles (shares the constant with file cards) |
| Selection highlight | the currently selected conversation row |
- **24 presets**: original + 6 pastel themes + 17 classic ones
- **Custom colors** per region; the Qt UIs can pick a color from anywhere on screen
- **Random theme**, **import/export palettes**, **one-click restore**
- Three frontends over one engine: a zero-dependency tkinter build, a PySide6 standard UI, a PySide6 pastel UI
## Supported versions
| WeChat | Platform | Status |
|---|---|---|
| 4.1.13.12, 4.1.13.65 | Windows | covered by the committed regression suite (`tests/test_crossver.py`) |
| 4.1.12.55, 4.1.15.11 | Windows | verified manually on real machines during earlier releases; no DLL samples were kept, so these cannot be re-run here |
| other 4.1.x patch releases | Windows | expected to adapt automatically, since locations come from structure and color signatures rather than hard-coded offsets |
| 4.0.x and older | — | untested; Tencent no longer publishes those installers |
| 3.x, web, mobile | — | not supported |
When locating fails, the tool refuses to write and logs why.
## Quick start
```bash
# zero-dependency single file (tkinter)
python skin/wechat_skin_v2.py
# PySide6 UIs
pip install PySide6-Essentials
python skin/wechat_skin_qt.py # standard
python skin/wechat_skin_gf.py # pastel
# command line
python skin/wechat_skin_v2.py 深海蓝 # apply a theme by name
python skin/wechat_skin_v2.py 原版 # restore the original colors
```
Applying a theme terminates WeChat, patches the DLL and relaunches it — you will need to sign in again.
Prebuilt binaries are published as assets on the GitHub Release above: `wechat-skin-2.9.0-onefile.exe` (single file, no Python required) and `wechat-skin-2.9.0-folder.zip` (the same program plus its `_internal` folder; either one works, the folder version just starts a hair faster). Both are built by `.github/workflows/build-windows-exe.yml` on a `windows-latest` runner with PyInstaller 6.22.2 / Python 3.13, and `SHA256SUMS.txt` next to them lists the digests quoted at the top of this file.
PyInstaller output is **not byte-reproducible** — the interpreter build, the toolchain and embedded timestamps all end up in the package, so rebuilding on your own machine legitimately produces a different SHA-256 than the published asset. To skip the download entirely, run `python skin/wechat_skin_v2.py` or build from the `.spec` files under `skin/`. An older binary copy also remains on Lanzou (, extract code `frxt`); it differs from v2.9.0 only in two dialog strings. Binaries are never committed to this repository.
## Dependencies
| Case | Requirement |
|---|---|
| Single-file UI / shipped exe | none — Python standard library + tkinter only |
| PySide6 UIs | `PySide6-Essentials` (only QtCore / QtGui / QtWidgets are imported) |
| Building your own exe | `pyinstaller`; the recipe is committed as `skin/微信整套皮肤 v2.9.0.spec` |
It never touches the network, uploads nothing, and only reads the registry to find the install path. Write permission on the WeChat directory is required; run elevated when WeChat lives under `Program Files`.
## How it works
Color constants sit behind the marker `01 00 00 00 03 00 00 00` and are stored as `FF BB GG RR`:
- backgrounds: pinned → list → chat, 48 bytes apart; nav rail at chat +720
- bubbles: outgoing at chat +11760, incoming at outgoing +48; brand green at outgoing +0x90
- selection highlight: chat +144
- brand green `(0,195,117)` and the near-grey `(233,233,237)` component are never themed, which makes them reliable cross-version anchors
Guards, in order:
1. three independent locating strategies are graded; heuristic-only results are rejected
2. out-of-range addresses, broken structure markers, read-only files and a still-running client all abort the write
3. every write is verified by reading the bytes back
4. the original `Weixin.dll` is backed up on first run after a size/version check
## Repository layout
```
wechat-skin/
├── skin/ # the product
│ ├── wechat_skin_v2.py # engine + zero-dependency tkinter UI (what the exe is built from)
│ ├── wechat_skin_qt.py # PySide6 standard UI
│ ├── wechat_skin_gf.py # PySide6 pastel UI
│ └── 使用说明.md # detailed usage doc (Chinese)
├── tests/ # four regression suites; read-only or fully stubbed, never touch a real DLL
├── .github/workflows/ # build-windows-exe.yml — GitHub Actions, windows-latest, publishes the Release assets
├── LICENSE # Mulan PSL v2
└── README.md
```
`tests/test_crossver.py` needs real `Weixin.dll` samples and records a missing sample as SKIP rather than a failure; drop a DLL into `skin/samples//` to widen coverage (that directory is git-ignored on purpose).
## Licensing and third-party notices
- **Everything in this repository** (product code, tests, docs) is licensed under the **Mulan Permissive Software License, Version 2 (Mulan PSL v2)** — full text in [LICENSE](LICENSE). The license is bilingual with equal legal effect; the Chinese version prevails in a conflict. The same notice appears in each `skin/` source header.
- **Third-party components** are neither bundled nor redistributed here; each keeps its own license:
- `PySide6-Essentials` / `shiboken6` — LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only (Qt also offers a commercial license)
- `PyInstaller` — GPLv2-or-later **with the special exception** that permits building and distributing non-free programs
- "Microsoft YaHei" is referenced by font name only; no font file ships with this repository
- **WeChat itself**: `Weixin.dll` and all WeChat trademarks remain the property of Shenzhen Tencent Computer Systems Co., Ltd. This repository contains and distributes **no** WeChat files; recoloring happens only on a copy of the client the user already owns locally, and is restorable from the backup.
- **Permitted use**: personal learning and interface beautification. No commercial use. Do not use it to impersonate the official client or mislead anyone.
## Changelog
| Version | Changes |
|---|---|
| v2.9.0 | Two parallel development lines merged into one engine (three-tier locating + the 7th "selection highlight" region + pastel themes); three write guards plus read-back verification; every process operation has a timeout and fails closed; both PySide6 UIs enforce the same guards |
| v2.8.0 | Added the 7th region; pastel edition (6 themes, cream-pink UI, screen color picking); PySide6 UIs |
| v2.7.2 | Support the new `WeChat.exe` main binary name |
| v2.7.1 | Cross-checked dual locating; fixed colored themes failing to repaint backgrounds |
| v2.6.5 | Auto-locate, bubble locating, logging |
---
# 中文
[English](#english) · **中文**
PC 微信(4.x)整套界面换肤:直接改写 `Weixin.dll` 数据段里的颜色常量,**零注入、不改代码、不改签名、不 hook 进程**。
- 当前版本:**v2.9.0** —— 七区域联动、24 套预设主题、版本地址自动定位
- 预构建 exe —— GitHub Release(Actions 在 `windows-latest` 上自动构建):
- `wechat-skin-2.9.0-onefile.exe`,11,745,363 字节,SHA-256 `9c9371b98e6598741a4516856084c833f12bd263bcea13cae1644bcbc152a24f`
- `wechat-skin-2.9.0-folder.zip`,12,064,721 字节,SHA-256 `8869236f4de5b2bdb442651fd1675cf2f616a0128ea2016313f936c6ac803dfb`
- 源码仓库:本 Gitee 仓库 (Releases 里是源码包),GitHub 镜像
- 较早的二进制副本(蓝奏云,只差两处提示文案,换肤结果一致):,提取码 `frxt`
- 许可证:木兰宽松许可证 第 2 版,见 [LICENSE](LICENSE)
## 目录
- [项目介绍](#项目介绍)
- [功能特性](#功能特性)
- [适配版本](#适配版本)
- [快速开始](#快速开始)
- [依赖](#依赖)
- [技术原理](#技术原理)
- [项目结构](#项目结构)
- [开源文件说明](#开源文件说明)
- [版本历史](#版本历史)
- [注意事项](#注意事项)
- [English](#english)
## 项目介绍
微信把界面颜色以 BGRA 常量存在 `Weixin.dll` 的数据段里。本工具在运行时定位这些常量,**只改这几个字节**,不参与进程加载、不修改代码,因此微信自身不校验也不会察觉。一次应用联动七个区域,一次点击即可从首次运行留下的备份还原。
安全优先:只要不能确定常量位置,工具就拒绝写入,也绝不回落到硬编码地址。
## 功能特性
| 换肤区域 | 说明 |
|---|---|
| 聊天区 | 消息区背景 |
| 列表区 | 会话列表背景 |
| 置顶区 | 置顶会话那一条的底色 |
| 导航栏 | 最左侧竖排图标栏 |
| 发送气泡 | 己方消息气泡底色 |
| 接收气泡 | 对方消息气泡底色(与文件卡片共用同一常量) |
| 选中高亮 | 会话列表当前选中行 |
### 主题与功能
- **24 套预设主题**:原版 + 女生专属 6 套(纯白恋人 / 奶油泡芙 / 蜜桃乌龙 / 草莓奶霜 / 芋泥啵啵 / 马卡龙)+ 经典 17 套
- **自定义配色**:七个区域逐个选色,Qt 界面可**全屏吸色**(屏幕任意位置取色)
- **随机主题** / **配色导入导出** / **一键恢复原版**
- 三种界面共用同一套引擎:零依赖单文件版(tkinter)、PySide6 标准版、PySide6 粉色版
## 适配版本
| 微信版本 | 平台 | 状态 |
|---|---|---|
| 4.1.13.12、4.1.13.65 | Windows 4.1.x | 已入库为回归样本,`tests/test_crossver.py` 每次都能复跑 |
| 4.1.12.55、4.1.15.11 | Windows 4.1.x | 早期版本在实机上人工验证过;仓库里没有留存这两个 DLL,本机无法复跑,因此只标为"历史实测" |
| 其他 4.1.x 小版本 | Windows | 按同一套结构规律自动适配(定位不吃写死地址) |
| 4.0.x 及更早 | — | 未验证,官方已不提供更早的安装包 |
| 3.x、网页版、手机版 | — | 不支持 |
定位失败时工具拒绝写入并在日志说明原因,不会把颜色写到随机位置。
## 快速开始
### 环境要求
- Windows 操作系统
- 已安装 PC 微信 4.x
- Python 3.x(可选,用于直接运行源码版)
### 安装运行
**方式一:使用打包好的 exe(推荐)**
从 GitHub Release 下载 `wechat-skin-2.9.0-onefile.exe`(11,745,363 字节,SHA-256 `9c9371b98e6598741a4516856084c833f12bd263bcea13cae1644bcbc152a24f`),双击即可运行,无需安装 Python;同页还有 `wechat-skin-2.9.0-folder.zip`(文件夹版,程序加 `_internal`,功能一样)和 `SHA256SUMS.txt`。蓝奏云 (提取码 `frxt`)是较早一次构建的副本,只差两处提示文案。注意 PyInstaller 产物**不是字节可复现的**,你自己重打包得到的哈希必然与上面不同,这不是版本错了。
**方式二:运行 Python 脚本**
```bash
# 零依赖单文件版(tkinter)
python skin/wechat_skin_v2.py
# PySide6 界面(需安装依赖)
pip install PySide6-Essentials
python skin/wechat_skin_qt.py # 标准版
python skin/wechat_skin_gf.py # 粉色版(女生专属主题)
```
### 使用方法
1. 双击 exe 或运行 Python 脚本
2. 工具自动找到微信安装目录,状态栏显示「已定位 · 版本号」和七个地址即就绪
3. 主题列表单击预览、双击或点【应用】换肤
4. 换完自动重启微信(需重新扫码登录)
### 命令行用法
```bash
python skin/wechat_skin_v2.py 深海蓝 # 应用「深海蓝」主题
python skin/wechat_skin_v2.py 原版 # 还原为原版配色
```
## 依赖
| 场景 | 依赖 | 说明 |
|---|---|---|
| 单文件版 / 发行 exe | 无 | 只用 Python 标准库 + tkinter(Windows 上的 Python 自带) |
| PySide6 两套界面 | `pip install PySide6-Essentials` | 界面只用到 QtCore / QtGui / QtWidgets,不必装完整 PySide6 |
| 自行打包 exe | `pip install pyinstaller` | 打包配方已收录在 `skin/微信整套皮肤 v2.9.0.spec` |
- 全程**不联网**,不上传任何数据,不写注册表(微信安装路径只做只读查询)
- 不依赖任何第三方 DLL,不携带额外运行库
- 需要对该微信目录有写权限;装在 `Program Files` 下时以管理员身份运行
## 技术原理
### 颜色常量布局
- 结构标记 `01 00 00 00 03 00 00 00`,颜色按 `FF BB GG RR` 存放
- 背景区:置顶 → 列表 → 聊天 依次相隔 48 字节,导航栏在聊天区 +720
- 气泡区:发送气泡在聊天区 +11760,接收气泡在发送 +48,发送气泡 +0x90 处是微信品牌绿
- 选中高亮:聊天区 +144
- 品牌绿 `(0,195,117)` 与同组近灰组件 `(233,233,237)` 永不参与换肤,因此用作跨版本反推的锚点
### 为什么不会改错地方
- 定位靠结构与颜色特征,不靠写死的文件地址;三条互相独立的途径分级采信:原版色签名 → 微信品牌绿锚点 → 背景浅色链
- 签名途径从文件自身量出间距,微信改版不失效
- 只剩启发式线索时**直接拒绝写入**
- 地址越界、结构失效、文件只读同样一律拒写
- 写完回读比对,不一致明确报错
- 首次运行按版本校验后备份原版 DLL,可随时还原
### 安全机制
- **三道闸门**:未定位成功、微信未退出、还原取消时一律不动 DLL
- **写入校验**:写完回读比对,不一致明确报错
- **自动备份**:首次运行按版本备份原版 DLL,支持一键还原
- **进程保护**:进程操作全部带超时且失败即停
## 项目结构
```
wechat-skin/
├── skin/
│ ├── wechat_skin_v2.py # 零依赖单文件版(tkinter)+ 换肤引擎
│ ├── wechat_skin_qt.py # PySide6 标准版
│ ├── wechat_skin_gf.py # PySide6 粉色版(女生主题)
│ ├── 使用说明.md # 详细使用说明
│ ├── app.ico # 应用图标
│ └── girlfriend.ico # 粉色版图标
├── tests/ # 回归套件(只读或全桩,绝不碰真 DLL)
│ ├── test_locate.py # 定位与写入闸门
│ ├── test_crossver.py # 跨版本自适应(真样本 + 合成变体)
│ ├── test_gui.py # tkinter 界面冒烟
│ └── test_qt.py # PySide6 两套界面冒烟
├── .github/workflows/ # build-windows-exe.yml:GitHub Actions 在 Windows runner 上打包并发布 Release 附件
├── LICENSE # 开源协议
└── README.md # 本文件
```
`tests/test_crossver.py` 需要真实的 `Weixin.dll` 样本,缺样本的用例记为 SKIP 不算失败;把某个版本的 DLL 放进 `skin/samples/<版本>/` 即自动纳入回归(该目录被 git 忽略,不会误传)。
## 开源文件说明
- **本仓库全部代码与文档**(产品代码、测试、说明):木兰宽松许可证 第 2 版(Mulan PSL v2),全文见 [LICENSE](LICENSE)。该许可证中英双语表述、两版同等法律效力,冲突时以中文版为准。版权与授权声明如下,已写入 `skin/` 各源文件的头部注释:
```
Copyright (c) 2026 yuz_cn
微信整套皮肤 (wechat-skin) is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND.
```
- **第三方组件**(各自遵循自身许可,本仓库不打包、不分发):
- `PySide6-Essentials` / `shiboken6` —— LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only(Qt 官方另提供商业授权)
- `PyInstaller` —— GPLv2-or-later,附官方例外条款:允许用它构建并分发非自由软件
- 「微软雅黑 / Microsoft YaHei」字体由 Windows 系统提供,界面只按字体名引用,仓库不含字体文件
- **微信本体**:`Weixin.dll` 及微信全部著作权与商标归深圳市腾讯计算机系统有限公司。本仓库**不包含也不传播**微信的任何文件;改色只发生在用户本机已有的微信安装上,且随时可用原版备份还原
- **合规**:使用时请遵守相关法律法规与软件许可协议
## 版本历史
| 版本 | 说明 |
|------|------|
| v2.9.0 | 两条并行开发线合并为一套引擎(三途径分级定位 + 第七区域「选中高亮」+ 女生主题);写入侧三道闸门与还原回读校验;进程操作全部带超时且失败即停;PySide6 两套界面同样补齐闸门 |
| v2.8.0 | 新增第 7 换肤区域「选中高亮」;粉色版(6 套女生主题 + 奶油粉 UI + 吸色);PySide6 界面 |
| v2.7.2 | 兼容新版主程序名 `WeChat.exe`(修复「未找到 Weixin.exe」) |
| v2.7.1 | 双途径交叉定位(背景浅色链 + 微信品牌绿锚点),修复彩色主题二次换肤「气泡变色、背景不变」 |
| v2.6.5 | 自动定位 + 气泡定位 + 日志系统 |
## 注意事项
- 仅限个人学习与界面美化使用,请勿用于商业用途
- 微信自更新会覆盖改色,重新应用一次即可
- 不要用它冒充官方界面或误导他人