Recurity.Swf.AVM1Modifier.Modification.Load C# (CSharp) Method

Load() private method

private Load ( ) : bool
return bool
        private bool Load()
        {
            bool result;

            RemoveComments();
            result = Populate();

            AVM1InstructionSequence bytecode;
            //
            // Now fill the _Code list for quick access
            //
            if ( result )
            {
                bytecode = new AVM1InstructionSequence();
                for ( int i = 0; i < _InnerCode.Count; i++ )
                {
                    bytecode.Add( _InnerCode[ i ].Code );
                }

                _Code = new AVM1Code( bytecode );

                String s = String.Format("Modification with {0:d} instructions loaded", _Code.Count );
                //Log.Debug(this, s);
            }
            else
            {
               //Log.Debug(this,  "Error loading modification" );
            }

            return result;
        }

Same methods

Modification::Load ( List SourceCode, List variables ) : bool
Modification::Load ( string filename, List variables ) : bool

Usage Example

Exemplo n.º 1
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="code"></param>
        /// <param name="instructionIndex"></param>
        /// <returns></returns>
        public Modification GetInlineCode( AVM1Code code, int instructionIndex )
        {
            List<string> all = new List<string>();
            for ( int i = 0; i < _Check.Count; i++ )
            {
                for ( int j = 0; j < _Check[ i ].InlineSource.Count; j++ )
                {
                    all.Add( _Check[ i ].InlineSource[ j ] );

                }
            }

            Modification m = new Modification( (uint)instructionIndex, code[ instructionIndex ], "OriginalAction" );
            m.Load( all, new List<ModVariable>() );
            return m;
        }