AkashaCorporation/hexcore-souper
GitHub: AkashaCorporation/hexcore-souper
基于 Z3 SMT 求解的 LLVM IR 超级优化器,为 Remill→Souper→Helix 反编译 pipeline 提供语义等价简化能力。
Stars: 1 | Forks: 0
# hexcore-souper
LLVM IR 超级优化器,适用于 HexCore —— 由 [Google Souper](https://github.com/google/souper) 和 Z3 SMT 求解驱动。
属于 [HikariSystem HexCore](https://github.com/AkashaCorporation/HikariSystem-HexCore) 逆向工程 IDE 的一部分。
## 流程
```
machine code → Remill (lift) → Souper (optimize) → Helix (decompile)
```
Souper 接收 Remill 提升生成的 LLVM IR,并使用 SMT 求解(Z3)寻找语义等价但更简洁的指令序列,以提升 Helix 反编译器输出质量。
## API
```
const { SouperOptimizer } = require('hexcore-souper');
const optimizer = new SouperOptimizer();
// Synchronous
const result = optimizer.optimize(llvmIrText, {
maxCandidates: 1000,
timeoutMs: 30000,
aggressiveMode: false,
});
// Asynchronous (for large IR)
const result = await optimizer.optimizeAsync(llvmIrText);
console.log(result.success); // boolean
console.log(result.ir); // optimized LLVM IR text
console.log(result.candidatesFound); // number
console.log(result.candidatesReplaced); // number
console.log(result.optimizationTimeMs); // number
optimizer.close();
```
## 构建
需要预编译依赖(LLVM 18、Z3、Souper)。请参考 `deps/` 结构。
```
npm run build # node-gyp rebuild
npm run build:debug # node-gyp rebuild --debug
npm test # smoke tests
```
## 许可证
MIT
标签:C++ 绑定, Google Souper, Helix, HexCore, IDE 插件, LLVM IR, MITM代理, Node.js 原生插件, npm 模块, Remill, SMT 求解, URL提取, Z3, 云资产清单, 代码简化, 反编译, 可配置连接, 性能优化, 指令优化, 机器码提升, 检测绕过, 程序分析, 语义等价, 超级优化器, 逆向工程