Skip to content
NeverSightPublic

About

The AI-friendly binary analysis & decompilation engine — 1:1 lift, built on LLVM [WIP]

Topics

Resources

Contributing

Security policy

Stars

119 stars

Watchers

1 watching

Forks

Latest commit

 

History

17,105 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Languages: English | 简体中文 | 繁體中文 | 日本語 | 한국어 | Français | Deutsch | Español | Italiano | Русский | العربية

NeverD

NeverD

The AI-friendly binary analysis & decompilation engine — 1:1 lift, built on LLVM

PE · ELF · Mach-O · EVM · Solana SBF  |  x86-64 · i386 · AArch64 · ARM32 · EVM256 · SBF  |  C + Python SDKs

AGPL-3.0 C++20 Platform SDK

Documentation · Android · iOS · Roadmap · Contributing


Acceptable use

AI-assisted reverse engineering can now reconstruct client protections well enough to publish a reproducible break, which leaves the maintainers of those clients a harder defense. To protect the client-security ecosystem, do not use NeverD to publish methods, code or write-ups that break, disable or destroy client protections.

For security work, use NeverD only for malware analysis. Do not use it to break into a system, disrupt or destroy a service, steal data or credentials, or otherwise harm network security. You must follow the laws that apply to you and bear the consequences of misuse; the authors and contributors do not.

NeverD is released under the GNU AGPL version 3. This notice does not change that license, including its warranty disclaimer and limit on liability.

Overview

NeverD is a native and smart-contract analysis and decompilation engine built on 1:1 instruction-level lifting: semantics are hand-written, so every supported instruction keeps its observable behavior in the output. It loads PE, ELF, Mach-O, legacy EVM bytecode and Solana SBF programs, and produces LLVM IR, C, Rust for SBF, Solidity for EVM or, on native targets, a rewritten binary. Native code is decoded with Capstone; EVM and SBF use dedicated, version-aware decoders and staged IR.

  • Fails loudly — strict mode is on by default: an instruction without a lifter throws UnliftedInstruction; it is never skipped, guessed or silently turned into a NOP.
  • One pipeline, several exits — lift → LLVM IR · decompile → C / Solidity / Rust · patch → rewritten PE / ELF / Mach-O (section trampolines or in-place overwrite).
  • Built for AI and integrators — the CLI, integrators and agents share one engine, libneverd, through a pure C API with deterministic errors and structured C, LLVM IR and JSON output. None of them links Capstone, LLVM or internal C++ directly.
  • Analysis toolkit — debug info, signatures, plugins and optional obfuscation passes.
  • Guest execution — bounded processes, Android native libraries and x64 Windows drivers run on Unicorn (x64/ARM64 software execution) or, on matching hosts, KVM (Linux), WHP (Windows) or HVF (macOS). See CPU execution and guest workloads.

Supported targets

x86-64 i386 AArch64 ARM32
PE (Windows) ✓ ✓ ✓ ✓
ELF (Linux / Android) ✓ ✓ ✓ ✓
Mach-O (macOS / iOS) ✓ ✓ ✓ ✓

Every cell is implemented, though integration depth differs; see the architecture coverage matrix. Mach-O i386 uses thin relocatable objects because modern macOS cannot link historical i386 executables.

The other targets each have their own guide:

Target Scope Guide
MIPS ELF Disassembly, CFG recovery, C and LLVM output. Admitted functions recompile to relocatable ELF, and neverd patch --relink rebuilds fixed-address executables, PIEs and shared libraries. MIPS
RISC-V ELF Experimental. Little-endian RV32 (ILP32, ILP32D) and RV64 (LP64, LP64D) with M, A, C and selected Zba, Zbb, Zbs, Zbkb, Zcb, Zicond, Zicntr, Zihpm and Zicsr features. RISC-V and PowerPC
PowerPC ELF Experimental. PPC32 System V and PPC64 ELFv1 / ELFv2, big- and little-endian: a scalar integer subset, POWER10 prefixed instructions and part of VMX. RISC-V and PowerPC
EVM All 150 assigned opcodes through Fusaka → LLVM i256, C23 _BitInt(256) and Solidity. EVM
Solana SBF v0–v4 ELF programs → LLVM, portable C11 and safe Rust. Solana SBF
Android / iOS Experimental neverd mobile: APK, DEX and smali → Java; IPA, .app and Mach-O → C, Objective-C and Swift; JSON reports. Overview, Android, iOS

RISC-V and PowerPC support strict lifting, CFG recovery, structured C and LLVM output; native rewriting is not available for them yet.

How it works

Binary (PE / ELF / Mach-O)
  → Loader + DebugInfo
  → Capstone decode
  → LowIR     architecture-neutral NdOps · CFG
  → MedIR     types · ABI · calls · memory · SSA
       │
       ├─ lift        MedIR → LLVM IR
       ├─ decompile   MedIR → HighIR → C
       │              MedIR → LLVM IR → opt → C   (--llvm)
       └─ patch       MedIR → LLVM IR → codegen → binary

EVM (raw / hex / compiler artifact)
  → runtime normalization + hardfork-aware decode
  → EVM LowIR → EVM stack-SSA MedIR → recovered EVM HighIR
       ├─ lift        → verified LLVM i256/i512
       └─ decompile   → C23 _BitInt(256) or Solidity reconstruction

Solana SBF ELF (v0-v4)
  → version-aware legacy/strict loader + verifier
  → SBF LowIR → normalized MedIR → recovered SBF HighIR
       ├─ lift        → verified LLVM i64 runtime ABI
       └─ decompile   → portable C11 or safe stable Rust
Stage Role
LowIR ~80 NdOp opcodes + CFG
MedIR Types, calling conventions, memory model, SSA
HighIR Structured control flow (if / while / for)
LLVM Optimize, emit C, or generate machine code

Quick start

# Build (the first build also compiles the LLVM fork; see Building)
git submodule update --init --recursive
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release
cmake --build build

# Lift, decompile, patch
./build/bin/neverd lift -o out.ll binary
./build/bin/neverd decompile -o out.c binary
./build/bin/neverd patch --hello -o patched binary

# EVM, Solana SBF, Android
./build/bin/neverd decompile --language=solidity contract.evm -o contract.sol
./build/bin/neverd decompile --language=rust program.so -o program.rs
./build/bin/neverd mobile app.apk -o recovered-android

# Inspect
./build/bin/neverd info binary
./build/bin/neverd funcs binary
./build/bin/neverd disasm --func 0x401000 binary

Building

Requirements: CMake ≥ 3.20 · Ninja · a C++20 compiler · Git submodules (including the LLVM fork and Capstone)

The first configure builds the LLVM fork locally, which often takes 30–60 minutes; later builds are incremental. The presets in CMakePresets.json are release, relwithdebinfo and debug. To skip the LLVM build, use a prebuilt LLVM package with -DNEVERD_LLVM_PREBUILT=ON.

Output Description
build/bin/neverd Unified CLI
build/bin/libneverd.* Engine shared library
build/bin/sdk/ Canonical C SDK include root; keep the neverd/sdk/ hierarchy, as in <neverd/sdk/NeverDCAPI.h>
build/bin/sdk/python/ Typed Python plugin package and examples
build/bin/signatures/ Bundled signature libraries
build/bin/neverd-bench Benchmark harness (JSON timings)
build/bin/neverd-sigmaker .pat generator from static libraries

Run the tests with:

cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON
cmake --build build --target check-neverd

check-neverd runs every test; check-neverd-semantic runs only the Unicorn semantic roundtrips. Testing NeverD covers focused targets, CTest labels, fixture requirements and the cross-format rewrite grid.

CMake option Default Description
NEVERD_LLVM_PREBUILT OFF Use a prebuilt LLVM package instead of building the fork
NEVERD_BUILD_SHARED ON Build libneverd
NEVERD_ENABLE_PYTHON_PLUGINS ON Embed CPython 3.10+ plugin support
NEVERD_BUILD_PLUGINS OFF Build the example plugins
BUILD_TESTING OFF Build the unit tests
NEVERD_ENABLE_SEMANTIC_TESTS ON Unicorn-dependent semantic tests (when BUILD_TESTING=ON)

Desktop workbench

The optional desktop workbench follows the classic interactive-disassembler layout and shortcuts, with disassembly, graph, pseudocode, IR, hex and list views, a Visual Studio Code-style theme, 11 UI languages and .nddb project databases. Analysis runs in a separate Qt-free worker, so CLI-only builds stay independent. The qualification record lists supported workflows and the platform validation still required before release.

NeverD desktop workbench in the dark theme: function list, AArch64 disassembly, pseudocode and Output window

CLI

neverd <command> [options] <binary>

neverd --help lists every command, and neverd <command> --help its options.

Pipeline

Command Output Description
lift .ll Lift to LLVM IR
decompile .c / .sol / .rs C, EVM Solidity or SBF Rust, selected with --language
decompile --check-all counts Default C for every loaded function; each body is dropped once checked
decompile --llvm .c Via LLVM IR and the optimizer
decompile --devirtualize .c + optional JSON Experimental x64 interpreter recovery; needs --func; see the contract and examples
fast-decompile .c Fast pseudocode for reading; not recompilable
java Java / JVM IR / bytecode / JSON Class files and multi-release JARs
python .py / JSON / native components CPython and PyInstaller artifact recovery
lua .lua / .luau / JSON Lua, LuaJIT and Luau source recovery
mobile .java / .c / .m / .swift + JSON Experimental: Android, iOS
patch binary Rewrite machine code
# Pseudocode in the program's own language (C++, Rust, Go or C)
neverd decompile --language=source -o out.rs rust-binary
neverd decompile --language=cpp -o out.cpp cpp-binary
neverd decompile --language=go --func main.main go-binary

# Optional transformations for one native function (ordinary HighC skips them)
neverd decompile --func main --symbolic-simplify -o enhanced.c binary
neverd decompile --func main --llvm --llvm-opt=O3 -o optimized.c binary
neverd decompile --func main --llvm --llvm-opt=custom \
  --llvm-passes=instcombine,early-cse,simplifycfg,dce -o cleaned.c binary

# Interpreter recovery
neverd decompile program --func vm_entry --devirtualize --vm-control=r10 \
  --recovery-report recovery.json -o recovered.c
neverd patch --hello -o patched binary
neverd patch --from-ir repl.ll -o patched binary
neverd patch --from-source repl.c --entry replacement --func 0x401000 -o patched binary
neverd patch --mode inplace -o patched binary
neverd patch --subst --flatten --mba -o patched binary

Source patches can use Clang, NeverC ordinary mode or GCC through the verified source/object profiles. Native objects keep the producer's machine code; compiler/runtime compatibility and exception propagation are checked per profile.

For a 32-bit ARM binary that omits a function's ARM/Thumb mode, assert the entry mode before decompiling. Repeat the option for other entries, using :arm where appropriate:

neverd decompile --arm-function-mode=0xADDRESS:thumb -o output.c binary

An assertion that conflicts with verified binary metadata fails loading; a valid one affects only its own entry. The C API exposes the same pre-load setting as neverd_session_set_arm_function_mode().

Analysis

Command Purpose
info / dashboard / headers Metadata and overview
funcs Discovered functions
disasm Disassemble a function by name or address with --func; add --instruction and a hexadecimal address to inspect its recovered LowIR
sym-explore Bounded native LowIR path exploration (--func; JSON output)
scan --gguf Inspect local models, compare tensors and verify a separate GGUF rebuild
scan Check object lifetime, initialization, bounds and format strings (JSON)
hex Hex dump at an address
cfg / callgraph CFG / call graph (JSON; DOT or SVG optional)
xrefs Cross-references
switches Switch jump tables from whole-program analysis
strings / search Strings / byte or text search
imports / exports / symbols / relocs Tables
segments / sections / entrypoints Layout
diff Compare two binaries (-a / -b)
sigs Signature patterns (--auto)
rename / annotate / bookmarks Session markup
export Export results
plugins List or run plugins

Most analysis commands accept --json. sigs --auto picks the bundled signature set that matches the format, architecture and bitness (see signature selection). Large parsed libraries are cached under the user cache directory; NEVERD_SIGNATURE_CACHE names another directory, or off disables the cache.

SDK and plugins

Integrators use the pure C API of libneverd:

Header Role
NeverDCAPI.h Session, lift, decompile, patch, IR / CFG, annotations
NeverDPlugin.h Dynamic-library plugin ABI
neverd_session_t s = neverd_session_create();
neverd_session_load(s, "binary.exe");
neverd_session_analyze(s);

const char *c = neverd_decompile(s, 0x401000);
neverd_free_string(c);
neverd_session_destroy(s);

For EVM, neverd_decompile_all_ex(..., NEVERD_OUTPUT_SOLIDITY, ...) selects Solidity explicitly; the legacy neverd_decompile_all still emits C. See the EVM C API examples.

Native shared libraries and Python .py files share one plugin lifecycle and are discovered in <neverd-dir>/plugins, ~/.neverd/plugins and $NEVERD_PLUGIN_PATH. Build the native example with -DNEVERD_BUILD_PLUGINS=ON; the native plugin guide covers the descriptor, callbacks, build steps and ABI rules. Python support is on by default and can be removed with -DNEVERD_ENABLE_PYTHON_PLUGINS=OFF; the Python plugin guide covers its typed SDK and package workflow.

Contributing

Development is integrated on the dev branch. CONTRIBUTING.md covers setup, Release versus Debug builds, style, targeted tests and pull-request expectations. The architecture and testing guides map common changes to the code and test suites that own them.

License

NeverD is licensed under the GNU AGPL version 3 only. When you redistribute covered code or adaptations, including AI/LLM-assisted reuse and LLVM-based code transformations, retain its copyright, license and warranty notices and the project attribution and source in NOTICE. Attribution and citation describes the requirements, scope and examples; for traceable references, cite the source file and the exact version or commit. CITATION.cff provides software citation metadata, but citation does not replace license compliance.

LLVM components keep their Apache-2.0 WITH LLVM-exception license, and Capstone and the other third-party sources keep their own licenses.

About

The AI-friendly binary analysis & decompilation engine — 1:1 lift, built on LLVM [WIP]

Topics

Resources

Contributing

Security policy

Stars

119 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages