SharpDisasm.Disassembler.NextInstruction C# (CSharp) Method

NextInstruction() public method

Decodes a single instruction and increments buffer position.
public NextInstruction ( ) : Instruction
return Instruction
        public Instruction NextInstruction()
        {
            int length = 0;
            if ((length = Udis86.udis86.ud_disassemble(ref _u)) > 0)
            {
                var instruction = new Instruction(ref _u, CopyBinaryToInstruction);
                if (!instruction.Error)
                {
                    BytesDecoded += length;
                }
                return instruction;
            }
            return null;
        }

Usage Example

Example #1
0
 public IEnumerable<Instruction> Disassemble(Disassembler disassembler)
 {
     disassembler.Reset();
     Instruction instruction;
     while ((instruction = disassembler.NextInstruction()) != null)
         yield return instruction;
 }
All Usage Examples Of SharpDisasm.Disassembler::NextInstruction