Recurity.Swf.AVM1Modifier.FSCommand.NeedsPatching C# (CSharp) Method

NeedsPatching() protected method

protected NeedsPatching ( AVM1Code code, int instructionIndex ) : PatchState
code AVM1Code
instructionIndex int
return PatchState
        protected PatchState NeedsPatching( AVM1Code code, int instructionIndex )
        {
            _Machine.Reset();

            if ( _Machine.Run( code, instructionIndex, _Check ) )
            {
                // the run completed, that's good

                // check the result
                CheckMachine.MachineStackEntry e = _Machine.MachineResult;

                if ( e.Type == CheckMachine.MachineStackType.KeepInstruction )
                    return PatchState.Innocent;
                else if ( e.Type == CheckMachine.MachineStackType.RemoveInstruction )
                    return PatchState.Change;
                else
                    throw new Exception( "FUCKUP! Final CheckMachine State is wongobongo" );
            }
            else
            {
                return PatchState.Indeterministic;
            }
        }