A Python library for handling 1337 format patch files
Project description
patcher1337
一个用于处理1337格式补丁文件的Python库。
关于.1337补丁格式
.1337是x64dbg调试器使用的补丁格式。补丁文件中的地址是相对虚拟地址(RVA),需要转换为文件偏移才能应用到目标文件。
补丁文件格式:
>target.dll # 目标文件名
1000:74->EB # 格式: RVA:原始值->新值
1001:0F->90 # RVA是x64dbg中显示的地址
安装
pip install patcher1337
使用示例
基本使用
from patcher1337 import Patcher1337
patcher = Patcher1337()
result = patcher.apply_patch(
patch_file="example.1337",
target_file="target.dll"
)
批量处理
patcher = Patcher1337(debug=True)
results = patcher.batch_patch(
patch_files=["patch1.1337", "patch2.1337"],
target_files=["file1.dll", "file2.dll"],
offsets=[True, False] # True表示使用x64dbg的RVA偏移(0xC00)
)
错误处理
try:
patcher.apply_patch(...)
except InvalidPatchFile as e:
print(f"补丁文件格式错误: {e}") # 补丁文件格式不符合.1337规范
except PatchVerificationError as e:
print(f"补丁验证失败: {e}") # 补丁应用后验证失败,可能是文件被修改
except PatchError as e:
print(f"补丁处理错误: {e}") # 其他补丁相关错误
许可证
本项目采用 MIT 许可证。详见 LICENSE 文件。
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
patcher1337-1.0.0.tar.gz
(7.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file patcher1337-1.0.0.tar.gz.
File metadata
- Download URL: patcher1337-1.0.0.tar.gz
- Upload date:
- Size: 7.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4ca7cb28507b376127d518011e13060b2c3bc8e4c8f64ec6b5001680c693e450
|
|
| MD5 |
2ba5127d95ca4372efab82a305889554
|
|
| BLAKE2b-256 |
9418ea7f72371ebb7294e5011bdf837d5288c498737213a76b200ab7537e18a6
|
File details
Details for the file patcher1337-1.0.0-py3-none-any.whl.
File metadata
- Download URL: patcher1337-1.0.0-py3-none-any.whl
- Upload date:
- Size: 8.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6e66ae6d9dc1e470d2d2e53d0395cd26d2184865c40dac2bb35cefa05aba5f02
|
|
| MD5 |
ac4f9f5c420427ee2d6137f5ec147b14
|
|
| BLAKE2b-256 |
da5d283149346c0f049ddd6efbb2ca9637539c2bd2621084ed892a69193b0b76
|