neo-decompiler 0.8.1

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
1
2
3
4
5
6
7
8
9
10
use super::{read_varbytes, NefError, Result, MAX_SCRIPT_LEN};

pub(super) fn read_script(bytes: &[u8], offset: &mut usize) -> Result<Vec<u8>> {
    let (script, script_len) = read_varbytes(bytes, *offset, MAX_SCRIPT_LEN)?;
    if script.is_empty() {
        return Err(NefError::EmptyScript.into());
    }
    *offset += script_len;
    Ok(script)
}