File: ne.h

package info (click to toggle)
biew 5.6.2-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 4,004 kB
  • ctags: 7,157
  • sloc: ansic: 50,860; asm: 809; makefile: 396; pascal: 371
file content (123 lines) | stat: -rw-r--r-- 2,981 bytes parent folder | download | duplicates (2)
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
/**
 * @namespace   biew_plugins_auto
 * @file        plugins/bin/ne.h
 * @brief       This file contains NE executable file definitions.
 * @version     -
 * @remark      this source file is part of Binary vIEW project (BIEW).
 *              The Binary vIEW (BIEW) is copyright (C) 1995 Nick Kurshev.
 *              All rights reserved. This software is redistributable under the
 *              licence given in the file "Licence.en" ("Licence.ru" in russian
 *              translation) distributed in the BIEW archive.
 * @note        Requires POSIX compatible development system
 *
 * @author      Nick Kurshev
 * @since       1995
 * @note        Development, fixes and improvements
**/
#ifndef __NE_INC
#define __NE_INC

#ifndef __BIEWUTIL__H
#include "biewutil.h"
#endif

#ifndef __BBIO_H
#include "bbio.h"
#endif

#ifdef __HAVE_PRAGMA_PACK__
#pragma pack(1)
#endif

#define NE_WIN2X_ON_3X_PROTMODE 2
#define NE_WIN2X_PROPORTFONT    4
#define NE_FASTLOADAREA         8

/** New EXE header */
typedef struct tagNEHEADER
{
 tUInt8   neSignature[2];               /**< 'NE' */
 tUInt8   neLinkerVersion;
 tUInt8   neLinkerRevision;
 tUInt16  neOffsetEntryTable;
 tUInt16  neLengthEntryTable;
 tUInt32  neChecksum;
 tUInt16  neContestEXE;
 tUInt16  neAutoDataSegmentCount;
 tUInt16  neHeapSize;
 tUInt16  neStackSize;
 tUInt32  neCSIPvalue;
 tUInt32  neSSSPvalue;
 tUInt16  neSegmentTableCount;
 tUInt16  neModuleReferenceTableCount;
 tUInt16  neLengthNonResidentNameTable;
 tUInt16  neOffsetSegmentTable;
 tUInt16  neOffsetResourceTable;
 tUInt16  neOffsetResidentNameTable;
 tUInt16  neOffsetModuleReferenceTable;
 tUInt16  neOffsetImportTable;
 tUInt32  neOffsetNonResidentNameTable;
 tUInt16  neMoveableEntryPointCount;
 tUInt16  neLogicalSectorShiftCount;
 tUInt16  neResourceSegmentCount;
 tUInt8   neOperatingSystem;
 tUInt8   neFlagsOther;
 /* os depended 64 bytes struct */
 tUInt16  neOffsetFastLoadArea;
 tUInt16  neLengthFastLoadArea;
 tUInt16  neReserved;
 tUInt16  neWindowsVersion;

}NEHEADER;

typedef struct tagSEGDEF
{
  tUInt16 sdOffset;
  tUInt16 sdLength;
  tUInt16 sdFlags;
  tUInt16 sdMinMemory;
}SEGDEF;

extern int ReadSegDef(SEGDEF *,tUInt16 numseg);

typedef struct tagENTRY
{
 tUInt8  eFlags;
 tUInt8  eFixed; /**< 1 - fixed 0 - moveable */
 /* tUInt16 eInt3F; */
 tUInt8  eSegNum;
 tUInt16 eSegOff;
}ENTRY;

typedef struct tagNAMEINFO
{
  tUInt16 rnOffset;
  tUInt16 rnLength;
  tUInt16 rnFlags;
  tUInt16 rnID;
  tUInt16 rnHandle;
  tUInt16 rnUsage;
} NAMEINFO;

extern int ReadEntry(ENTRY *,tUInt16 entnum);

typedef struct tagRELOC_NE
{
  tUInt8  AddrType;
  tUInt8  Type;
  tUInt16 RefOff;
  tUInt16 idx;
  tUInt16 ordinal;
}RELOC_NE;

extern const char * __FASTCALL__ GetPMWinAPI(unsigned flag);
extern const char * __nedata[];
extern unsigned __FASTCALL__ GetNamCountNE(BGLOBAL,unsigned long);
extern tBool __FASTCALL__ RNamesReadItems(BGLOBAL,memArray *,unsigned,unsigned long);


#ifdef __HAVE_PRAGMA_PACK__
#pragma pack()
#endif

#endif