~ubuntu-branches/ubuntu/jaunty/clamav/jaunty-backports

« back to all changes in this revision

Viewing changes to libclamav/pe.h

  • Committer: Bazaar Package Importer
  • Author(s): Scott Kitterman
  • Date: 2010-10-02 15:36:00 UTC
  • mfrom: (10.1.6 sid)
  • mto: This revision was merged to the branch mainline in revision 13.
  • Revision ID: james.westby@ubuntu.com-20101002153600-2tx3vki1u55cdrjy
Tags: 0.96.3+dfsg-2ubuntu0.10.04.1
Microversion update to 0.96.3 for Lucid (LP: #653738)

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
#include "fmap.h"
29
29
#include "bcfeatures.h"
30
30
/** @file */
31
 
/** Header for this PE file */
 
31
/** Header for this PE file
 
32
  \group_pe */
32
33
struct pe_image_file_hdr {
33
34
    uint32_t Magic;  /**< PE magic header: PE\\0\\0 */
34
35
    uint16_t Machine;/**< CPU this executable runs on, see libclamav/pe.c for possible values */
40
41
    uint16_t Characteristics;
41
42
};
42
43
 
43
 
/** PE data directory header */
 
44
/** PE data directory header
 
45
  \group_pe */
44
46
struct pe_image_data_dir {
45
47
    uint32_t VirtualAddress;
46
48
    uint32_t Size;
47
49
};
48
50
 
49
 
/** 32-bit PE optional header */
 
51
/** 32-bit PE optional header
 
52
  \group_pe */
50
53
struct pe_image_optional_hdr32 {
51
54
    uint16_t Magic;
52
55
    uint8_t  MajorLinkerVersion;                    /**< unreliable */
62
65
    uint32_t FileAlignment;                         /**< usually 32 or 512 */
63
66
    uint16_t MajorOperatingSystemVersion;           /**< not used */
64
67
    uint16_t MinorOperatingSystemVersion;           /**< not used */
65
 
    uint16_t MajorImageVersion;                     /** unreliable */
66
 
    uint16_t MinorImageVersion;                     /** unreliable */
 
68
    uint16_t MajorImageVersion;                     /**< unreliable */
 
69
    uint16_t MinorImageVersion;                     /**< unreliable */
67
70
    uint16_t MajorSubsystemVersion;
68
71
    uint16_t MinorSubsystemVersion;
69
 
    uint32_t Win32VersionValue;                     /* ? */
 
72
    uint32_t Win32VersionValue;                     /*< ? */
70
73
    uint32_t SizeOfImage;
71
74
    uint32_t SizeOfHeaders;
72
75
    uint32_t CheckSum;                              /**< NT drivers only */
76
79
    uint32_t SizeOfStackCommit;
77
80
    uint32_t SizeOfHeapReserve;
78
81
    uint32_t SizeOfHeapCommit;
79
 
    uint32_t LoaderFlags;                           /* ? */
 
82
    uint32_t LoaderFlags;                           /*< ? */
80
83
    uint32_t NumberOfRvaAndSizes;                   /**< unreliable */
81
84
    struct pe_image_data_dir DataDirectory[16];
82
85
};
83
86
 
84
 
/** PE 64-bit optional header */
 
87
/** PE 64-bit optional header
 
88
  \group_pe */
85
89
struct pe_image_optional_hdr64 {
86
90
    uint16_t Magic;
87
91
    uint8_t  MajorLinkerVersion;                    /**< unreliable */
115
119
    struct pe_image_data_dir DataDirectory[16];
116
120
};
117
121
 
118
 
/** PE section header */
 
122
/** PE section header
 
123
  \group_pe */
119
124
struct pe_image_section_hdr {
120
125
    uint8_t Name[8];                        /**< may not end with NULL */
121
126
    /*
135
140
    uint32_t Characteristics;
136
141
};
137
142
 
138
 
/** Data for the bytecode PE hook */
 
143
/** Data for the bytecode PE hook
 
144
  \group_pe */
139
145
struct cli_pe_hook_data {
140
146
  uint32_t offset;
141
 
  uint32_t ep;
142
 
  uint16_t nsections;
 
147
  uint32_t ep; /**< EntryPoint as file offset */
 
148
  uint16_t nsections;/**< Number of sections */
143
149
  uint16_t dummy; /* align */
144
 
  struct pe_image_file_hdr file_hdr;
145
 
  struct pe_image_optional_hdr32 opt32;
 
150
  struct pe_image_file_hdr file_hdr;/**< Header for this PE file */
 
151
  struct pe_image_optional_hdr32 opt32; /**< 32-bit PE optional header */
146
152
  uint32_t dummy2; /* align */
147
 
  struct pe_image_optional_hdr64 opt64;
148
 
  struct pe_image_data_dir dirs[16];
 
153
  struct pe_image_optional_hdr64 opt64;/**< 64-bit PE optional header */
 
154
  struct pe_image_data_dir dirs[16]; /**< PE data directory header */
149
155
  uint32_t e_lfanew;/**< address of new exe header */
150
156
  uint32_t overlays;/**< number of overlays */
151
157
  int32_t overlays_sz;/**< size of overlays */
152
158
  uint32_t hdr_size;/**< internally needed by rawaddr */
153
159
};
154
160
 
155
 
int cli_scanpe(cli_ctx *ctx, icon_groupset *set);
 
161
int cli_scanpe(cli_ctx *ctx);
156
162
 
157
163
int cli_peheader(fmap_t *map, struct cli_exe_info *peinfo);
158
164