TUP.AsmResolver.ASM.InstructionCollection.Add C# (CSharp) Method

Add() public method

Adds an instruction to the Assembly Instruction Collection.
public Add ( x86Instruction instruction ) : void
instruction x86Instruction The instruction to add.
return void
        public void Add(x86Instruction instruction)
        {
            List.Add(instruction);
        }

Usage Example

コード例 #1
0
        /// <summary>
        /// Disassembles bytes to a collection of assembly instructions.
        /// </summary>
        /// <param name="rawStartOffset">The starting offset</param>
        /// <param name="length">The length. This value is overwritten when the last instruction's bounds are outside of the bounds.</param>
        /// <returns></returns>
        public InstructionCollection Disassemble(long rawStartOffset, long length)
        {
            reader.BaseStream.Position = rawStartOffset;
            InstructionCollection instructions = new InstructionCollection();

            long offset    = rawStartOffset;
            long endOffset = rawStartOffset + length;

            while (reader.BaseStream.Position < endOffset)
            {
                x86Instruction instruction = DisassembleNextInstruction();
                instructions.Add(instruction);
                offset += instruction.Size;
                reader.BaseStream.Position = offset;
            }

            //  reader.Dispose();
            return(instructions);
        }
All Usage Examples Of TUP.AsmResolver.ASM.InstructionCollection::Add