Recurity.Swf.AVM1.ActionDefineFunction.Parse C# (CSharp) Method

Parse() protected method

Parses function name and parameters of a function from a stream
protected Parse ( System sourceStream, byte sourceVersion ) : void
sourceStream System The stream to read from
sourceVersion byte The version
return void
        protected override void Parse( System.IO.BinaryReader sourceStream, byte sourceVersion )
        {
            _functionName = Helper.SwfStrings.SwfString( sourceVersion, sourceStream );

            UInt16 numParams = sourceStream.ReadUInt16();

            _parameterName = new List<string>();
            for ( int i = 0; i < numParams; i++ )
            {
                string adder = Helper.SwfStrings.SwfString( sourceVersion, sourceStream );
                _parameterName.Add( adder );
            }

            //
            // ActionDefineFunction defines but does not carry the code. In contrast
            // to intuitive behavior, the code that follows ActionDefineFunction is
            // not part of the Action itself.
            //
            _codeSize = sourceStream.ReadUInt16();
        }