1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//! Program analysis helpers for lifted Neo N3 bytecode.
//!
//! The decompiler produces textual views (pseudocode/high-level/C#) as well as a
//! control-flow graph. This module adds best-effort analyses that are useful for
//! downstream tooling and future decompiler passes:
//!
//! - Call graph construction (internal calls, method tokens, syscalls)
//! - Slot cross-reference tracking (reads/writes for locals/args/statics)
//! - Lightweight type inference for common primitives and collections
//!
//! # Examples
//!
//! Inspecting the call graph and slot metadata for a contract:
//!
//! ```no_run
//! use neo_decompiler::{Decompiler, OutputFormat, Result};
//!
//! fn main() -> Result<()> {
//! let decompiler = Decompiler::new();
//! let decompilation = decompiler.decompile_file_with_manifest(
//! "contract.nef",
//! Some("contract.manifest.json"),
//! OutputFormat::Pseudocode,
//! )?;
//!
//! for edge in &decompilation.call_graph.edges {
//! println!(
//! "0x{:04X}: {} -> {:?}",
//! edge.call_offset, edge.caller.name, edge.target
//! );
//! }
//!
//! let entry = &decompilation.xrefs.methods[0];
//! println!("locals: {}", entry.locals.len());
//! println!("arguments: {}", entry.arguments.len());
//!
//! Ok(())
//! }
//! ```
pub use ;