Mono.Cecil.PE.ByteBuffer.WriteUInt32 C# (CSharp) Method

WriteUInt32() public method

public WriteUInt32 ( uint value ) : void
value uint
return void
        public void WriteUInt32(uint value)
        {
            if (position + 4 > buffer.Length)
                Grow (4);

            buffer [position++] = (byte) value;
            buffer [position++] = (byte) (value >> 8);
            buffer [position++] = (byte) (value >> 16);
            buffer [position++] = (byte) (value >> 24);

            if (position > length)
                length = position;
        }

Usage Example

Esempio n. 1
0
        void PatchRawFatMethod(ByteBuffer buffer, MethodSymbols symbols, CodeWriter writer, out MetadataToken local_var_token)
        {
            var flags = ReadUInt16 ();
            buffer.WriteUInt16 (flags);
            buffer.WriteUInt16 (ReadUInt16 ());
            symbols.code_size = ReadInt32 ();
            buffer.WriteInt32 (symbols.code_size);
            local_var_token = ReadToken ();

            if (local_var_token.RID > 0) {
                var variables = symbols.variables = ReadVariables (local_var_token);
                buffer.WriteUInt32 (variables != null
                    ? writer.GetStandAloneSignature (symbols.variables).ToUInt32 ()
                    : 0);
            } else
                buffer.WriteUInt32 (0);

            PatchRawCode (buffer, symbols.code_size, writer);

            if ((flags & 0x8) != 0)
                PatchRawSection (buffer, writer.metadata);
        }
All Usage Examples Of Mono.Cecil.PE.ByteBuffer::WriteUInt32