public DisassembleEntry InstructionAt(int ofs) { int i = 0; AVMDisassemble d = NeoDisassembler.Disassemble((byte[])_engine.CurrentContext.Script); foreach (DisassembleEntry line in d.lines) { if (ofs >= line.startOfs && ofs <= line.endOfs) { return(line); } i++; } throw new Exception("Offset cannot be mapped"); }
private bool Disassemble(string[] args) { if (args.Length > 1) { _lineOffset = uint.Parse(args[1]); } AVMDisassemble d = NeoDisassembler.Disassemble((byte[])_engine.CurrentContext.Script); foreach (DisassembleEntry e in d.lines.Skip((int)_lineOffset).Take(20)) { Console.WriteLine($"{e.startOfs}:\t{FormatInstruction(e)}"); } return(true); }