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

GetInstructionByOffset() public method

Gets the assembly instruction in the application by its offset.
public GetInstructionByOffset ( long TargetOffset ) : x86Instruction
TargetOffset long The Offset of the instruction go get.
return x86Instruction
        public x86Instruction GetInstructionByOffset(long TargetOffset)
        {
            x86Instruction TargetInstruction = null;
            foreach (x86Instruction instr in List)
            {
                if (instr.Offset.FileOffset == TargetOffset)
                {
                    TargetInstruction = instr;
                    break;

                }
            }

            return TargetInstruction;
            //int TargetInstructionIndex = assembly.instructions.IndexOf(TargetInstruction);
        }