ReactOS  0.4.13-dev-982-g9853eab
pe.h
Go to the documentation of this file.
1 #ifndef _LIBMACH_PE_H_
2 #define _LIBMACH_PE_H_
3 
4 #include "compat.h"
5 
6 struct DwarfBlock;
8 
9 typedef struct _CoffSymbol {
11  char *name;
12 } CoffSymbol;
13 
14 typedef struct _Pe {
15  void *fd;
16  u16int (*e2)(const unsigned char *data);
17  u32int (*e4)(const unsigned char *data);
18  u64int (*e8)(const unsigned char *data);
22  int (*loadsection)(struct _Pe *pe, char *name, struct DwarfBlock *b);
23  int nsections;
25 } Pe;
26 
27 #define E_SYMNMLEN 8
28 #include <pshpack1.h>
29 typedef struct {
30  union {
31  char e_name[E_SYMNMLEN];
32  struct {
33  unsigned long e_zeroes;
34  unsigned long e_offset;
35  } e;
36  } e;
37  unsigned long e_value;
38  short e_scnum;
39  unsigned short e_type;
40  unsigned char e_sclass;
41  unsigned char e_numaux;
42 } SYMENT, *PSYMENT;
43 #include <poppack.h>
44 
45 #define C_EXT 2
46 #define C_STAT 3
47 #define DT_FCN 0x40
48 
49 Pe *peopen(const char *name);
50 int loaddisksection(struct _Pe *pe, char *name, struct DwarfBlock *b);
51 int loadmemsection(struct _Pe *pe, char *name, struct DwarfBlock *b);
52 u16int peget2(const unsigned char *ptr);
53 u32int peget4(const unsigned char *ptr);
54 u64int peget8(const unsigned char *ptr);
55 void pefree(struct _Pe *pe);
56 ulong pefindrva(struct _IMAGE_SECTION_HEADER *SectionHeader, int NumberOfSections, ulong TargetPhysical);
57 int GetStrnlen(const char *string, int maxlen);
58 
59 #define ANSI_NAME_STRING(s) ((PANSI_STRING)((s)->Name))
60 
61 #endif/*_LIBMACH_PE_H_*/
Definition: pe.h:9
char * name
Definition: pe.h:11
ulong pefindrva(struct _IMAGE_SECTION_HEADER *SectionHeader, int NumberOfSections, ulong TargetPhysical)
Definition: pe.c:126
unsigned char e_numaux
Definition: pe.h:41
struct _CoffSymbol CoffSymbol
u16int(* e2)(const unsigned char *data)
Definition: pe.h:16
CoffSymbol * symtab
Definition: pe.h:21
int loadmemsection(struct _Pe *pe, char *name, struct DwarfBlock *b)
Definition: pe.c:81
void * fd
Definition: pe.h:15
unsigned short e_type
Definition: pe.h:39
Definition: pe.h:14
#define E_SYMNMLEN
Definition: pe.h:27
void pefree(struct _Pe *pe)
Definition: pe.c:109
unsigned long e_value
Definition: pe.h:37
struct _Pe Pe
int GetStrnlen(const char *string, int maxlen)
Definition: pe.c:103
u64int peget8(const unsigned char *ptr)
Definition: pe.c:43
struct SYMENT * PSYMENT
#define e
Definition: ke_i.h:82
static PVOID ptr
Definition: dispmode.c:27
ulong nsymbols
Definition: pe.h:20
int loaddisksection(struct _Pe *pe, char *name, struct DwarfBlock *b)
Definition: pe.c:72
Definition: pe.h:29
unsigned int u32int
Definition: compat.h:13
u32int peget4(const unsigned char *ptr)
Definition: pe.c:39
int(* loadsection)(struct _Pe *pe, char *name, struct DwarfBlock *b)
Definition: pe.h:22
#define b
Definition: ke_i.h:79
u64int(* e8)(const unsigned char *data)
Definition: pe.h:18
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
unsigned long e_offset
Definition: pe.h:34
ulong address
Definition: pe.h:10
ulong imagesize
Definition: pe.h:19
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
u16int peget2(const unsigned char *ptr)
Definition: pe.c:35
int nsections
Definition: pe.h:23
ulong imagebase
Definition: pe.h:19
unsigned char e_sclass
Definition: pe.h:40
unsigned short u16int
Definition: compat.h:11
short e_scnum
Definition: pe.h:38
unsigned long ulong
Definition: linux.h:275
unsigned long e_zeroes
Definition: pe.h:33
Pe * peopen(const char *name)
ulong loadbase
Definition: pe.h:19
u32int(* e4)(const unsigned char *data)
Definition: pe.h:17
struct _IMAGE_SECTION_HEADER * sect
Definition: pe.h:24
Definition: name.c:36
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
unsigned long long u64int
Definition: compat.h:15
GLuint const GLchar * name
Definition: glext.h:6031