-
Notifications
You must be signed in to change notification settings - Fork 0
/
ntpeconv.h
68 lines (58 loc) · 1.5 KB
/
ntpeconv.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
/*
* PROJECT: PE Converter for NT PDK v1.196 (September 1991) and PDK October 1991
* LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
* PURPOSE: Old PE Format Type definitions used in NT PDK v1.196.
* COPYRIGHT: Copyright 2021-2022 Hermès Bélusca-Maïto
*
* These definitions have been extracted from the
* embedded debug symbols in the \I386\DEBUG\I386KD.EXE
* executable of the NT PDK v1.196 release.
*/
#ifndef _NTPECONV_H_
#define _NTPECONV_H_
#pragma once
/* Copyright information */
#define PROGNAME "NTPECONV"
#define VERSION "0.9a3"
#define COPYRIGHT_YEARS "2021-2022"
/*
* VOID
* __cdecl
* PrintWarning(
* IN PCSTR ErrorFmt,
* ...);
*/
#define PrintWarning(WarningFmt, ...) \
fprintf(stdout, PROGNAME ": " WarningFmt, ##__VA_ARGS__)
/*
* VOID
* __cdecl
* PrintError(
* IN PCSTR ErrorFmt,
* ...);
*/
#define PrintError(ErrorFmt, ...) \
fprintf(stderr, PROGNAME ": " ErrorFmt, ##__VA_ARGS__)
typedef enum _ERROR_TYPE
{
ErrorInvalidPE = 0,
ErrorMalformedPE,
ErrorUnsupportedPE,
ErrorTypeMax
} ERROR_TYPE;
extern PCSTR Errors[ErrorTypeMax + 1];
/*
* VOID
* __cdecl
* PrintErrorReason(
* IN ERROR_TYPE ErrorType,
* IN PCSTR Reason,
* ...);
*/
#define PrintErrorReason(ErrorType, Reason, ...) \
do { \
C_ASSERT((ErrorType) <= ErrorTypeMax); \
PrintError("%s (" Reason ")\n", \
Errors[ErrorType], ##__VA_ARGS__); \
} while (0)
#endif /* _NTPECONV_H_ */