summaryrefslogtreecommitdiff
path: root/fpcsrc/packages/fcl-res/src/cofftypes.pp
blob: fb5102ba1c5f8ac04de9d89a300ab8d46d928036 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
{
    This file is part of the Free Pascal run time library.
    Copyright (c) 2008 by Giulio Bernardi

    Types used by COFF resource reader and writer

    See the file COPYING.FPC, included in this distribution,
    for details about the copyright.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

 **********************************************************************}

unit cofftypes;

{$MODE OBJFPC}

interface

type
  TCoffMachineType = (cmti386, cmtarm, cmtx8664);

type
  TSectionName = array [0..7] of char;

const
  RSRCSectName : TSectionName = '.rsrc'+#0+#0+#0;

type
  TCoffHeader = packed record
    Machine : word;
    NumSects : word;
    TimeStamp : longword;
    SymTablePtr : longword;
    SymNum : longword;
    OptHdrSize : word;
    Characteristics : word;
  end;

  TCoffSectionHeader = packed record
    Name : TSectionName;
    VirtualSize : longword;
    VirtualAddress : longword;
    SizeOfRawData : longword;
    PointerToRawData : longword;
    PointerToRelocations : longword;
    PointerToLineNumbers : longword;
    NumberOfRelocations : word;
    NumberOfLineNumbers : word;
    Characteristics : longword;
  end;

  TCoffSectionTable = packed record
    Name : TSectionName;
    Value : longword;
    SectionNumber : word;
    _type : word;
    StorageClass : byte;
    NumAuxSymbol : byte;
  end;

  TResDirTable = packed record
    Characteristics : longword;
    TimeStamp : longword;
    VerMajor : word;
    VerMinor : word;
    NamedEntriesCount : word;
    IDEntriesCount : word;
  end;

  TResDirEntry = packed record
    NameID : longword;
    DataSubDirRVA : longword;
  end;

  TResDataEntry = packed record
    DataRVA : longword;
    Size : longword;
    Codepage : longword;
    Reserved : longword;
  end;

implementation

end.