brunph/dobf-rs
GitHub: brunph/dobf-rs
dobf 是一个基于 Rust 的二进制补丁工具,通过 TOML 配置定义模式匹配规则来自动化处理代码混淆和指令优化。
Stars: 0 | Forks: 0
# dobf
**dobf** 是一个二进制补丁工具,主要用于处理代码混淆。\
目前的功能包括:
- Nop 指令优化(90 90 变为 66 90 等等)
- 快速模式匹配
- 通过 [`toml`](https://toml.io/en/) 配置文件轻松配置
# 构建
```
git clone https://github.com/brunph/dobf-rs.git
cargo build --release
```
# 用法
**dobf** 使用 [`toml`](https://toml.io/en/) 来指定要执行的补丁类型。以下是一个此类补丁的示例。
```
name = "example"
[obfret]
# asm:
# lea rsp, [rsp+0x8]
# jmp qword [rsp-0x8]
# ->
# ret
pattern = "48 8D 64 24 08 FF 64 24 F8"
patch = "C3 90 90 90 90 90 90 90 90" # adding these nops are optional, but a good way to get rid of the remaining junk after the patch
order = 0 # optional; defaults to 0. Use it to control the order of multiple transforms
```
然后只需运行你编译好的 **dobf** 版本即可
```
dobf.exe -i test.asm -c example.toml
```
## 内置补丁执行程序
创建一个独立的补丁工具,其 TOML 配置直接内置在可执行文件中:
```
dobf.exe --config example.toml --create-patcher example-patcher.exe
```
生成的可执行文件在运行时不再需要 `example.toml`:
```
example-patcher.exe --input target.exe --output target-patched.exe
```
应用程序可以通过库 API 生成补丁工具。第一个参数是已编译的 `dobf` 可执行文件,用作特定平台的模板:
```
use dobf::create_embedded_patcher;
create_embedded_patcher("dobf.exe", "example.toml", "example-patcher.exe")?;
```
该模板决定了生成程序的操作系统和架构。附加配置会使现有的可执行文件签名失效,因此请在创建后对生成的可执行文件进行签名。
### 修改前

### 修改后

# 待办事项
- 添加序列化输出功能(能够将所有补丁写入文件,以便随后读入任何选择的程序中)
- 嵌套匹配以提高准确性
- 通过使用 [`regex`](https://github.com/rust-lang/regex) 改进模式匹配
标签:Python安全, Rust, 二进制补丁, 代码优化, 去混淆, 可视化界面, 模式匹配, 汇编, 网络流量审计, 自动化资产收集, 通知系统, 默认DNS解析器