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
*/
24
using
System
;
25
using
System.IO;
26
27
using
DWORD
=
System
.UInt32;
28
using
WORD
=
System
.UInt16;
29
30
namespace
IKVM.Reflection.Reader
31
{
32
33
class
SectionHeader
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
44
public
DWORD
VirtualSize
;
45
public
DWORD
VirtualAddress
;
46
public
DWORD
SizeOfRawData
;
47
public
DWORD
PointerToRawData
;
48
public
DWORD
PointerToRelocations
;
49
public
DWORD
PointerToLinenumbers
;
50
public
WORD
NumberOfRelocations
;
51
public
WORD
NumberOfLinenumbers
;
52
public
DWORD
Characteristics
;
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
}
DWORD
System.UInt32 DWORD
Definition
IMAGE_DATA_DIRECTORY.cs:26
WORD
System.UInt16 WORD
Definition
IMAGE_FILE_HEADER.cs:27
Name
global::java.lang.invoke.LambdaForm.Name Name
Definition
NativeInvokerBytecodeGenerator.cs:42
IKVM.Reflection.Reader.SectionHeader
Definition
SectionHeader.cs:34
IKVM.Reflection.Reader.SectionHeader.NumberOfLinenumbers
WORD NumberOfLinenumbers
Definition
SectionHeader.cs:51
IKVM.Reflection.Reader.SectionHeader.NumberOfRelocations
WORD NumberOfRelocations
Definition
SectionHeader.cs:50
IKVM.Reflection.Reader.SectionHeader.IMAGE_SCN_CNT_INITIALIZED_DATA
const DWORD IMAGE_SCN_CNT_INITIALIZED_DATA
Definition
SectionHeader.cs:37
IKVM.Reflection.Reader.SectionHeader.Name
string Name
Definition
SectionHeader.cs:43
IKVM.Reflection.Reader.SectionHeader.VirtualSize
DWORD VirtualSize
Definition
SectionHeader.cs:44
IKVM.Reflection.Reader.SectionHeader.IMAGE_SCN_MEM_READ
const DWORD IMAGE_SCN_MEM_READ
Definition
SectionHeader.cs:40
IKVM.Reflection.Reader.SectionHeader.PointerToLinenumbers
DWORD PointerToLinenumbers
Definition
SectionHeader.cs:49
IKVM.Reflection.Reader.SectionHeader.PointerToRawData
DWORD PointerToRawData
Definition
SectionHeader.cs:47
IKVM.Reflection.Reader.SectionHeader.IMAGE_SCN_MEM_EXECUTE
const DWORD IMAGE_SCN_MEM_EXECUTE
Definition
SectionHeader.cs:39
IKVM.Reflection.Reader.SectionHeader.IMAGE_SCN_MEM_DISCARDABLE
const DWORD IMAGE_SCN_MEM_DISCARDABLE
Definition
SectionHeader.cs:38
IKVM.Reflection.Reader.SectionHeader.Characteristics
DWORD Characteristics
Definition
SectionHeader.cs:52
IKVM.Reflection.Reader.SectionHeader.VirtualAddress
DWORD VirtualAddress
Definition
SectionHeader.cs:45
IKVM.Reflection.Reader.SectionHeader.IMAGE_SCN_MEM_WRITE
const DWORD IMAGE_SCN_MEM_WRITE
Definition
SectionHeader.cs:41
IKVM.Reflection.Reader.SectionHeader.PointerToRelocations
DWORD PointerToRelocations
Definition
SectionHeader.cs:48
IKVM.Reflection.Reader.SectionHeader.IMAGE_SCN_CNT_CODE
const DWORD IMAGE_SCN_CNT_CODE
Definition
SectionHeader.cs:36
IKVM.Reflection.Reader.SectionHeader.SizeOfRawData
DWORD SizeOfRawData
Definition
SectionHeader.cs:46
IKVM.Reflection.Reader
Definition
AssemblyReader.cs:31
System
Definition
HexConverter.cs:9
src
IKVM.CoreLib
Reflection
Reader
SectionHeader.cs
Generated by
1.12.0