IKVM11  11
Java SE 11 Virtual Machine for .NET
Loading...
Searching...
No Matches
CliHeader.cs
Go to the documentation of this file.
1/*
2 Copyright (C) 2008 Jeroen Frijters
3
4 This software is provided 'as-is', without any express or implied
5 warranty. In no event will the authors be held liable for any damages
6 arising from the use of this software.
7
8 Permission is granted to anyone to use this software for any purpose,
9 including commercial applications, and to alter it and redistribute it
10 freely, subject to the following restrictions:
11
12 1. The origin of this software must not be misrepresented; you must not
13 claim that you wrote the original software. If you use this software
14 in a product, an acknowledgment in the product documentation would be
15 appreciated but is not required.
16 2. Altered source versions must be plainly marked as such, and must not be
17 misrepresented as being the original software.
18 3. This notice may not be removed or altered from any source distribution.
19
20 Jeroen Frijters
21 jeroen@frijters.net
22
23*/
24using System.IO;
25
27{
28
29 sealed class CliHeader
30 {
31
32 internal const uint COMIMAGE_FLAGS_ILONLY = 0x00000001;
33 internal const uint COMIMAGE_FLAGS_32BITREQUIRED = 0x00000002;
34 internal const uint COMIMAGE_FLAGS_STRONGNAMESIGNED = 0x00000008;
35 internal const uint COMIMAGE_FLAGS_NATIVE_ENTRYPOINT = 0x00000010;
36 internal const uint COMIMAGE_FLAGS_32BITPREFERRED = 0x00020000;
37
38 internal uint Cb = 0x48;
39 internal ushort MajorRuntimeVersion;
40 internal ushort MinorRuntimeVersion;
41 internal RvaSize MetaData;
42 internal uint Flags;
43 internal uint EntryPointToken;
44 internal RvaSize Resources;
45 internal RvaSize StrongNameSignature;
46 internal RvaSize CodeManagerTable;
47 internal RvaSize VTableFixups;
48 internal RvaSize ExportAddressTableJumps;
49 internal RvaSize ManagedNativeHeader;
50
51 internal void Read(BinaryReader br)
52 {
53 Cb = br.ReadUInt32();
54 MajorRuntimeVersion = br.ReadUInt16();
55 MinorRuntimeVersion = br.ReadUInt16();
56 MetaData.Read(br);
57 Flags = br.ReadUInt32();
58 EntryPointToken = br.ReadUInt32();
59 Resources.Read(br);
60 StrongNameSignature.Read(br);
61 CodeManagerTable.Read(br);
62 VTableFixups.Read(br);
63 ExportAddressTableJumps.Read(br);
64 ManagedNativeHeader.Read(br);
65 }
66
67 }
68
69}