[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-amruth-sn--kong":3,"tool-amruth-sn--kong":61},[4,18,26,36,44,53],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":17},4358,"openclaw","openclaw\u002Fopenclaw","OpenClaw 是一款专为个人打造的本地化 AI 助手，旨在让你在自己的设备上拥有完全可控的智能伙伴。它打破了传统 AI 助手局限于特定网页或应用的束缚，能够直接接入你日常使用的各类通讯渠道，包括微信、WhatsApp、Telegram、Discord、iMessage 等数十种平台。无论你在哪个聊天软件中发送消息，OpenClaw 都能即时响应，甚至支持在 macOS、iOS 和 Android 设备上进行语音交互，并提供实时的画布渲染功能供你操控。\n\n这款工具主要解决了用户对数据隐私、响应速度以及“始终在线”体验的需求。通过将 AI 部署在本地，用户无需依赖云端服务即可享受快速、私密的智能辅助，真正实现了“你的数据，你做主”。其独特的技术亮点在于强大的网关架构，将控制平面与核心助手分离，确保跨平台通信的流畅性与扩展性。\n\nOpenClaw 非常适合希望构建个性化工作流的技术爱好者、开发者，以及注重隐私保护且不愿被单一生态绑定的普通用户。只要具备基础的终端操作能力（支持 macOS、Linux 及 Windows WSL2），即可通过简单的命令行引导完成部署。如果你渴望拥有一个懂你",349277,3,"2026-04-06T06:32:30",[13,14,15,16],"Agent","开发框架","图像","数据工具","ready",{"id":19,"name":20,"github_repo":21,"description_zh":22,"stars":23,"difficulty_score":10,"last_commit_at":24,"category_tags":25,"status":17},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,"2026-04-05T11:01:52",[14,15,13],{"id":27,"name":28,"github_repo":29,"description_zh":30,"stars":31,"difficulty_score":32,"last_commit_at":33,"category_tags":34,"status":17},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",151314,2,"2026-04-11T23:32:58",[14,13,35],"语言模型",{"id":37,"name":38,"github_repo":39,"description_zh":40,"stars":41,"difficulty_score":32,"last_commit_at":42,"category_tags":43,"status":17},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",108322,"2026-04-10T11:39:34",[14,15,13],{"id":45,"name":46,"github_repo":47,"description_zh":48,"stars":49,"difficulty_score":32,"last_commit_at":50,"category_tags":51,"status":17},6121,"gemini-cli","google-gemini\u002Fgemini-cli","gemini-cli 是一款由谷歌推出的开源 AI 命令行工具，它将强大的 Gemini 大模型能力直接集成到用户的终端环境中。对于习惯在命令行工作的开发者而言，它提供了一条从输入提示词到获取模型响应的最短路径，无需切换窗口即可享受智能辅助。\n\n这款工具主要解决了开发过程中频繁上下文切换的痛点，让用户能在熟悉的终端界面内直接完成代码理解、生成、调试以及自动化运维任务。无论是查询大型代码库、根据草图生成应用，还是执行复杂的 Git 操作，gemini-cli 都能通过自然语言指令高效处理。\n\n它特别适合广大软件工程师、DevOps 人员及技术研究人员使用。其核心亮点包括支持高达 100 万 token 的超长上下文窗口，具备出色的逻辑推理能力；内置 Google 搜索、文件操作及 Shell 命令执行等实用工具；更独特的是，它支持 MCP（模型上下文协议），允许用户灵活扩展自定义集成，连接如图像生成等外部能力。此外，个人谷歌账号即可享受免费的额度支持，且项目基于 Apache 2.0 协议完全开源，是提升终端工作效率的理想助手。",100752,"2026-04-10T01:20:03",[52,13,15,14],"插件",{"id":54,"name":55,"github_repo":56,"description_zh":57,"stars":58,"difficulty_score":10,"last_commit_at":59,"category_tags":60,"status":17},4487,"LLMs-from-scratch","rasbt\u002FLLMs-from-scratch","LLMs-from-scratch 是一个基于 PyTorch 的开源教育项目，旨在引导用户从零开始一步步构建一个类似 ChatGPT 的大型语言模型（LLM）。它不仅是同名技术著作的官方代码库，更提供了一套完整的实践方案，涵盖模型开发、预训练及微调的全过程。\n\n该项目主要解决了大模型领域“黑盒化”的学习痛点。许多开发者虽能调用现成模型，却难以深入理解其内部架构与训练机制。通过亲手编写每一行核心代码，用户能够透彻掌握 Transformer 架构、注意力机制等关键原理，从而真正理解大模型是如何“思考”的。此外，项目还包含了加载大型预训练权重进行微调的代码，帮助用户将理论知识延伸至实际应用。\n\nLLMs-from-scratch 特别适合希望深入底层原理的 AI 开发者、研究人员以及计算机专业的学生。对于不满足于仅使用 API，而是渴望探究模型构建细节的技术人员而言，这是极佳的学习资源。其独特的技术亮点在于“循序渐进”的教学设计：将复杂的系统工程拆解为清晰的步骤，配合详细的图表与示例，让构建一个虽小但功能完备的大模型变得触手可及。无论你是想夯实理论基础，还是为未来研发更大规模的模型做准备",90106,"2026-04-06T11:19:32",[35,15,13,14],{"id":62,"github_repo":63,"name":64,"description_en":65,"description_zh":66,"ai_summary_zh":66,"readme_en":67,"readme_zh":68,"quickstart_zh":69,"use_case_zh":70,"hero_image_url":71,"owner_login":72,"owner_name":73,"owner_avatar_url":74,"owner_bio":75,"owner_company":76,"owner_location":76,"owner_email":76,"owner_twitter":77,"owner_website":78,"owner_url":79,"languages":80,"stars":97,"forks":98,"last_commit_at":99,"license":100,"difficulty_score":101,"env_os":102,"env_gpu":103,"env_ram":104,"env_deps":105,"category_tags":118,"github_topics":119,"view_count":32,"oss_zip_url":76,"oss_zip_packed_at":76,"status":17,"created_at":123,"updated_at":124,"faqs":125,"releases":152},6766,"amruth-sn\u002Fkong","kong","The world's first agentic reverse engineer.","Kong 是全球首款具备自主代理能力的逆向工程工具，专为自动化分析二进制文件而设计。在传统逆向工作中，即使面对只有几百个函数的程序，人工还原被剥离的函数名、类型信息和变量含义往往需要耗费数小时甚至数天。Kong 通过智能编排大语言模型（LLM），将这一繁琐过程完全自动化。\n\n它解决了去符号化二进制文件缺乏可读上下文的核心痛点。Kong 并非简单地将反编译代码丢给 AI，而是先利用 Ghidra 构建丰富的上下文窗口（包含调用图、交叉引用和数据流），按依赖顺序自底向上分析，确保每个函数都能利用已解析的调用信息。此外，它还内置了独特的代理级去混淆流水线，能自动识别标准库函数并统一命名规范，最终输出带有清晰语义的高质量分析结果。\n\n这款工具特别适合安全研究人员、逆向工程师以及需要深入分析恶意软件或闭源二进制文件的开发者。其技术亮点在于“进程内”集成 Ghidra 引擎，无需额外服务器即可直接操作程序数据库，同时通过语法标准化和语义合成技术，显著提升了 AI 推断的准确性与效率，让复杂的逆向任务变得高效且可控。","\u003Cdiv align=\"left\">\n\n\n# Kong: The Agentic Reverse Engineer\n\n![PyPI - Version](https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fv\u002Fkong-re)\n![X (formerly Twitter) URL](https:\u002F\u002Fimg.shields.io\u002Ftwitter\u002Furl?url=https%3A%2F%2Fx.com%2F0xamruth)\n\n\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Famruth-sn_kong_readme_d35e08407409.png\" alt=\"Kong: World's first AI reverse engineer\" width=\"50%\">\n\n**LLM orchestration for reverse engineering binaries** \u003Cbr \u002F>\n\n\u003C\u002Fdiv>\n\n## What is Kong?\nMost tasks follow a linear relationship: the more difficult a task, the longer it usually takes. Reverse engineering (and binary analysis) is a task in which the actual difficulty is somewhat trivial, but the time-to-execute can be on the order of hours (and days!), even for a binary with a couple hundred functions.   \n\nKong automates the mechanical layer, using an NSA-grade reverse engineering framework. Kong can take a fully obfuscated, stripped binary and run a full analysis pipeline: triaging functions, building call-graph context, recovering types and symbols through LLM-guided decompilation, and writing the results back into Ghidra's program database. The output is a binary where some `FUN_00401a30` is now `parse_http_header`, with recovered structs, parameter names, and calling conventions.\n\n**Why this exists**\n\nStripped binaries lose all the context that makes code readable: function names, type information, variable names, struct layouts. Recovering that context is the bulk of the work in most RE tasks, and it's largely pattern matching: recognizing standard library functions, inferring types from usage, propagating names through call graphs.\n\nLLMs are good at exactly this kind of pattern matching. But pointing an LLM at raw decompiler output and asking \"what does this do?\" gives you mediocre results. The model lacks calling context, cross-reference information, and the broader picture of how the binary is structured. In addition, most obfuscated binaries introduce extreme techniques in order to prevent reverse engineering.\n\nKong solves this by building rich context windows from Ghidra's program analysis (call graphs, cross-references, string references, data flow) before ever touching the LLM, then orchestrating the analysis in dependency order so each function benefits from its callees already being named. Additionally, Kong introduces its own, first-of-its-kind, agentic deobfuscation pipeline.\n\n## In Action\n\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Famruth-sn_kong_readme_d3beb5780cbd.png\" alt=\"Kong: World's first AI reverse engineer\" width=\"100%\">\n\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Famruth-sn_kong_readme_4809007c0ada.gif\" alt=\"Kong: World's first AI reverse engineer\" width=\"100%\">\n\n## Features\n\n- **Fully Autonomous Pipeline**: A single command runs the complete analysis. Triage, function analysis, cleanup, semantic synthesis, and export. No manual intervention required.\n- **In-Process Ghidra Integration**: Runs Ghidra's analysis engine in-process via PyGhidra and JPype. No server, no RPC, no subprocess overhead. Direct access to the program database.\n- **Call-Graph-Ordered Analysis**: Functions are analyzed bottom-up from the call graph. Leaf functions are named first, so callers benefit from already-resolved context in their decompilation.\n- **Rich Context Windows**: Each LLM prompt includes the target function's decompilation plus cross-references, string references, caller\u002Fcallee signatures, and neighboring data; not just raw decompiler output in isolation.\n- **Semantic Synthesis**: A post-analysis pass that unifies naming conventions across the binary, synthesizes struct definitions from field access patterns, and resolves inconsistencies between independently analyzed functions.\n- **Signature Matching**: Known standard library and cryptographic functions are identified by pattern before LLM analysis, skipping expensive inference for functions with known identities.\n- **Syntactic Normalization**: Decompiler output is cleaned up (modulo recovery, negative literal reconstruction, dead assignment removal) before reaching the LLM, reducing noise and token waste. \n- **Agentic Deobfuscation**: Kong uses an agentic deobfuscation pipeline which can identify and remove obfuscation techniques (Control flow flattening, bogus control flow, instruction substitution, string encryption, VM protection, etc.) from the decompiler output.\n- **Eval Framework**: Built-in evaluation harness that scores analysis output against ground-truth source code, measuring symbol accuracy (word-based Jaccard) and type accuracy (signature component scoring).\n- **Multi-Provider LLM Support**: Works with Anthropic (Claude) and OpenAI (GPT-4o) out of the box. An interactive setup wizard configures providers and smart routing auto-selects whichever has a valid key.\n- **Cost-Tracking**: Tracks token usage and costs per model across providers, with provider-aware pricing.\n\n## Supported Architectures\n\nKong works with most Ghidra-decompilable binaries (for now, more to come).\n\n#### Confidence\n\n| | C | C++ | Go | Rust |\n|---|---|---|---|---|\n| x86 | High | High | Medium | Medium |\n| x86-64 | High | High | Medium | Medium |\n| ARM (32-bit) | High | High | Medium | Low |\n| AArch64 | High | High | Medium | Low |\n| MIPS | Medium | Medium | Low | Low |\n| PowerPC | Medium | Medium | Low | Low |\n\n**High**: Kong reliably decompiles, deobfuscates, and recovers names, types, and structure.\n\n**Medium**: Decompilation is usable but noisier. Expect partial recovery and lower confidence scores.\n\n**Low**: Decompilation has significant gaps and results will stay incomplete, noisy, or unreadable.\n\n**Note**: Binary size scales positively with function count, LLM cost, and time to completion. However, binary size also scales negatively with confidence, so keep this in mind when analyzing larger binaries.\n\n## Architecture\n\nKong uses a five-phase pipeline orchestrated by a supervisor that coordinates triage, parallel analysis, and post-processing:\n\n```\n                    ┌──────────────────────┐\n                    │       Triage         │\n                    │  enumerate, classify,│\n                    │  build call graph,   │\n                    │  match signatures    │\n                    └──────────┬───────────┘\n                               │\n                               ▼\n              ┌────────────────┼────────────────┐\n              │                │                │\n              ▼                ▼                ▼\n     ┌──────────────┐ ┌──────────────┐ ┌──────────────┐\n     │   Analyze    │ │   Analyze    │ │     ...      │\n     │  (leaf fns)  │ │ (next tier)  │ │              │\n     └──────┬───────┘ └──────┬───────┘ └──────┬───────┘\n            │                │                │\n            └────────┬───────┴────────────────┘\n                     │\n                     ▼\n            ┌──────────────────────┐\n            │      Cleanup         │\n            │  normalize, dedupe   │\n            └──────────┬───────────┘\n                       │\n                       ▼\n            ┌──────────────────────┐\n            │     Synthesis        │\n            │  unify names, build  │\n            │  structs, deobfuscate│\n            └──────────┬───────────┘\n                       │\n                       ▼\n            ┌──────────────────────┐\n            │       Export         │\n            │  analysis.json +     │\n            │  Ghidra writeback    │\n            └──────────────────────┘\n```\n\n### How it works\n\n**Triage** enumerates all functions in the binary, classifies them by size (trivial \u002F small \u002F medium \u002F large), builds the call graph, detects the source language, and runs signature matching against known standard library and crypto functions. Functions matched by signature are marked as resolved and skip LLM analysis entirely.\n\n**Analysis** processes functions in bottom-up order from the call graph using a work queue. For each function, Kong builds a context window from Ghidra's program database — decompilation, cross-references, string references, and the signatures of already-analyzed callees — normalizes the decompiler output, and sends it to the LLM for name, type, and parameter recovery. If obfuscation is detected in a function's decompilation, Kong runs an agentic deobfuscation pass with symbolic tool access before producing the analysis. Results are written back to Ghidra immediately so downstream callers see updated names.\n\n**Cleanup** unifies struct types from proposals accumulated during analysis and retries any function signatures that failed to apply during the analysis pass.\n\n**Synthesis** takes a global view across all analyzed functions. A single LLM call reviews the most-connected functions, unifies naming conventions, synthesizes struct definitions from field access patterns, and refines names that look inconsistent in the broader context.\n\n**Export** writes the final `analysis.json` and applies all recovered names, types, and signatures back to the Ghidra program database.\n\n## Stack\n\n- **Runtime**: Python 3.11+, managed with [uv](https:\u002F\u002Fgithub.com\u002Fastral-sh\u002Fuv)\n- **Binary analysis**: [Ghidra](https:\u002F\u002Fghidra-sre.org\u002F) via [PyGhidra](https:\u002F\u002Fgithub.com\u002FNationalSecurityAgency\u002Fghidra\u002Ftree\u002Fmaster\u002FGhidra\u002FFeatures\u002FPyGhidra) (in-process, JPype)\n- **LLM**: [Anthropic SDK](https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fanthropic-sdk-python) (Claude) and [OpenAI SDK](https:\u002F\u002Fgithub.com\u002Fopenai\u002Fopenai-python) (GPT-4o)\n- **Symbolic analysis**: [z3-solver](https:\u002F\u002Fgithub.com\u002FZ3Prover\u002Fz3)\n- **CLI**: [Click](https:\u002F\u002Fclick.palletsprojects.com\u002F)\n- **TUI**: [Textual](https:\u002F\u002Ftextual.textualize.io\u002F)\n- **Display**: [Rich](https:\u002F\u002Frich.readthedocs.io\u002F)\n- **Build**: [hatchling](https:\u002F\u002Fhatch.pypa.io\u002F)\n- **Testing**: [pytest](https:\u002F\u002Fpytest.org\u002F)\n\n## Setup\n\n### Prerequisites\n\n- **Python 3.11+** — ([python.org](https:\u002F\u002Fwww.python.org\u002Fdownloads\u002F) or your system package manager)\n- **uv** — Python package manager ([Install uv](https:\u002F\u002Fdocs.astral.sh\u002Fuv\u002Fgetting-started\u002Finstallation\u002F))\n- **Ghidra** — The National Security Agency's reverse engineering framework ([Install Ghidra](https:\u002F\u002Fghidra-sre.org\u002FInstallationGuide.html))\n- **JDK 21+** — Required by Ghidra ([Adoptium](https:\u002F\u002Fadoptium.net\u002F))\n- **LLM API key** — At least one of:\n  - [Anthropic](https:\u002F\u002Fconsole.anthropic.com\u002Fsettings\u002Fkeys) (Claude)\n  - [OpenAI](https:\u002F\u002Fplatform.openai.com\u002Fapi-keys) (GPT-4o)\n\n### Quick Start\n\n```bash\n# 1. Install Kong\nuv pip install kong-re\n\n# 2. Set your API key(s)\nexport ANTHROPIC_API_KEY=\"sk-ant-...\"\n# and\u002For\nexport OPENAI_API_KEY=\"sk-...\"\n\n# 3. Run the setup wizard (first time only)\nkong setup\n\n# 4. Analyze a binary\nkong analyze .\u002Fpath\u002Fto\u002Fstripped_binary\n```\n\nThe setup wizard lets you pick which LLM providers to use and sets a default. Kong auto-detects your Ghidra and JDK installations, loads the binary into an in-process Ghidra instance, and runs the full pipeline.\n\n#### From source\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Famruth-sn\u002Fkong.git\ncd kong\nuv sync\nuv run kong setup\nuv run kong analyze .\u002Fpath\u002Fto\u002Fstripped_binary\n```\n\n### Environment Variables\n\n| Variable | Required | Description |\n|----------|----------|-------------|\n| `ANTHROPIC_API_KEY` | At least one | Anthropic API key (Claude) |\n| `OPENAI_API_KEY` | At least one | OpenAI API key (GPT-4o) |\n| `GHIDRA_INSTALL_DIR` | No | Path to Ghidra installation (auto-detected if not set) |\n| `JAVA_HOME` | No | Path to JDK (auto-detected if not set) |\n| `KONG_CONFIG_DIR` | No | Override config directory (default: `~\u002F.config\u002Fkong`) |\n\n### Usage\n\n```bash\n# Run the setup wizard\nkong setup\n\n# Analyze a stripped binary (uses your configured default provider)\nkong analyze .\u002Fbinary\n\n# Analyze with a specific provider\nkong analyze .\u002Fbinary --provider openai\n\n# Override the model\nkong analyze .\u002Fbinary --provider openai --model gpt-4o-mini\n\n# Show binary metadata without running analysis\nkong info .\u002Fbinary\n\n# Evaluate analysis output against ground-truth source\nkong eval .\u002Fanalysis.json .\u002Fsource.c\n```\n\n### Output\n\nResults are written to the output directory (default: `.\u002Fkong_output_{binary_name}\u002F`):\n\n```\nkong_output_{binary_name}\u002F\n├── analysis.json         # All recovered function names, types, parameters\n└── events.log            # Pipeline execution trace\n```\n\n## Benchmarks\n\nKong autonomously reconstructed the full [XZ backdoor](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FXZ_Utils_backdoor) (CVE-2024-3094) kill chain from a stripped `liblzma.so.5.4.1` — identifying all five core implant functions at 90-95% confidence in 15 minutes for $6.63.\n\nSee **[BENCHMARKS.md](BENCHMARKS.md)** for the full case study and reproduction instructions.\n\n## Project Layout\n\n```\nkong\u002F\n├── __main__.py           # CLI entry point (click)\n├── config.py             # KongConfig, LLMProvider, LLMConfig\n├── db.py                 # SQLite config store (~\u002F.config\u002Fkong\u002F)\n├── banner.py             # ASCII banner, API key helpers\n├── agent\u002F\n│   ├── supervisor.py     # Pipeline orchestrator\n│   ├── triage.py         # Function enumeration + classification\n│   ├── analyzer.py       # LLM-guided function analysis\n│   ├── queue.py          # BFS work queue from call graph\n│   ├── signatures.py     # Known function signature matching\n│   ├── prompts.py        # System prompt + output schema\n│   ├── events.py         # Phase\u002Fevent types for pipeline tracing\n│   └── models.py         # FunctionResult dataclass\n├── ghidra\u002F\n│   ├── client.py         # In-process GhidraClient (PyGhidra\u002FJPype)\n│   ├── types.py          # FunctionInfo, BinaryInfo, XRef, etc.\n│   └── environment.py    # Ghidra\u002FJDK auto-detection\n├── llm\u002F\n│   ├── client.py         # AnthropicClient\n│   ├── openai_client.py  # OpenAIClient\n│   ├── usage.py          # TokenUsage, cost tracking, pricing registry\n│   └── limits.py         # Model-specific limits + rate limiter\n├── normalizer\u002F\n│   └── syntactic.py      # Decompiler output normalization\n├── synthesis\u002F\n│   └── semantic.py       # Global name unification + struct synthesis\n├── evals\u002F\n│   ├── harness.py        # Ground-truth extraction + scoring\n│   └── metrics.py        # symbol_accuracy, type_accuracy\n├── export\u002F\n│   └── source.py         # analysis.json + Ghidra writeback\n├── signatures\u002F\n│   ├── stdlib.json       # C standard library signatures\n│   └── crypto.json       # Cryptographic function signatures\n└── tui\u002F\n    └── app.py            # Textual TUI\n```\n\n## License\n\n[APACHE](LICENSE)\n\nKong is licensed under the Apache License 2.0. Kong is a free and open source project.\n\nThis license is compatible with the Ghidra license, and allows for commercial use.\n\n## Contributing\n\nIssues and feature requests are welcome via [GitHub Issues](https:\u002F\u002Fgithub.com\u002Famruth-sn\u002Fkong\u002Fissues).\n\nAlso, don't hesitate to reach out to me on [X](https:\u002F\u002Fx.com\u002F0xamruth) or [LinkedIn](https:\u002F\u002Fwww.linkedin.com\u002Fin\u002Famruthn\u002F)!\n\n## Acknowledgments\n\n- [Ghidra](https:\u002F\u002Fghidra-sre.org\u002F)\n- [PyGhidra](https:\u002F\u002Fgithub.com\u002FNationalSecurityAgency\u002Fghidra\u002Ftree\u002Fmaster\u002FGhidra\u002FFeatures\u002FPyGhidra)\n- [JPype](https:\u002F\u002Fgithub.com\u002Fjpype-project\u002Fjpype)\n- [Anthropic SDK](https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fanthropic-sdk-python)\n- [OpenAI SDK](https:\u002F\u002Fgithub.com\u002Fopenai\u002Fopenai-python)\n- [Z3](https:\u002F\u002Fgithub.com\u002FZ3Prover\u002Fz3)\n- [Textual](https:\u002F\u002Ftextual.textualize.io\u002F)\n- [Rich](https:\u002F\u002Frich.readthedocs.io\u002F)\n\nA big shoutout to [KeygraphHQ](https:\u002F\u002Fkeygraph.io\u002F)'s [Shannon](https:\u002F\u002Fgithub.com\u002FKeygraphHQ\u002Fshannon) project, which provided the inspiration for this project. My motivation was driven by replicating the same kind of pipeline that Shannon uses for its web-based pentesting tool, and adapting it for binary analysis and decompilation.\n\n---\n\nFear the monkey.\n\n---\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Famruth-sn_kong_readme_d35e08407409.png\" width=\"40\" alt=\"Kong\"> \u003Cbr \u002F>\n  \u003Cb>Kong\u003C\u002Fb>: The world's first AI reverse engineer \n\u003C\u002Fp>\n","\u003Cdiv align=\"left\">\n\n\n# Kong：智能代理型逆向工程师\n\n![PyPI - 版本](https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fv\u002Fkong-re)\n![X（原Twitter）链接](https:\u002F\u002Fimg.shields.io\u002Ftwitter\u002Furl?url=https%3A%2F%2Fx.com%2F0xamruth)\n\n\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Famruth-sn_kong_readme_d35e08407409.png\" alt=\"Kong：全球首个AI逆向工程师\" width=\"50%\">\n\n**用于二进制逆向工程的LLM编排** \u003Cbr \u002F>\n\n\u003C\u002Fdiv>\n\n## 什么是Kong？\n大多数任务都遵循线性关系：任务越难，通常所需时间越长。然而，逆向工程（以及二进制分析）却是一个看似难度不大，但执行时间却可能长达数小时甚至数天的任务，即便对于只有几百个函数的二进制文件也是如此。\n\nKong通过使用NSA级别的逆向工程框架，自动化处理其中的机械性工作。它能够接收完全混淆且已剥离符号信息的二进制文件，并运行完整的分析流程：对函数进行分类与筛选、构建调用图上下文、借助LLM引导的反编译恢复类型和符号信息，最后将结果写回Ghidra的程序数据库中。最终输出的二进制文件中，原本的`FUN_00401a30`将被重命名为`parse_http_header`，同时恢复了结构体、参数名称和调用约定等信息。\n\n**为何需要这样的工具？**\n\n剥离符号信息后的二进制文件会丢失所有使代码可读的上下文信息：函数名、类型信息、变量名、结构体布局等。在大多数逆向工程任务中，恢复这些上下文信息占据了绝大部分工作量，而这一过程本质上主要是模式匹配——识别标准库函数、根据使用情况推断类型、并通过调用图传播名称。\n\n大型语言模型恰好擅长这类模式匹配任务。然而，如果直接将原始反编译结果输入LLM并询问“这段代码的作用是什么？”，得到的结果往往并不理想。这是因为模型缺乏调用上下文、交叉引用信息以及关于二进制整体结构的全局视角。此外，许多经过混淆处理的二进制文件还会采用极端的技术手段来阻碍逆向工程。\n\nKong通过在接触LLM之前，先利用Ghidra的程序分析功能（如调用图、交叉引用、字符串引用、数据流等）构建丰富的上下文窗口，并按照依赖顺序编排分析流程，使得每个函数都能在其被调用者已被命名的情况下进行分析。除此之外，Kong还引入了其首创的智能代理式去混淆流水线。\n\n## 实际应用\n\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Famruth-sn_kong_readme_d3beb5780cbd.png\" alt=\"Kong：全球首个AI逆向工程师\" width=\"100%\">\n\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Famruth-sn_kong_readme_4809007c0ada.gif\" alt=\"Kong：全球首个AI逆向工程师\" width=\"100%\">\n\n## 功能特性\n\n- **全自主分析流水线**：只需一条命令即可完成整个分析流程。包括函数分类、功能分析、清理优化、语义合成及导出，全程无需人工干预。\n- **进程内Ghidra集成**：通过PyGhidra和JPype在进程中运行Ghidra的分析引擎，无需服务器、RPC或子进程开销，可直接访问程序数据库。\n- **调用图驱动的分析顺序**：按照调用图自底向上逐层分析函数。首先为叶子函数命名，以便调用者在反编译时能够受益于已解析的上下文。\n- **丰富的上下文窗口**：每次发送给LLM的提示信息不仅包含目标函数的反编译结果，还整合了交叉引用、字符串引用、调用者\u002F被调用者签名以及邻近数据等内容，而非孤立的原始反编译输出。\n- **语义合成**：在分析完成后，统一整个二进制中的命名规范，根据字段访问模式合成结构体定义，并解决独立分析函数之间存在的不一致性问题。\n- **签名匹配**：在LLM分析之前，先通过模式匹配识别已知的标准库函数和加密函数，从而跳过对已知函数的身份推断，节省计算资源。\n- **语法规范化**：在反编译结果进入LLM之前，对其进行清理（如恢复模运算、修复负字面量、移除无效赋值等操作），以减少噪声和不必要的Token消耗。\n- **智能代理式去混淆**：Kong采用智能代理式的去混淆流水线，能够从反编译结果中识别并移除各种混淆技术（如控制流平坦化、虚假控制流、指令替换、字符串加密、虚拟机保护等）。\n- **评估框架**：内置评估工具，可根据真实源代码对分析结果进行打分，衡量符号准确率（基于词级Jaccard指数）和类型准确率（基于签名组件评分）。\n- **多模型支持**：开箱即用，兼容Anthropic（Claude）和OpenAI（GPT-4o）。交互式设置向导可配置不同提供商，并根据是否有有效密钥自动选择最优模型。\n- **成本追踪**：跨不同提供商跟踪各模型的Token使用量及费用，并提供针对不同提供商的价格信息。\n\n## 支持的架构\n\n目前，Kong适用于大多数可由Ghidra反编译的二进制文件（未来还将支持更多架构）。\n\n#### 分析信心等级\n\n| | C | C++ | Go | Rust |\n|---|---|---|---|---|\n| x86 | 高 | 高 | 中 | 中 |\n| x86-64 | 高 | 高 | 中 | 中 |\n| ARM（32位） | 高 | 高 | 中 | 低 |\n| AArch64 | 高 | 高 | 中 | 低 |\n| MIPS | 中 | 中 | 低 | 低 |\n| PowerPC | 中 | 中 | 低 | 低 |\n\n**高**：Kong能够可靠地完成反编译、去混淆，并成功恢复函数名、类型和程序结构。\n**中**：反编译结果可用，但噪声较大，预计只能部分恢复，置信度较低。\n**低**：反编译结果存在显著缺失，分析结果将保持不完整、噪声过多或难以阅读。\n**注**：二进制文件的大小与函数数量、LLM成本及完成时间呈正相关，但同时也与分析置信度呈负相关。因此，在分析大型二进制文件时，请务必考虑这一点。\n\n## 架构\n\nKong 使用由监督器协调的五阶段流水线，负责分诊、并行分析和后处理：\n\n```\n                    ┌──────────────────────┐\n                    │       Triage         │\n                    │  枚举、分类、      │\n                    │  构建调用图、      │\n                    │  匹配签名          │\n                    └──────────┬───────────┘\n                               │\n                               ▼\n              ┌────────────────┼────────────────┐\n              │                │                │\n              ▼                ▼                ▼\n     ┌──────────────┐ ┌──────────────┐ ┌──────────────┐\n     │   Analyze    │ │   Analyze    │ │     ...      │\n     │  (leaf fns)  │ │ (next tier)  │ │              │\n     └──────┬───────┘ └──────┬───────┘ └──────┬───────┘\n            │                │                │\n            └────────┬───────┴────────────────┘\n                     │\n                     ▼\n            ┌──────────────────────┐\n            │      Cleanup         │\n            │  规范化、去重      │\n            └──────────┬───────────┘\n                       │\n                       ▼\n            ┌──────────────────────┐\n            │     Synthesis        │\n            │  统一命名、构建    │\n            │  结构体、去混淆    │\n            └──────────┬───────────┘\n                       │\n                       ▼\n            ┌──────────────────────┐\n            │       Export         │\n            │  analysis.json +     │\n            │  Ghidra 写回       │\n            └──────────────────────┘\n```\n\n### 工作原理\n\n**Triage** 阶段会枚举二进制文件中的所有函数，按大小将其分类为琐碎\u002F小型\u002F中型\u002F大型，构建调用图，检测源语言，并对已知的标准库和加密函数进行签名匹配。通过签名匹配的函数会被标记为已解析，从而完全跳过 LLM 分析。\n\n**Analysis** 阶段使用工作队列，按照调用图的自底向上顺序处理函数。对于每个函数，Kong 会从 Ghidra 的程序数据库中构建上下文窗口——包括反编译结果、交叉引用、字符串引用以及已分析被调用函数的签名等信息——并对反编译输出进行规范化处理，然后将其发送给 LLM 进行名称、类型和参数的恢复。如果在某个函数的反编译结果中检测到混淆，Kong 会在生成分析结果之前，利用符号工具执行一次代理式的去混淆操作。分析结果会立即写回到 Ghidra 中，以便下游调用者能够看到更新后的名称。\n\n**Cleanup** 阶段会统一在分析过程中积累的结构体类型建议，并重新尝试那些在分析阶段未能应用的函数签名。\n\n**Synthesis** 阶段会对所有已分析的函数进行全局审视。它会通过一次 LLM 调用来审查连接最紧密的函数，统一命名规范，根据字段访问模式合成结构体定义，并优化在更广泛背景下显得不一致的名称。\n\n**Export** 阶段会生成最终的 `analysis.json` 文件，并将所有恢复的名称、类型和签名写回到 Ghidra 程序数据库中。\n\n## 技术栈\n\n- **运行时**: Python 3.11+，使用 [uv](https:\u002F\u002Fgithub.com\u002Fastral-sh\u002Fuv) 进行管理\n- **二进制分析**: [Ghidra](https:\u002F\u002Fghidra-sre.org\u002F) 通过 [PyGhidra](https:\u002F\u002Fgithub.com\u002FNationalSecurityAgency\u002Fghidra\u002Ftree\u002Fmaster\u002FGhidra\u002FFeatures\u002FPyGhidra) 实现（进程内，JPype）\n- **LLM**: [Anthropic SDK](https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fanthropic-sdk-python)（Claude）和 [OpenAI SDK](https:\u002F\u002Fgithub.com\u002Fopenai\u002Fopenai-python)（GPT-4o）\n- **符号分析**: [z3-solver](https:\u002F\u002Fgithub.com\u002FZ3Prover\u002Fz3)\n- **CLI**: [Click](https:\u002F\u002Fclick.palletsprojects.com\u002F)\n- **TUI**: [Textual](https:\u002F\u002Ftextual.textualize.io\u002F)\n- **显示**: [Rich](https:\u002F\u002Frich.readthedocs.io\u002F)\n- **构建**: [hatchling](https:\u002F\u002Fhatch.pypa.io\u002F)\n- **测试**: [pytest](https:\u002F\u002Fpytest.org\u002F)\n\n## 设置\n\n### 先决条件\n\n- **Python 3.11+** — ([python.org](https:\u002F\u002Fwww.python.org\u002Fdownloads\u002F) 或系统包管理器)\n- **uv** — Python 包管理器（[安装 uv](https:\u002F\u002Fdocs.astral.sh\u002Fuv\u002Fgetting-started\u002Finstallation\u002F)）\n- **Ghidra** — 美国国家安全局的逆向工程框架（[安装 Ghidra](https:\u002F\u002Fghidra-sre.org\u002FInstallationGuide.html)）\n- **JDK 21+** — Ghidra 所需（[Adoptium](https:\u002F\u002Fadoptium.net\u002F)）\n- **LLM API 密钥** — 至少选择以下之一：\n  - [Anthropic](https:\u002F\u002Fconsole.anthropic.com\u002Fsettings\u002Fkeys)（Claude）\n  - [OpenAI](https:\u002F\u002Fplatform.openai.com\u002Fapi-keys)（GPT-4o）\n\n### 快速入门\n\n```bash\n# 1. 安装 Kong\nuv pip install kong-re\n\n# 2. 设置你的 API 密钥\nexport ANTHROPIC_API_KEY=\"sk-ant-...\"\n# 和\u002F或\nexport OPENAI_API_KEY=\"sk-...\"\n\n# 3. 运行设置向导（仅首次使用）\nkong setup\n\n# 4. 分析一个二进制文件\nkong analyze .\u002Fpath\u002Fto\u002Fstripped_binary\n```\n\n设置向导允许你选择要使用的 LLM 提供商，并设置默认选项。Kong 会自动检测你的 Ghidra 和 JDK 安装情况，将二进制文件加载到进程内的 Ghidra 实例中，并运行完整的流水线。\n\n#### 从源码安装\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Famruth-sn\u002Fkong.git\ncd kong\nuv sync\nuv run kong setup\nuv run kong analyze .\u002Fpath\u002Fto\u002Fstripped_binary\n```\n\n### 环境变量\n\n| 变量             | 是否必需 | 描述                                   |\n|------------------|----------|----------------------------------------|\n| `ANTHROPIC_API_KEY` | 至少一个 | Anthropic API 密钥（Claude）           |\n| `OPENAI_API_KEY`    | 至少一个 | OpenAI API 密钥（GPT-4o）              |\n| `GHIDRA_INSTALL_DIR` | 否       | Ghidra 安装路径（未设置时自动检测）    |\n| `JAVA_HOME`        | 否       | JDK 路径（未设置时自动检测）           |\n| `KONG_CONFIG_DIR`  | 否       | 配置目录覆盖（默认：`~\u002F.config\u002Fkong`） |\n\n### 使用方法\n\n```bash\n# 运行设置向导\nkong setup\n\n# 分析一个剥离的二进制文件（使用你配置的默认提供商）\nkong analyze .\u002Fbinary\n\n# 使用特定提供商进行分析\nkong analyze .\u002Fbinary --provider openai\n\n# 覆盖模型\nkong analyze .\u002Fbinary --provider openai --model gpt-4o-mini\n\n# 显示二进制元数据而不运行分析\nkong info .\u002Fbinary\n\n# 将分析结果与原始源代码对比\nkong eval .\u002Fanalysis.json .\u002Fsource.c\n```\n\n### 输出\n\n结果会写入输出目录（默认：`.\u002Fkong_output_{binary_name}\u002F`）：\n\n```\nkong_output_{binary_name}\u002F\n├── analysis.json         # 所有恢复的函数名称、类型和参数\n└── events.log            # 流水线执行轨迹\n```\n\n## 基准测试\n\nKong 自主地从一个剥离的 `liblzma.so.5.4.1` 中重建了完整的 [XZ 后门](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FXZ_Utils_backdoor)（CVE-2024-3094）攻击链——在 15 分钟内以 90%-95% 的置信度识别出了全部五个核心植入函数，耗资 6.63 美元。\n\n完整案例研究及复现说明，请参阅 **[BENCHMARKS.md](BENCHMARKS.md)**。\n\n## 项目结构\n\n```\nkong\u002F\n├── __main__.py           # CLI 入口点（click）\n├── config.py             # KongConfig、LLMProvider、LLMConfig\n├── db.py                 # SQLite 配置存储（~\u002F.config\u002Fkong\u002F）\n├── banner.py             # ASCII 封面图、API 密钥辅助工具\n├── agent\u002F\n│   ├── supervisor.py     # 管道编排器\n│   ├── triage.py         # 函数枚举 + 分类\n│   ├── analyzer.py       # LLM 引导的函数分析\n│   ├── queue.py          # 基于调用图的 BFS 工作队列\n│   ├── signatures.py     # 已知函数签名匹配\n│   ├── prompts.py        # 系统提示词 + 输出模式\n│   ├── events.py         # 管道跟踪的阶段\u002F事件类型\n│   └── models.py         # FunctionResult 数据类\n├── ghidra\u002F\n│   ├── client.py         # 进程内 GhidraClient（PyGhidra\u002FJPype）\n│   ├── types.py          # FunctionInfo、BinaryInfo、XRef 等\n│   └── environment.py    # Ghidra\u002FJDK 自动检测\n├── llm\u002F\n│   ├── client.py         # AnthropicClient\n│   ├── openai_client.py  # OpenAIClient\n│   ├── usage.py          # TokenUsage、费用跟踪、定价注册表\n│   └── limits.py         # 模型特定限制 + 速率限制器\n├── normalizer\u002F\n│   └── syntactic.py      # 反编译输出规范化\n├── synthesis\u002F\n│   └── semantic.py       # 全局名称统一 + 结构体合成\n├── evals\u002F\n│   ├── harness.py        # 真值提取 + 打分\n│   └── metrics.py        # symbol_accuracy、type_accuracy\n├── export\u002F\n│   └── source.py         # analysis.json + 写回 Ghidra\n├── signatures\u002F\n│   ├── stdlib.json       # C 标准库函数签名\n│   └── crypto.json       # 加密函数签名\n└── tui\u002F\n    └── app.py            # Textual TUI\n```\n\n## 许可证\n\n[APACHE](LICENSE)\n\nKong 采用 Apache 许可证 2.0 版本授权。Kong 是一个免费且开源的项目。\n\n该许可证与 Ghidra 许可证兼容，并允许商业使用。\n\n## 贡献\n\n欢迎通过 [GitHub Issues](https:\u002F\u002Fgithub.com\u002Famruth-sn\u002Fkong\u002Fissues) 提交问题和功能请求。\n\n此外，也欢迎在 [X](https:\u002F\u002Fx.com\u002F0xamruth) 或 [LinkedIn](https:\u002F\u002Fwww.linkedin.com\u002Fin\u002Famruthn\u002F) 上与我联系！\n\n## 致谢\n\n- [Ghidra](https:\u002F\u002Fghidra-sre.org\u002F)\n- [PyGhidra](https:\u002F\u002Fgithub.com\u002FNationalSecurityAgency\u002Fghidra\u002Ftree\u002Fmaster\u002FGhidra\u002FFeatures\u002FPyGhidra)\n- [JPype](https:\u002F\u002Fgithub.com\u002Fjpype-project\u002Fjpype)\n- [Anthropic SDK](https:\u002F\u002Fgithub.com\u002Fanthropics\u002Fanthropic-sdk-python)\n- [OpenAI SDK](https:\u002F\u002Fgithub.com\u002Fopenai\u002Fopenai-python)\n- [Z3](https:\u002F\u002Fgithub.com\u002FZ3Prover\u002Fz3)\n- [Textual](https:\u002F\u002Ftextual.textualize.io\u002F)\n- [Rich](https:\u002F\u002Frich.readthedocs.io\u002F)\n\n特别感谢 [KeygraphHQ](https:\u002F\u002Fkeygraph.io\u002F) 的 [Shannon](https:\u002F\u002Fgithub.com\u002FKeygraphHQ\u002Fshannon) 项目，它为本项目提供了灵感。我的开发动机是复现 Shannon 在其基于 Web 的渗透测试工具中使用的相同流程，并将其适配用于二进制分析和反编译。\n\n---\n\n敬畏这只猴子。\n\n---\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Famruth-sn_kong_readme_d35e08407409.png\" width=\"40\" alt=\"Kong\"> \u003Cbr \u002F>\n  \u003Cb>Kong\u003C\u002Fb>：全球首个 AI 反向工程师\n\u003C\u002Fp>","# Kong：AI 驱动的二进制逆向工程快速上手指南\n\nKong 是全球首款基于 LLM 编排的自动化逆向工程工具。它能够对去符号化（stripped）或混淆的二进制文件进行全自动分析，自动恢复函数名、类型信息、结构体定义及参数名称，并将结果直接写回 Ghidra 数据库。\n\n## 环境准备\n\n在开始之前，请确保您的系统满足以下要求：\n\n### 系统要求\n- **操作系统**: Linux, macOS 或 Windows (需配置相应环境变量)\n- **Python**: 3.11 或更高版本\n- **JDK**: 21 或更高版本 (Ghidra 运行必需)\n\n### 前置依赖\n1. **uv**: 高性能 Python 包管理器\n   - 安装命令 (官方): `curl -LsSf https:\u002F\u002Fastral.sh\u002Fuv\u002Finstall.sh | sh`\n   - *国内加速*: 若下载缓慢，可尝试使用国内镜像源或手动下载安装包。\n\n2. **Ghidra**: NSA 开源的逆向工程框架\n   - 下载地址: [Ghidra 官网](https:\u002F\u002Fghidra-sre.org\u002F)\n   - *注意*: 请确保已正确安装并配置 `GHIDRA_INSTALL_DIR` 环境变量（通常可自动检测）。\n\n3. **LLM API Key**: 至少需要以下其中之一\n   - **Anthropic** (推荐 Claude 系列): [获取 Key](https:\u002F\u002Fconsole.anthropic.com\u002Fsettings\u002Fkeys)\n   - **OpenAI** (推荐 GPT-4o): [获取 Key](https:\u002F\u002Fplatform.openai.com\u002Fapi-keys)\n\n## 安装步骤\n\n推荐使用 `uv` 进行安装，以确保依赖环境的隔离与一致性。\n\n### 1. 安装 Kong\n```bash\nuv pip install kong-re\n```\n\n### 2. 配置 API 密钥\n在终端中导出您的 LLM API 密钥（根据您选择的提供商二选一或同时设置）：\n\n```bash\n# 配置 Anthropic (Claude)\nexport ANTHROPIC_API_KEY=\"sk-ant-...\"\n\n# 和\u002F或 配置 OpenAI (GPT-4o)\nexport OPENAI_API_KEY=\"sk-...\"\n```\n\n### 3. 初始化配置\n首次使用前，运行设置向导以自动检测本地 Ghidra\u002FJDK 环境并选择默认 LLM 提供商：\n\n```bash\nkong setup\n```\n\n## 基本使用\n\n完成上述步骤后，即可对二进制文件进行分析。\n\n### 最简单的分析命令\n对去符号化的二进制文件执行全自动分析：\n\n```bash\nkong analyze .\u002Fpath\u002Fto\u002Fstripped_binary\n```\n\n**执行过程说明：**\n- Kong 将自动加载二进制文件到内置的 Ghidra 实例中。\n- 执行分层分析：从叶子函数向上遍历调用图，结合上下文进行去混淆和语义合成。\n- 分析完成后，恢复的函数名、类型和结构体将自动写回 Ghidra 程序数据库。\n- 详细分析报告将保存在当前目录下的 `kong_output_{binary_name}\u002F` 文件夹中（包含 `analysis.json`）。\n\n### 进阶用法示例\n\n**指定 LLM 提供商：**\n```bash\nkong analyze .\u002Fbinary --provider openai\n```\n\n**指定具体模型（如为了降低成本）：**\n```bash\nkong analyze .\u002Fbinary --provider openai --model gpt-4o-mini\n```\n\n**仅查看二进制元数据（不执行分析）：**\n```bash\nkong info .\u002Fbinary\n```\n\n**评估分析结果（需有原始源码作为基准）：**\n```bash\nkong eval .\u002Fanalysis.json .\u002Fsource.c\n```\n\n> **提示**: 对于大型二进制文件，分析时间和 Token 消耗会随函数数量增加而增长。建议先在小样本或关键模块上测试效果。","某安全团队在分析一款被恶意软件作者剥离符号并高度混淆的勒索软件二进制文件时，急需快速还原其加密逻辑以制定解密方案。\n\n### 没有 kong 时\n- 分析师面对满屏类似 `FUN_00401a30` 的无意义函数名，需人工逐层追踪调用关系，耗时数天才能理清执行流程。\n- 由于缺乏类型信息和变量名，反编译代码难以阅读，人工推断结构体布局和参数含义极易出错且效率低下。\n- 混淆技术导致控制流混乱，传统工具无法自动清理噪音，分析师必须手动编写脚本预处理数据，严重拖慢进度。\n- 每次分析新函数都需重复构建上下文，无法利用已分析的底层函数成果，造成大量重复劳动。\n\n### 使用 kong 后\n- Kong 自动基于调用图自底向上分析，先将底层叶子函数重命名为 `generate_rsa_key` 等语义名称，让上层调用者直接获得清晰上下文。\n- 通过 LLM 引导的反编译，Kong 自动恢复出完整的结构体定义、参数名称及调用约定，将晦涩代码转化为可读性极高的伪代码。\n- 内置的智能去混淆流水线自动处理控制流平坦化等干扰，并在送入大模型前完成语法标准化，显著减少无效 Token 消耗。\n- 全局语义合成步骤统一了全文件的命名风格，自动关联跨函数的引用信息，一次性输出带有完整符号信息的 Ghidra 工程文件。\n\nKong 将原本需要数天的人工逆向工作压缩至小时级，让分析师能直接聚焦于核心漏洞挖掘而非繁琐的代码还原。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Famruth-sn_kong_d3beb578.png","amruth-sn","Amruth","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Famruth-sn_2c333f0a.png","building @Cartesian-Systems ",null,"0xAmruth","https:\u002F\u002Famruth.ai\u002F","https:\u002F\u002Fgithub.com\u002Famruth-sn",[81,85,89,93],{"name":82,"color":83,"percentage":84},"Python","#3572A5",92.8,{"name":86,"color":87,"percentage":88},"Rust","#dea584",4.4,{"name":90,"color":91,"percentage":92},"Shell","#89e051",2.8,{"name":94,"color":95,"percentage":96},"C","#555555",0,624,87,"2026-04-10T17:16:04","Apache-2.0",4,"未说明 (基于 Ghidra\u002FPython\u002FJDK，通常支持 Linux, macOS, Windows)","未说明 (主要依赖 LLM API 和本地 CPU 进行 Ghidra 分析，无本地 GPU 推理需求)","未说明 (取决于二进制文件大小和 Ghidra 运行需求，建议充足内存)",{"notes":106,"python":107,"dependencies":108},"必须安装 Ghidra 逆向工程框架和 JDK 21+。需要配置 Anthropic (Claude) 或 OpenAI (GPT-4o) 的 API Key。工具通过 PyGhidra 在进程内运行 Ghidra，无需单独启动服务器。建议使用 uv 管理 Python 环境和依赖。","3.11+",[109,110,111,112,113,114,115,116,117],"PyGhidra","JPype","anthropic-sdk-python","openai-sdk-python","z3-solver","Click","Textual","Rich","uv",[13],[120,121,122],"agentic-ai","ghidra","reverse-engineering","2026-03-27T02:49:30.150509","2026-04-12T09:07:39.266360",[126,131,136,140,144,148],{"id":127,"question_zh":128,"answer_zh":129,"source_url":130},30523,"Kong 是否支持配置自定义的本地 OpenAI 兼容 LLM 端点（如 vLLM、LM Studio 或 LocalAI）？","是的，该功能已在最新版本 (v0.2.2) 中集成。用户可以配置自定义的 OpenAI 兼容基础 URL 和本地提供商暴露的模型名称。对于本地模型，成本跟踪功能默认禁用，但未来可能会添加用户自定义的成本跟踪选项。示例配置：基础 URL 设为 `http:\u002F\u002Flocalhost:8000\u002Fv1`，模型设为 `meta-llama\u002FLlama-3-8B-Instruct`。","https:\u002F\u002Fgithub.com\u002Famruth-sn\u002Fkong\u002Fissues\u002F7",{"id":132,"question_zh":133,"answer_zh":134,"source_url":135},30524,"如何获取用于复现 Kong XZ 后门案例研究的特定二进制文件（liblzma.so.5.4.1）？","维护者已确认会将该二进制文件添加到仓库中以供复现使用。用户可以通过查看仓库中的 `test_data\u002Fsamples\u002F` 目录（或关注相关 PR 更新）来获取确切的二进制文件，从而确保基准测试结果的一致性，避免因二进制版本不同导致的函数计数、置信度分布和执行时间的偏差。","https:\u002F\u002Fgithub.com\u002Famruth-sn\u002Fkong\u002Fissues\u002F13",{"id":137,"question_zh":138,"answer_zh":139,"source_url":130},30525,"Kong 是否支持对不同提供商进行对比以评估 RE 任务？","是的，使用最新发布的版本即可实现不同提供商之间的对比评估，这有助于基准测试。维护者表示目前可以实现该功能，并考虑在不久的将来原生支持此特性。如果需要更深入的讨论或专门的功能追踪，建议单独创建一个 Issue。",{"id":141,"question_zh":142,"answer_zh":143,"source_url":130},30526,"当前哪个版本的 Kong 更加稳定？","根据维护者更新，v0.2.2 版本比之前的版本更加稳定。建议用户升级到 [v0.2.2](https:\u002F\u002Fpypi.org\u002Fproject\u002Fkong-re\u002F) 以获得更好的体验，该版本同时也包含了对自定义本地 LLM 端点的支持。",{"id":145,"question_zh":146,"answer_zh":147,"source_url":130},30527,"在使用本地模型时，Kong 的成本跟踪功能如何工作？","在当前的实现中（v0.2.2），针对本地模型的成本跟踪功能是禁用的。不过，维护者表示不反对在未来添加某种形式的用户自定义成本跟踪功能，以满足特定需求。",{"id":149,"question_zh":150,"answer_zh":151,"source_url":135},30528,"为什么在不同的 liblzma 构建版本上运行 Kong 会产生不一致的输出？","这是因为基准测试依赖于特定的二进制构建版本。如果使用替代版本的 `liblzma`，会导致函数计数、置信度分数分布和执行时间出现偏差。为了解决这个问题，必须使用仓库中提供的确切二进制文件（liblzma.so.5.4.1）来复现结果。",[153,158,163,168],{"id":154,"version":155,"summary_zh":156,"released_at":157},214825,"v0.2.2","## 变更内容\n* 由 @amruth-sn 在 https:\u002F\u002Fgithub.com\u002Famruth-sn\u002Fkong\u002Fpull\u002F11 中修复了自定义模型 API 密钥的本地设置错误\n**完整变更日志**: https:\u002F\u002Fgithub.com\u002Famruth-sn\u002Fkong\u002Fcompare\u002Fv0.2.1...v0.2.2","2026-03-18T01:03:06",{"id":159,"version":160,"summary_zh":161,"released_at":162},214826,"v0.2.1","## 变更内容\n* 在 README 中使用 uv，由 @amruth-sn 在 https:\u002F\u002Fgithub.com\u002Famruth-sn\u002Fkong\u002Fpull\u002F8 中完成\n* 集成对本地\u002F自定义模型的支持，由 @amruth-sn 在 https:\u002F\u002Fgithub.com\u002Famruth-sn\u002Fkong\u002Fpull\u002F9 中完成\n\n\n**完整变更日志**: https:\u002F\u002Fgithub.com\u002Famruth-sn\u002Fkong\u002Fcompare\u002Fv0.2.0...v0.2.1","2026-03-18T00:12:30",{"id":164,"version":165,"summary_zh":166,"released_at":167},214827,"v0.2.0","OpenAI 集成\n设置向导\n更新后的成本跟踪","2026-03-16T06:26:01",{"id":169,"version":170,"summary_zh":76,"released_at":171},214828,"v0.1.2","2026-03-13T06:26:42"]