... | ... |
@@ -61,9 +61,9 @@ |
61 | 61 |
|
62 | 62 |
#define DCONF ctx->dconf->pe |
63 | 63 |
|
64 |
-#define IMAGE_DOS_SIGNATURE 0x5a4d /* MZ */ |
|
65 |
-#define IMAGE_DOS_SIGNATURE_OLD 0x4d5a /* ZM */ |
|
66 |
-#define IMAGE_NT_SIGNATURE 0x00004550 |
|
64 |
+#define PE_IMAGE_DOS_SIGNATURE 0x5a4d /* MZ */ |
|
65 |
+#define PE_IMAGE_DOS_SIGNATURE_OLD 0x4d5a /* ZM */ |
|
66 |
+#define PE_IMAGE_NT_SIGNATURE 0x00004550 |
|
67 | 67 |
#define PE32_SIGNATURE 0x010b |
68 | 68 |
#define PE32P_SIGNATURE 0x020b |
69 | 69 |
|
... | ... |
@@ -429,7 +429,7 @@ int cli_scanpe(cli_ctx *ctx) |
429 | 429 |
return CL_CLEAN; |
430 | 430 |
} |
431 | 431 |
|
432 |
- if(EC16(e_magic) != IMAGE_DOS_SIGNATURE && EC16(e_magic) != IMAGE_DOS_SIGNATURE_OLD) { |
|
432 |
+ if(EC16(e_magic) != PE_IMAGE_DOS_SIGNATURE && EC16(e_magic) != PE_IMAGE_DOS_SIGNATURE_OLD) { |
|
433 | 433 |
cli_dbgmsg("Invalid DOS signature\n"); |
434 | 434 |
return CL_CLEAN; |
435 | 435 |
} |
... | ... |
@@ -2141,7 +2141,7 @@ int cli_peheader(fmap_t *map, struct cli_exe_info *peinfo) |
2141 | 2141 |
return CL_CLEAN; |
2142 | 2142 |
} |
2143 | 2143 |
|
2144 |
- if(EC16(e_magic) != IMAGE_DOS_SIGNATURE && EC16(e_magic) != IMAGE_DOS_SIGNATURE_OLD) { |
|
2144 |
+ if(EC16(e_magic) != PE_IMAGE_DOS_SIGNATURE && EC16(e_magic) != PE_IMAGE_DOS_SIGNATURE_OLD) { |
|
2145 | 2145 |
cli_dbgmsg("Invalid DOS signature\n"); |
2146 | 2146 |
return -1; |
2147 | 2147 |
} |
... | ... |
@@ -943,10 +943,6 @@ struct optstruct *optparse(const char *cfgfile, int argc, char **argv, int verbo |
943 | 943 |
|
944 | 944 |
arg = NULL; |
945 | 945 |
if(err) break; |
946 |
- |
|
947 |
- if(sizeof(lnumarg) > sizeof(numarg) && (lnumarg >> (sizeof(numarg)<<3)) ) |
|
948 |
- errno = ERANGE; |
|
949 |
- |
|
950 | 946 |
if(errno == ERANGE) { |
951 | 947 |
if(cfgfile) { |
952 | 948 |
fprintf(stderr, "WARNING: Numerical value for option %s too high, resetting to 4G\n", name); |
... | ... |
@@ -50,7 +50,7 @@ |
50 | 50 |
WarningLevel="3" |
51 | 51 |
DebugInformationFormat="3" |
52 | 52 |
CompileAs="1" |
53 |
- DisableSpecificWarnings="4996;4244;4018;4090;4333;4101;4146" |
|
53 |
+ DisableSpecificWarnings="4996;4244;4018;4090;4333;4101;4146;4102" |
|
54 | 54 |
/> |
55 | 55 |
<Tool |
56 | 56 |
Name="VCManagedResourceCompilerTool" |
... | ... |
@@ -127,7 +127,7 @@ |
127 | 127 |
WarningLevel="3" |
128 | 128 |
DebugInformationFormat="3" |
129 | 129 |
CompileAs="1" |
130 |
- DisableSpecificWarnings="4996;4244;4018;4090;4333;4101;4146" |
|
130 |
+ DisableSpecificWarnings="4996;4244;4018;4090;4333;4101;4146;4102" |
|
131 | 131 |
/> |
132 | 132 |
<Tool |
133 | 133 |
Name="VCManagedResourceCompilerTool" |
... | ... |
@@ -42,7 +42,7 @@ |
42 | 42 |
Name="VCCLCompilerTool" |
43 | 43 |
Optimization="0" |
44 | 44 |
AdditionalIncludeDirectories=""$(SolutionDir)";"$(SolutionDir)..\libclamav";"$(SolutionDir)compat";"$(SolutionDir)3rdparty\zlib";"$(SolutionDir)3rdparty\pthreads";"$(SolutionDir)3rdparty\bzip2";"$(SolutionDir).."" |
45 |
- PreprocessorDefinitions="WIN32_LEAN_AND_MEAN;HAVE_CONFIG_H;PTW32_STATIC_LIB" |
|
45 |
+ PreprocessorDefinitions="WIN32_LEAN_AND_MEAN;HAVE_CONFIG_H;PTW32_STATIC_LIB;THIS_IS_LIBCLAMAV" |
|
46 | 46 |
MinimalRebuild="true" |
47 | 47 |
BasicRuntimeChecks="3" |
48 | 48 |
RuntimeLibrary="3" |
... | ... |
@@ -121,7 +121,7 @@ |
121 | 121 |
Optimization="2" |
122 | 122 |
EnableIntrinsicFunctions="true" |
123 | 123 |
AdditionalIncludeDirectories=""$(SolutionDir)";"$(SolutionDir)..\libclamav";"$(SolutionDir)compat";"$(SolutionDir)3rdparty\zlib";"$(SolutionDir)3rdparty\pthreads";"$(SolutionDir)3rdparty\bzip2";"$(SolutionDir).."" |
124 |
- PreprocessorDefinitions="WIN32_LEAN_AND_MEAN;HAVE_CONFIG_H;PTW32_STATIC_LIB" |
|
124 |
+ PreprocessorDefinitions="WIN32_LEAN_AND_MEAN;HAVE_CONFIG_H;PTW32_STATIC_LIB;THIS_IS_LIBCLAMAV" |
|
125 | 125 |
RuntimeLibrary="2" |
126 | 126 |
BufferSecurityCheck="false" |
127 | 127 |
EnableFunctionLevelLinking="true" |
... | ... |
@@ -67,11 +67,16 @@ typedef unsigned int in_addr_t; |
67 | 67 |
|
68 | 68 |
#undef DATADIR |
69 | 69 |
#undef CONFDIR |
70 |
-__declspec(dllimport) extern const char *DATADIR; |
|
71 |
-__declspec(dllimport) extern const char *CONFDIR; |
|
72 |
-__declspec(dllimport) extern const char *CONFDIR_CLAMD; |
|
73 |
-__declspec(dllimport) extern const char *CONFDIR_FRESHCLAM; |
|
74 |
-__declspec(dllimport) extern const char *CONFDIR_MILTER; |
|
70 |
+#if !defined(THIS_IS_LIBCLAMAV) && defined(_MSC_VER) |
|
71 |
+#define LIBCLAMAV_EXPORT __declspec(dllimport) |
|
72 |
+#else |
|
73 |
+#define LIBCLAMAV_EXPORT |
|
74 |
+#endif |
|
75 |
+LIBCLAMAV_EXPORT extern const char *DATADIR; |
|
76 |
+LIBCLAMAV_EXPORT extern const char *CONFDIR; |
|
77 |
+LIBCLAMAV_EXPORT extern const char *CONFDIR_CLAMD; |
|
78 |
+LIBCLAMAV_EXPORT extern const char *CONFDIR_FRESHCLAM; |
|
79 |
+LIBCLAMAV_EXPORT extern const char *CONFDIR_MILTER; |
|
75 | 80 |
#undef HAVE_CONFIG_H |
76 | 81 |
|
77 | 82 |
#endif /* __PLATFORM_H */ |
78 | 83 |
\ No newline at end of file |