neo-decompiler 0.8.2

Neo N3 NEF decompiler: parse, disassemble, lift bytecode to high-level pseudocode and C# skeletons, with a CLI, JSON reports, and optional WebAssembly bindings.
Documentation
use std::path::Path;

use crate::error::Result;
use crate::nef::NefParser;

use super::super::args::{Cli, InfoFormat};

mod json;
mod text;

impl Cli {
    pub(super) fn run_info(&self, path: &Path, format: InfoFormat) -> Result<()> {
        let data = Self::read_nef_bytes(path)?;
        let nef = NefParser::new().parse(&data)?;
        let manifest = self.load_manifest(path)?;
        let manifest_path = self.resolve_manifest_path(path);

        match format {
            InfoFormat::Text => {
                self.print_info_text(path, &nef, manifest.as_ref(), manifest_path.as_ref())
            }
            InfoFormat::Json => {
                self.print_info_json(path, &nef, manifest.as_ref(), manifest_path.as_ref())
            }
        }
    }
}