neo-decompiler 0.11.0

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
11
12
13
14
15
16
import { scanSlotCounts } from "./util.js";
import { inferBytecodeReturnsValue } from "./type-return-effects.js";

export function buildDirectCallEffectsByOffset(methodGroups, methodTokens = []) {
  const effects = new Map();
  for (const group of methodGroups) {
    let paramCount = scanSlotCounts(group.instructions)[1];
    let returnsValue = inferBytecodeReturnsValue(group.instructions, methodTokens);
    if (group.source) {
      paramCount = group.source.parameters.length;
      returnsValue = !/^void$/i.test(group.source.returnType ?? "");
    }
    effects.set(group.start, { paramCount, returnsValue });
  }
  return effects;
}