mirror of https://github.com/Cisco-Talos/clamav
parent
5ff0fe419a
commit
ad0afaf185
@ -0,0 +1,239 @@ |
||||
<?xml version="1.0" encoding="Windows-1252"?> |
||||
<VisualStudioProject |
||||
ProjectType="Visual C++" |
||||
Version="9,00" |
||||
Name="clamscan" |
||||
ProjectGUID="{F79E7CA7-E49D-479E-8D68-0EA9CB585575}" |
||||
RootNamespace="clamscan" |
||||
Keyword="Win32Proj" |
||||
TargetFrameworkVersion="196613" |
||||
> |
||||
<Platforms> |
||||
<Platform |
||||
Name="Win32" |
||||
/> |
||||
</Platforms> |
||||
<ToolFiles> |
||||
</ToolFiles> |
||||
<Configurations> |
||||
<Configuration |
||||
Name="Debug|Win32" |
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)" |
||||
IntermediateDirectory="$(SolutionDir)build\$(ProjectName)\$(ConfigurationName)" |
||||
ConfigurationType="1" |
||||
CharacterSet="2" |
||||
> |
||||
<Tool |
||||
Name="VCPreBuildEventTool" |
||||
/> |
||||
<Tool |
||||
Name="VCCustomBuildTool" |
||||
/> |
||||
<Tool |
||||
Name="VCXMLDataGeneratorTool" |
||||
/> |
||||
<Tool |
||||
Name="VCWebServiceProxyGeneratorTool" |
||||
/> |
||||
<Tool |
||||
Name="VCMIDLTool" |
||||
/> |
||||
<Tool |
||||
Name="VCCLCompilerTool" |
||||
Optimization="0" |
||||
AdditionalIncludeDirectories=""$(SolutionDir)";"$(SolutionDir)..\libclamav";"$(SolutionDir)compat";"$(SolutionDir)3rdparty\zlib";"$(SolutionDir)3rdparty\pthreads";"$(SolutionDir)3rdparty\bzip2";"$(SolutionDir).."" |
||||
PreprocessorDefinitions="WIN32_LEAN_AND_MEAN;HAVE_CONFIG_H" |
||||
MinimalRebuild="true" |
||||
BasicRuntimeChecks="3" |
||||
RuntimeLibrary="3" |
||||
UsePrecompiledHeader="0" |
||||
WarningLevel="3" |
||||
DebugInformationFormat="4" |
||||
CompileAs="1" |
||||
DisableSpecificWarnings="4996;4244;4018;4090;4333;4101;4146" |
||||
/> |
||||
<Tool |
||||
Name="VCManagedResourceCompilerTool" |
||||
/> |
||||
<Tool |
||||
Name="VCResourceCompilerTool" |
||||
/> |
||||
<Tool |
||||
Name="VCPreLinkEventTool" |
||||
/> |
||||
<Tool |
||||
Name="VCLinkerTool" |
||||
LinkIncremental="2" |
||||
GenerateDebugInformation="true" |
||||
SubSystem="1" |
||||
TargetMachine="1" |
||||
/> |
||||
<Tool |
||||
Name="VCALinkTool" |
||||
/> |
||||
<Tool |
||||
Name="VCManifestTool" |
||||
/> |
||||
<Tool |
||||
Name="VCXDCMakeTool" |
||||
/> |
||||
<Tool |
||||
Name="VCBscMakeTool" |
||||
/> |
||||
<Tool |
||||
Name="VCFxCopTool" |
||||
/> |
||||
<Tool |
||||
Name="VCAppVerifierTool" |
||||
/> |
||||
<Tool |
||||
Name="VCPostBuildEventTool" |
||||
/> |
||||
</Configuration> |
||||
<Configuration |
||||
Name="Release|Win32" |
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)" |
||||
IntermediateDirectory="$(SolutionDir)build\$(ProjectName)\$(ConfigurationName)" |
||||
ConfigurationType="1" |
||||
CharacterSet="2" |
||||
WholeProgramOptimization="1" |
||||
> |
||||
<Tool |
||||
Name="VCPreBuildEventTool" |
||||
/> |
||||
<Tool |
||||
Name="VCCustomBuildTool" |
||||
/> |
||||
<Tool |
||||
Name="VCXMLDataGeneratorTool" |
||||
/> |
||||
<Tool |
||||
Name="VCWebServiceProxyGeneratorTool" |
||||
/> |
||||
<Tool |
||||
Name="VCMIDLTool" |
||||
/> |
||||
<Tool |
||||
Name="VCCLCompilerTool" |
||||
Optimization="2" |
||||
EnableIntrinsicFunctions="true" |
||||
AdditionalIncludeDirectories=""$(SolutionDir)";"$(SolutionDir)..\libclamav";"$(SolutionDir)compat";"$(SolutionDir)3rdparty\zlib";"$(SolutionDir)3rdparty\pthreads";"$(SolutionDir)3rdparty\bzip2";"$(SolutionDir).."" |
||||
PreprocessorDefinitions="WIN32_LEAN_AND_MEAN;HAVE_CONFIG_H" |
||||
RuntimeLibrary="2" |
||||
EnableFunctionLevelLinking="true" |
||||
UsePrecompiledHeader="0" |
||||
WarningLevel="3" |
||||
DebugInformationFormat="3" |
||||
CompileAs="1" |
||||
DisableSpecificWarnings="4996;4244;4018;4090;4333;4101;4146" |
||||
/> |
||||
<Tool |
||||
Name="VCManagedResourceCompilerTool" |
||||
/> |
||||
<Tool |
||||
Name="VCResourceCompilerTool" |
||||
/> |
||||
<Tool |
||||
Name="VCPreLinkEventTool" |
||||
/> |
||||
<Tool |
||||
Name="VCLinkerTool" |
||||
LinkIncremental="1" |
||||
GenerateDebugInformation="true" |
||||
SubSystem="1" |
||||
OptimizeReferences="2" |
||||
EnableCOMDATFolding="2" |
||||
TargetMachine="1" |
||||
/> |
||||
<Tool |
||||
Name="VCALinkTool" |
||||
/> |
||||
<Tool |
||||
Name="VCManifestTool" |
||||
/> |
||||
<Tool |
||||
Name="VCXDCMakeTool" |
||||
/> |
||||
<Tool |
||||
Name="VCBscMakeTool" |
||||
/> |
||||
<Tool |
||||
Name="VCFxCopTool" |
||||
/> |
||||
<Tool |
||||
Name="VCAppVerifierTool" |
||||
/> |
||||
<Tool |
||||
Name="VCPostBuildEventTool" |
||||
/> |
||||
</Configuration> |
||||
</Configurations> |
||||
<References> |
||||
</References> |
||||
<Files> |
||||
<Filter |
||||
Name="Source Files" |
||||
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" |
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" |
||||
> |
||||
<File |
||||
RelativePath="..\clamscan\clamscan.c" |
||||
> |
||||
</File> |
||||
<File |
||||
RelativePath="..\clamscan\manager.c" |
||||
> |
||||
</File> |
||||
<File |
||||
RelativePath="..\clamscan\others.c" |
||||
> |
||||
</File> |
||||
<Filter |
||||
Name="shared" |
||||
> |
||||
<File |
||||
RelativePath="..\shared\actions.c" |
||||
> |
||||
</File> |
||||
<File |
||||
RelativePath="..\shared\getopt.c" |
||||
> |
||||
</File> |
||||
<File |
||||
RelativePath="..\shared\misc.c" |
||||
> |
||||
</File> |
||||
<File |
||||
RelativePath="..\shared\optparser.c" |
||||
> |
||||
</File> |
||||
<File |
||||
RelativePath="..\shared\output.c" |
||||
> |
||||
</File> |
||||
</Filter> |
||||
<Filter |
||||
Name="compat" |
||||
> |
||||
<File |
||||
RelativePath=".\compat\libgen.c" |
||||
> |
||||
</File> |
||||
</Filter> |
||||
</Filter> |
||||
<Filter |
||||
Name="Header Files" |
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd" |
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" |
||||
> |
||||
</Filter> |
||||
<Filter |
||||
Name="Resource Files" |
||||
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav" |
||||
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}" |
||||
> |
||||
</Filter> |
||||
</Files> |
||||
<Globals> |
||||
</Globals> |
||||
</VisualStudioProject> |
@ -0,0 +1,153 @@ |
||||
/*
|
||||
* Copyright (C) 2009 Sourcefire, Inc. |
||||
* |
||||
* Authors: aCaB <acab@clamav.net> |
||||
* |
||||
* This program is free software; you can redistribute it and/or modify |
||||
* it under the terms of the GNU General Public License version 2 as |
||||
* published by the Free Software Foundation. |
||||
* |
||||
* This program is distributed in the hope that it will be useful, |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
* GNU General Public License for more details. |
||||
* |
||||
* You should have received a copy of the GNU General Public License |
||||
* along with this program; if not, write to the Free Software |
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
||||
* MA 02110-1301, USA. |
||||
*/ |
||||
|
||||
#include <string.h> |
||||
#include "libgen.h" |
||||
|
||||
/*
|
||||
Note: an exact implementation of is not really possible, but this is good enough for us |
||||
|
||||
*path* *dirname* *basename* |
||||
|
||||
"C:" "C:" "" |
||||
"C:\" "C:" "" |
||||
"C:\\" "C:" "" |
||||
"C:file" "C:file" "" |
||||
"C:file\" "C:file" "" |
||||
"C:\file" "C:" "file" |
||||
"C:\file\" "C:" "file" |
||||
"C:\path\file" "C:\path" "file" |
||||
"C:\path\file\" "C:\path" "file" |
||||
|
||||
"\\net" "\\net" "" |
||||
"\\net\" "\\net" "" |
||||
"\\net\share" "\\net" "share" |
||||
"\\net\share\" "\\net" "share" |
||||
"\\net\share\file" "\\net\share" "file" |
||||
"\\net\share\file\" "\\net\share" "file" |
||||
"\\net\share\path\file" "\\net\share\path" "file" |
||||
"\\net\share\path\file\" "\\net\share\path" "file" |
||||
|
||||
"\\?\C:" "\\?\C:" "" |
||||
"\\?\C:\" "\\?\C:" "" |
||||
"\\?\C:\\" "\\?\C:" "" |
||||
"\\?\C:\file" "\\?\C:" "file" |
||||
"\\?\C:\file\" "\\?\C:" "file" |
||||
"\\?\C:\path\file" "\\?\C:\path" "file" |
||||
"\\?\C:\path\file\" "\\?\C:\path" "file" |
||||
|
||||
"\" "" "" |
||||
"\\" "" "" |
||||
"\file" "" "file" |
||||
"\file\" "" "file" |
||||
"\path\file" "\path" "file" |
||||
"\path\file\" "\path" "file" |
||||
|
||||
"." "." "" |
||||
".\" "." "" |
||||
".." ".." "" |
||||
"..\" ".." "" |
||||
"file" "." "file" |
||||
"file\" "." "file" |
||||
"path\file" "path" "file" |
||||
"path\file\" "path" "file" |
||||
|
||||
"\\.\PhysicalDrive0" "\\.\PhysicalDrive0" "" |
||||
"\\.\PhysicalDrive0\other" "\\.\PhysicalDrive0" "other" |
||||
|
||||
"" "." "" |
||||
NULL "." "" |
||||
|
||||
|
||||
Hopefully I didn't miss anything... |
||||
|
||||
*/ |
||||
|
||||
|
||||
static void splitpath(char *path, char **dir, char **base) { |
||||
char *startpath, *endpath; |
||||
int len; |
||||
if(!path || !(len = strlen(path))) { |
||||
*dir = "."; |
||||
*base = ""; |
||||
return; |
||||
} |
||||
|
||||
endpath = &path[len-1]; |
||||
while(endpath >= path && *endpath == '\\') { |
||||
*endpath = '\0'; |
||||
endpath--; |
||||
} |
||||
if(endpath < path) { |
||||
*dir = ""; |
||||
*base = ""; |
||||
return; |
||||
} |
||||
len = endpath-path + 1; |
||||
if(len > 2 && path[0] == '\\' && path[1] == '\\') { |
||||
if(len > 4 && (path[2] == '.' || path[2] == '?') && path[3] == '\\') |
||||
startpath = strchr(path + 4, '\\'); |
||||
else
|
||||
startpath = strchr(path + 2, '\\'); |
||||
|
||||
if(!startpath) { |
||||
*dir = path; |
||||
*base = ""; |
||||
return; |
||||
} |
||||
startpath ++; |
||||
} else startpath = path; |
||||
endpath = strrchr(startpath, '\\'); |
||||
if(!endpath) { |
||||
if(startpath == path) { |
||||
if(!strcmp(path, ".") || !strcmp(path, "..") || (len >= 2 && ((*path >= 'a' && *path <= 'z') || (*path >= 'A' && *path <= 'Z')) && path[1] == ':')) { |
||||
*dir = path; |
||||
*base = ""; |
||||
return; |
||||
} |
||||
*dir = "."; |
||||
*base = path; |
||||
return; |
||||
} |
||||
*base = startpath; |
||||
endpath = startpath - 1; |
||||
startpath = path; |
||||
} else { |
||||
*base = endpath + 1; |
||||
} |
||||
*dir = path; |
||||
|
||||
while(endpath >= startpath && *endpath == '\\') { |
||||
*endpath = '\0'; |
||||
endpath--; |
||||
} |
||||
} |
||||
|
||||
char *dirname(char *path) { |
||||
char *dir, *base; |
||||
splitpath(path, &dir, &base); |
||||
return dir; |
||||
} |
||||
|
||||
char *basename(char *path) { |
||||
char *dir, *base; |
||||
splitpath(path, &dir, &base); |
||||
return base; |
||||
} |
@ -0,0 +1,31 @@ |
||||
/*
|
||||
* Copyright (C) 2009 Sourcefire, Inc. |
||||
* |
||||
* Authors: aCaB <acab@clamav.net> |
||||
* |
||||
* This program is free software; you can redistribute it and/or modify |
||||
* it under the terms of the GNU General Public License version 2 as |
||||
* published by the Free Software Foundation. |
||||
* |
||||
* This program is distributed in the hope that it will be useful, |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
* GNU General Public License for more details. |
||||
* |
||||
* You should have received a copy of the GNU General Public License |
||||
* along with this program; if not, write to the Free Software |
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
||||
* MA 02110-1301, USA. |
||||
*/ |
||||
|
||||
#ifndef __LIBGEN_H |
||||
#define __LIBGEN_H |
||||
|
||||
#if HAVE_CONFIG_H |
||||
#include "clamav-config.h" |
||||
#endif |
||||
|
||||
char *dirname(char *path); |
||||
char *basename(char *path); |
||||
|
||||
#endif /* __LIBGEN_H */ |
@ -0,0 +1,38 @@ |
||||
LIBRARY libclamav |
||||
; cl_stuff - should be exported as is |
||||
EXPORTS cl_debug |
||||
EXPORTS cl_load |
||||
EXPORTS cl_engine_compile |
||||
EXPORTS cl_engine_set_num |
||||
EXPORTS cl_engine_set_str |
||||
EXPORTS cl_engine_free |
||||
EXPORTS cl_engine_new |
||||
EXPORTS cl_strerror |
||||
EXPORTS cl_init |
||||
EXPORTS cl_retdbdir |
||||
EXPORTS cl_scandesc |
||||
EXPORTS cl_scanfile |
||||
EXPORTS cl_cvdfree |
||||
EXPORTS cl_cvdhead |
||||
|
||||
; cli_stuff - should be mangled or exported by ordinal only |
||||
EXPORTS cli_gentemp |
||||
EXPORTS cli_gettmpdir |
||||
EXPORTS cli_regcomp |
||||
EXPORTS cli_regexec |
||||
EXPORTS cli_regfree |
||||
EXPORTS cli_ctime |
||||
|
||||
; shared stuff - to be either double compiled into the tools or treated like cli_xxx |
||||
EXPORTS gettimeofday |
||||
EXPORTS opendir |
||||
EXPORTS readdir |
||||
EXPORTS closedir |
||||
EXPORTS snprintf |
||||
|
||||
; winsock - bridging for now |
||||
EXPORTS htonl |
||||
EXPORTS htons |
||||
EXPORTS send |
||||
EXPORTS select |
||||
EXPORTS gethostbyname |
Loading…
Reference in new issue