This repository has been archived by the owner on Aug 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 28
/
config.h
166 lines (137 loc) · 4.83 KB
/
config.h
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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
/*
Copyright (c) 2015 Piotr Stolarz
dumpext: PE files fix, dump & analysis WinDbg extension
Distributed under the GNU General Public License (the License)
see accompanying file LICENSE for details.
This software is distributed WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License for more information.
*/
#ifndef __DUMPEXT_CONFIG_H__
#define __DUMPEXT_CONFIG_H__
/* property file */
extern const char *PROP_FILE;
/* extension dll home path */
extern const char *HOME_PATH;
extern const char *PROP_SECT_OPTH;
extern const char *PROP_OPTH_ENTRY_POINT;
extern const char *PROP_OPTH_BASE_CODE;
extern const char *PROP_OPTH_BASE_DATA;
extern const char *PROP_SECT_DIRS;
extern const char *PROP_DIRS_EXP_RVA;
extern const char *PROP_DIRS_EXP_SZ;
extern const char *PROP_DIRS_IDT_RVA;
extern const char *PROP_DIRS_IDT_SZ;
extern const char *PROP_DIRS_RSRC_RVA;
extern const char *PROP_DIRS_RSRC_SZ;
extern const char *PROP_DIRS_EXPT_RVA;
extern const char *PROP_DIRS_EXPT_SZ;
extern const char *PROP_DIRS_CERT_RVA;
extern const char *PROP_DIRS_CERT_SZ;
extern const char *PROP_DIRS_RELOC_RVA;
extern const char *PROP_DIRS_RELOC_SZ;
extern const char *PROP_DIRS_DBG_RVA;
extern const char *PROP_DIRS_DBG_SZ;
extern const char *PROP_DIRS_ARCH_RVA;
extern const char *PROP_DIRS_ARCH_SZ;
extern const char *PROP_DIRS_GPTR_RVA;
extern const char *PROP_DIRS_GPTR_SZ;
extern const char *PROP_DIRS_TLS_RVA;
extern const char *PROP_DIRS_TLS_SZ;
extern const char *PROP_DIRS_CFG_RVA;
extern const char *PROP_DIRS_CFG_SZ;
extern const char *PROP_DIRS_BOUND_RVA;
extern const char *PROP_DIRS_BOUND_SZ;
extern const char *PROP_DIRS_IAT_RVA;
extern const char *PROP_DIRS_IAT_SZ;
extern const char *PROP_DIRS_DELAY_RVA;
extern const char *PROP_DIRS_DELAY_SZ;
extern const char *PROP_DIRS_CLR_RVA;
extern const char *PROP_DIRS_CLR_SZ;
extern const char *PROP_SECT_SECTS;
extern const char *PROP_SECTS_DEL_TRAILING_SECS;
extern const char *PROP_SECTS_NAME;
extern const char *PROP_SECTS_CHARACTER;
extern const char *PROP_SECTS_VSZ;
extern const char *PROP_SECTS_RVA;
extern const char *PROP_SECTS_RSZ;
extern const char *PROP_SECTS_DMPCONT;
extern const char *PROP_SECT_IMPFIX;
extern const char *PROP_IMPFIX_NO_PADD_NAMES;
extern const char *PROP_IMPFIX_NO_ILTS;
extern const char *PROP_IMPFIX_HN_TAB_RVA;
extern const char *PROP_IMPFIX_NAME_TAB_RVA;
extern const char *PROP_SECT_DUMP;
extern const char *PROP_DUMP_OUTPUT;
extern const char *PROP_DUMP_SET_CRC;
extern const char *PROP_DUMP_SAVE_HDR_SPACE;
extern const char *PROP_DUMP_BIND_IMPORTS;
extern const char *PROP_SECT_CONFLSPEC;
extern const char *PROP_SECT_IMPSPEC;
extern const char *PROP_IMPSPEC_IAT_RVA;
extern const char *PROP_SECT_RSRCFIX;
extern const char *PROP_RSRCFIX_RECOVER;
extern const char *PROP_RSRCFIX_RSRC_RVA;
extern const char *PROP_RSRCFIX_PADD;
extern const char *PROP_RSRCFIX_TMPFILE;
extern const char *PROP_RSRCFIX_KEEP_TMPFILE;
extern const char *OUT_DUMP_DEF_FILE;
extern const char *OUT_TMP_RSRC_DEF_FILE;
extern const char *IDT_AFTER_IAT;
extern const char *RSZ_AS_VSZ;
extern const char *RSZ_AUTO;
extern const char *DMPCONT_MEM;
extern const char *DMPCONT_ZEROS;
extern const char *DMPCONT_FILE;
typedef struct _str_num_t
{
char *str;
DWORD num;
} str_num_t;
typedef enum _set_val_t
{
set_no=0,
set_as_original,
set_always
} set_val_t;
typedef enum _rsrcrv_val_t
{
rsrcrv_no=0,
rsrcrv_yes,
rsrcrv_detect
} rsrcrv_val_t;
typedef enum _padd_val_t
{
padd_no=0,
padd_w,
padd_dw,
padd_auto
} padd_val_t;
extern const str_num_t *SETVALS_HT;
extern const str_num_t *RSRCRVVALS_HT;
extern const str_num_t *PADDVALS_HT;
extern const str_num_t *SECCHRVALS_HT;
extern const str_num_t *FLCHRVALS_HT;
extern const str_num_t *DLLCHRVALS_HT;
extern const str_num_t *MEMINFOVALS_HT;
/* Get 'num' field from a string-num hash table pointed by 'ht' (last element is
zeroed). 'str' acts as a searching key in the table. The comparison is case
insensitive. If 'str' is not found or NULL, 'def_val' is returned.
*/
DWORD get_ht_num(const str_num_t *ht, const char *str, DWORD def_val);
/* Get 'str' field from a string-num hash table pointed by 'ht' (last element is
zeroed). 'num' acts as a searching key in the table. If 'num' is not
found 'def_val' is returned.
*/
const char *get_ht_str(const str_num_t *ht, DWORD num, const char *def_val);
/* Print max 32-bit flags in the config file format */
void print_flags(const str_num_t *ht, DWORD flags, UINT bits);
/* Parse max 32-bit flags in the config file format
NOTE: 'pc_flags' string buf is modified during parsing
*/
DWORD parse_flags(const str_num_t *ht, char *pc_flags);
/* Initialize configuration */
void init_config(HINSTANCE hinstDLL);
/* Set the property file */
void set_prop_file(const char* pc_prop_file);
#endif /* __DUMPEXT_CONFIG_H__ */