ReadUInt32() public method

public ReadUInt32 ( ) : uint
return uint
Esempio n. 1
0
        private void PatchResourceDataEntry(ByteBuffer resources)
        {
            uint num = resources.ReadUInt32();

            resources.position -= 4;
            resources.WriteUInt32((num - this.GetImageResourceSection().VirtualAddress) + this.rsrc.VirtualAddress);
        }
Esempio n. 2
0
        void PatchResourceDataEntry(ByteBuffer resources)
        {
            var rva = resources.ReadUInt32();

            resources.position -= 4;
            resources.WriteUInt32(rva - win32_rva + rsrc.VirtualAddress);
        }
Esempio n. 3
0
        private void PatchResourceDataEntry(ByteBuffer resources)
        {
            uint num = resources.ReadUInt32();

            resources.position -= 4;
            resources.WriteUInt32(num - module.Image.Win32Resources.VirtualAddress + rsrc.VirtualAddress);
        }
Esempio n. 4
0
        void PatchResourceDataEntry(ByteBuffer resources)
        {
            var old_rsrc = GetImageResourceSection();
            var rva      = resources.ReadUInt32();

            resources.position -= 4;
            resources.WriteUInt32(rva - old_rsrc.VirtualAddress + rsrc.VirtualAddress);
        }
Esempio n. 5
0
        void PatchResourceDataEntry(ByteBuffer resources)
        {
            var rva = resources.ReadUInt32();

            resources.position -= 4;

            resources.WriteUInt32(rva - module.Image.Win32Resources.VirtualAddress + rsrc.VirtualAddress);
        }
Esempio n. 6
0
        private void ReadPdbHeap()
        {
            PdbHeap    pdbHeap    = image.PdbHeap;
            ByteBuffer byteBuffer = new ByteBuffer(pdbHeap.data);

            pdbHeap.Id                  = byteBuffer.ReadBytes(20);
            pdbHeap.EntryPoint          = byteBuffer.ReadUInt32();
            pdbHeap.TypeSystemTables    = byteBuffer.ReadInt64();
            pdbHeap.TypeSystemTableRows = new uint[58];
            for (int i = 0; i < 58; i++)
            {
                Table table = (Table)i;
                if (pdbHeap.HasTable(table))
                {
                    pdbHeap.TypeSystemTableRows[i] = byteBuffer.ReadUInt32();
                }
            }
        }
Esempio n. 7
0
        void ReadPdbHeap()
        {
            var heap = image.PdbHeap;

            var buffer = new ByteBuffer(heap.data);

            heap.Id                  = buffer.ReadBytes(20);
            heap.EntryPoint          = buffer.ReadUInt32();
            heap.TypeSystemTables    = buffer.ReadInt64();
            heap.TypeSystemTableRows = new uint [Mixin.TableCount];

            for (int i = 0; i < Mixin.TableCount; i++)
            {
                var table = (Table)i;
                if (!heap.HasTable(table))
                {
                    continue;
                }

                heap.TypeSystemTableRows [i] = buffer.ReadUInt32();
            }
        }
        private void PatchResourceDirectoryEntry(ByteBuffer resources)
        {
            resources.Advance(4);
            uint num  = resources.ReadUInt32();
            int  num1 = resources.position;

            resources.position = (int)(num & 2147483647);
            if ((num & -2147483648) == 0)
            {
                this.PatchResourceDataEntry(resources);
            }
            else
            {
                this.PatchResourceDirectoryTable(resources);
            }
            resources.position = num1;
        }
Esempio n. 9
0
        private void PatchResourceDirectoryEntry(ByteBuffer resources)
        {
            resources.Advance(4);
            uint num      = resources.ReadUInt32();
            int  position = resources.position;

            resources.position = ((int)num) & 0x7fffffff;
            if ((num & 0x80000000) != 0)
            {
                this.PatchResourceDirectoryTable(resources);
            }
            else
            {
                this.PatchResourceDataEntry(resources);
            }
            resources.position = position;
        }
Esempio n. 10
0
        private void PatchResourceDirectoryEntry(ByteBuffer resources)
        {
            resources.Advance(4);
            uint num      = resources.ReadUInt32();
            int  position = resources.position;

            resources.position = (int)(num & 0x7FFFFFFF);
            if (((int)num & -2147483648) != 0)
            {
                PatchResourceDirectoryTable(resources);
            }
            else
            {
                PatchResourceDataEntry(resources);
            }
            resources.position = position;
        }
Esempio n. 11
0
        void PatchResourceDirectoryEntry(ByteBuffer resources)
        {
            resources.Advance(4);
            var child = resources.ReadUInt32();

            var position = resources.position;

            resources.position = (int)child & 0x7fffffff;

            if ((child & 0x80000000) != 0)
            {
                PatchResourceDirectoryTable(resources);
            }
            else
            {
                PatchResourceDataEntry(resources);
            }

            resources.position = position;
        }
Esempio n. 12
0
		static MetadataToken GetLocalVarToken (ByteBuffer buffer, MethodSymbols symbols)
		{
			if (symbols.variables.IsNullOrEmpty ())
				return MetadataToken.Zero;

			buffer.position = 8;
			return new MetadataToken (buffer.ReadUInt32 ());
		}
Esempio n. 13
0
        void PatchResourceDirectoryEntry(ByteBuffer resources)
        {
            resources.Advance (4);
            var child = resources.ReadUInt32 ();

            var position = resources.position;
            resources.position = (int) child & 0x7fffffff;

            if ((child & 0x80000000) != 0)
                PatchResourceDirectoryTable (resources);
            else
                PatchResourceDataEntry (resources);

            resources.position = position;
        }
Esempio n. 14
0
 void PatchResourceDataEntry(ByteBuffer resources)
 {
     var old_rsrc = GetImageResourceSection ();
     var rva = resources.ReadUInt32 ();
     resources.position -= 4;
     resources.WriteUInt32 (rva - old_rsrc.VirtualAddress + rsrc.VirtualAddress);
 }
Esempio n. 15
0
        void PatchRawCode(ByteBuffer buffer, int code_size, CodeWriter writer)
        {
            var metadata = writer.metadata;
            buffer.WriteBytes (ReadBytes (code_size));
            var end = buffer.position;
            buffer.position -= code_size;

            while (buffer.position < end) {
                OpCode opcode;
                var il_opcode = buffer.ReadByte ();
                if (il_opcode != 0xfe) {
                    opcode = OpCodes.OneByteOpCode [il_opcode];
                } else {
                    var il_opcode2 = buffer.ReadByte ();
                    opcode = OpCodes.TwoBytesOpCode [il_opcode2];
                }

                switch (opcode.OperandType) {
                case OperandType.ShortInlineI:
                case OperandType.ShortInlineBrTarget:
                case OperandType.ShortInlineVar:
                case OperandType.ShortInlineArg:
                    buffer.position += 1;
                    break;
                case OperandType.InlineVar:
                case OperandType.InlineArg:
                    buffer.position += 2;
                    break;
                case OperandType.InlineBrTarget:
                case OperandType.ShortInlineR:
                case OperandType.InlineI:
                    buffer.position += 4;
                    break;
                case OperandType.InlineI8:
                case OperandType.InlineR:
                    buffer.position += 8;
                    break;
                case OperandType.InlineSwitch:
                    var length = buffer.ReadInt32 ();
                    buffer.position += length * 4;
                    break;
                case OperandType.InlineString:
                    var @string = GetString (new MetadataToken (buffer.ReadUInt32 ()));
                    buffer.position -= 4;
                    buffer.WriteUInt32 (
                        new MetadataToken (
                            TokenType.String,
                            metadata.user_string_heap.GetStringIndex (@string)).ToUInt32 ());
                    break;
                case OperandType.InlineSig:
                    var call_site = GetCallSite (new MetadataToken (buffer.ReadUInt32 ()));
                    buffer.position -= 4;
                    buffer.WriteUInt32 (writer.GetStandAloneSignature (call_site).ToUInt32 ());
                    break;
                case OperandType.InlineTok:
                case OperandType.InlineType:
                case OperandType.InlineMethod:
                case OperandType.InlineField:
                    var provider = reader.LookupToken (new MetadataToken (buffer.ReadUInt32 ()));
                    buffer.position -= 4;
                    buffer.WriteUInt32 (metadata.LookupToken (provider).ToUInt32 ());
                    break;
                }
            }
        }
Esempio n. 16
0
        void ReadPdbHeap()
        {
            var heap = image.PdbHeap;

            var buffer = new ByteBuffer (heap.data);

            heap.Id = buffer.ReadBytes (20);
            heap.EntryPoint = buffer.ReadUInt32 ();
            heap.TypeSystemTables = buffer.ReadInt64 ();
            heap.TypeSystemTableRows = new uint [Mixin.TableCount];

            for (int i = 0; i < Mixin.TableCount; i++) {
                var table = (Table) i;
                if (!heap.HasTable (table))
                    continue;

                heap.TypeSystemTableRows [i] = buffer.ReadUInt32 ();
            }
        }
Esempio n. 17
0
 static void PatchResourceDataEntry(ByteBuffer resources, Section old, Section @new)
 {
     uint num = resources.ReadUInt32();
     resources.Position -= 4;
     resources.WriteUInt32(num - old.VirtualAddress + @new.VirtualAddress);
 }
Esempio n. 18
0
 static void PatchResourceDirectoryEntry(ByteBuffer resources, Section old, Section @new)
 {
     resources.Advance(4);
     uint num = resources.ReadUInt32();
     int position = resources.Position;
     resources.Position = ((int)num) & 0x7fffffff;
     if ((num & 0x80000000) != 0)
     {
         PatchResourceDirectoryTable(resources, old, @new);
     }
     else
     {
         PatchResourceDataEntry(resources, old, @new);
     }
     resources.Position = position;
 }
Esempio n. 19
0
		public void FieldRVA ()
		{
			TestCSharp ("Layouts.cs", module => {
				var priv_impl = GetPrivateImplementationType (module);
				Assert.IsNotNull (priv_impl);

				Assert.AreEqual (1, priv_impl.Fields.Count);

				var field = priv_impl.Fields [0];

				Assert.IsNotNull (field);
				Assert.AreNotEqual (0, field.RVA);
				Assert.IsNotNull (field.InitialValue);
				Assert.AreEqual (16, field.InitialValue.Length);

				var buffer = new ByteBuffer (field.InitialValue);

				Assert.AreEqual (1, buffer.ReadUInt32 ());
				Assert.AreEqual (2, buffer.ReadUInt32 ());
				Assert.AreEqual (3, buffer.ReadUInt32 ());
				Assert.AreEqual (4, buffer.ReadUInt32 ());
			});
		}
Esempio n. 20
0
 void PatchResourceDataEntry(ByteBuffer resources)
 {
     var rva = resources.ReadUInt32 ();
     resources.position -= 4;
     resources.WriteUInt32 (rva - win32_rva + rsrc.VirtualAddress);
 }