"软件开发中的大量缺陷源于程序员未能完全理解其代码 可能执行到的所有状态。" -- John Carmack
"它能运行《毁灭战士》吗?" -- https://canitrundoom.org/
Oneiromancer 是一款逆向工程辅助工具,它使用本地运行的、针对 Hex-Rays 伪代码微调过的 LLM 来辅助代码分析。它可以分析一个函数或较小的代码片段,并根据分析结果返回代码功能的高级描述、建议的函数名以及变量重命名建议。

mistral-7b-instruct。analyze_code 或 analyze_file 来分析伪代码,并处理分析结果。获取最新版本最简单的方式是通过 crates.io:
cargo install oneiromancer
要将其作为库安装,请在项目目录中运行以下命令:
cargo add oneiromancer
或者,你也可以从源代码进行构建:
git clone https://github.com/0xdea/oneiromancer
cd oneiromancer
cargo build --release
wget https://huggingface.co/AverageBusinessUser/aidapal/resolve/main/aidapal-8k.Q4_K_M.gguf
wget https://huggingface.co/AverageBusinessUser/aidapal/resolve/main/aidapal.modelfile
ollama create aidapal -f aidapal.modelfile
ollama list
export OLLAMA_BASEURL=custom_baseurl # if not set, the default will be used
export OLLAMA_MODEL=custom_model # if not set, the default will be used
oneiromancer <target_file>.c
<target_file>.out.c 中查找改进后的伪代码:
vim <target_file>.out.c
code <target_file>.out.c
[!TIP] 为获得最佳效果,请一次提交一个函数供 LLM 分析。
已在以下平台使用 Ollama 0.32.9 测试:
aidapal <3