IKVM11  11
Java SE 11 Virtual Machine for .NET
Loading...
Searching...
No Matches
SectionHeader.cs
Go to the documentation of this file.
1/*
2 Copyright (C) 2009 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;
25using System.IO;
26
27using DWORD = System.UInt32;
28using WORD = System.UInt16;
29
31{
32
34 {
35
36 public const DWORD IMAGE_SCN_CNT_CODE = 0x00000020;
37 public const DWORD IMAGE_SCN_CNT_INITIALIZED_DATA = 0x00000040;
38 public const DWORD IMAGE_SCN_MEM_DISCARDABLE = 0x02000000;
39 public const DWORD IMAGE_SCN_MEM_EXECUTE = 0x20000000;
40 public const DWORD IMAGE_SCN_MEM_READ = 0x40000000;
41 public const DWORD IMAGE_SCN_MEM_WRITE = 0x80000000;
42
43 public string Name; // 8 byte UTF8 encoded 0-padded
53
54 internal void Read(BinaryReader br)
55 {
56 var name = new char[8];
57 int len = 8;
58 for (int i = 0; i < 8; i++)
59 {
60 var b = br.ReadByte();
61 name[i] = (char)b;
62 if (b == 0 && len == 8)
63 len = i;
64 }
65
66 Name = new string(name, 0, len);
67 VirtualSize = br.ReadUInt32();
68 VirtualAddress = br.ReadUInt32();
69 SizeOfRawData = br.ReadUInt32();
70 PointerToRawData = br.ReadUInt32();
71 PointerToRelocations = br.ReadUInt32();
72 PointerToLinenumbers = br.ReadUInt32();
73 NumberOfRelocations = br.ReadUInt16();
74 NumberOfLinenumbers = br.ReadUInt16();
75 Characteristics = br.ReadUInt32();
76 }
77
78 }
79
80}
System.UInt32 DWORD
System.UInt16 WORD
global::java.lang.invoke.LambdaForm.Name Name