and built 64-bit DLL.master
setlocal | setlocal | ||||
del snfmulti.dll snfmulti.def libsnfmulti.a | del snfmulti.dll snfmulti.def libsnfmulti.a | ||||
set path=c:\MinGW\bin;%path% | |||||
REM set path=c:\MinGW\bin;%path% | |||||
set path=c:\Program Files\MinGW-W64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin;%path% | |||||
set CXX=c++ | set CXX=c++ | ||||
set LIB=c:\MinGW\lib\libws2_32.a -loleaut32 | |||||
REM set LIB=c:\MinGW\lib\libws2_32.a -loleaut32 | |||||
set LIB="c:\Program Files\MinGW-W64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\x86_64-w64-mingw32\lib\libws2_32.a" -loleaut32 | |||||
set LDFLAGS=-Wl,--output-def=snfmulti.def -Wl,--out-implib=libsnfmulti.a -Wl,-dll | set LDFLAGS=-Wl,--output-def=snfmulti.def -Wl,--out-implib=libsnfmulti.a -Wl,-dll | ||||
%CXX% -shared -o snfmulti.dll %LDFLAGS% snfmultidll.o FilterChain.o GBUdb.o mangler.o scanner.o snfCFGmgr.o snf_engine.o snfGBUdbmgr.o snf_HeaderFinder.o snfLOGmgr.o SNFMulti.o snfNETmgr.o snf_sync.o snf_xci.o snfXCImgr.o base64codec.o configuration.o networking.o threading.o timing.o %LIB% | %CXX% -shared -o snfmulti.dll %LDFLAGS% snfmultidll.o FilterChain.o GBUdb.o mangler.o scanner.o snfCFGmgr.o snf_engine.o snfGBUdbmgr.o snf_HeaderFinder.o snfLOGmgr.o SNFMulti.o snfNETmgr.o snf_sync.o snf_xci.o snfXCImgr.o base64codec.o configuration.o networking.o threading.o timing.o %LIB% |
setlocal | setlocal | ||||
set path=c:\MinGW\bin;%path% | |||||
REM set path=c:\MinGW\bin;%path% | |||||
set path=c:\Program Files\MinGW-W64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin;%path% | |||||
REM set path=c:\Program Files\MinGW-W64\x86_64-8.1.0-win32-seh-rt_v6-rev0\mingw64\bin;%path% | |||||
set CXX=c++ | set CXX=c++ | ||||
set CXXFLAGS=-I../CodeDweller -I../SNFMulti -mthreads -O3 -m32 -D_USE_32BIT_TIME_T | set CXXFLAGS=-I../CodeDweller -I../SNFMulti -mthreads -O3 -m32 -D_USE_32BIT_TIME_T | ||||
del *.o | del *.o |
setlocal | |||||
del snfmulti.dll snfmulti.def libsnfmulti.a | del snfmulti.dll snfmulti.def libsnfmulti.a | ||||
set path=c:\MinGW-64\bin;%path% | |||||
set CXX=x86_64-pc-mingw32-c++ | |||||
set LIB=c:\MinGW-64\x86_64-pc-mingw32\lib64\libws2_32.a -loleaut32 | |||||
REM set path=c:\MinGW-64\bin;%path% | |||||
REM set CXX=x86_64-pc-mingw32-c++ | |||||
REM set LIB=c:\MinGW-64\x86_64-pc-mingw32\lib64\libws2_32.a -loleaut32 | |||||
set path=c:\Program Files\MinGW-W64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin;%path% | |||||
set CXX=c++ | |||||
set LIB="c:\Program Files\MinGW-W64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\x86_64-w64-mingw32\lib\libws2_32.a" -loleaut32 | |||||
set LDFLAGS=-Wl,--output-def=snfmulti.def -Wl,--out-implib=libsnfmulti.a -Wl,-dll | set LDFLAGS=-Wl,--output-def=snfmulti.def -Wl,--out-implib=libsnfmulti.a -Wl,-dll | ||||
%CXX% -shared -o snfmulti.dll %LDFLAGS% snfmultidll.o FilterChain.o GBUdb.o mangler.o scanner.o snfCFGmgr.o snf_engine.o snfGBUdbmgr.o snf_HeaderFinder.o snfLOGmgr.o SNFMulti.o snfNETmgr.o snf_sync.o snf_xci.o snfXCImgr.o base64codec.o configuration.o networking.o threading.o timing.o %LIB% | %CXX% -shared -o snfmulti.dll %LDFLAGS% snfmultidll.o FilterChain.o GBUdb.o mangler.o scanner.o snfCFGmgr.o snf_engine.o snfGBUdbmgr.o snf_HeaderFinder.o snfLOGmgr.o SNFMulti.o snfNETmgr.o snf_sync.o snf_xci.o snfXCImgr.o base64codec.o configuration.o networking.o threading.o timing.o %LIB% |
set path=c:\MinGW-64\bin;%path% | |||||
set CXX=x86_64-pc-mingw32-c++ | |||||
REM set CXX=c++ | |||||
REM set path=c:\MinGW-64\bin;%path% | |||||
REM set CXX=x86_64-pc-mingw32-c++ | |||||
set path=c:\Program Files\MinGW-W64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin;%path% | |||||
set CXX=c++ | |||||
set CXXFLAGS=-I../CodeDweller -I../SNFMulti -mthreads -O3 | set CXXFLAGS=-I../CodeDweller -I../SNFMulti -mthreads -O3 | ||||
del *.o | del *.o | ||||
%CXX% %CXXFLAGS% -c ../SNFMulti/FilterChain.cpp -o FilterChain.o | %CXX% %CXXFLAGS% -c ../SNFMulti/FilterChain.cpp -o FilterChain.o |
Subproject commit d122549f7e64c0a9a2a40011eb28c32dfa64a976 | |||||
Subproject commit c5aed611cba49fe73bd998ab426b07d70c4d9565 |
// | // | ||||
// Provides a full SNFMulti engine with dynamic scanner allocation. | // Provides a full SNFMulti engine with dynamic scanner allocation. | ||||
#ifdef WIN32 | |||||
// Required because threading.hpp includes windows.h. | |||||
#include <winsock2.h> | |||||
#endif | |||||
#include <windows.h> | #include <windows.h> | ||||
#include <stdexcept> | #include <stdexcept> | ||||
#include <cmath> | #include <cmath> | ||||
ScannerInstance::ScannerInstance(snf_RulebaseHandler* RBH, int N) : // Initialize. | ScannerInstance::ScannerInstance(snf_RulebaseHandler* RBH, int N) : // Initialize. | ||||
Ordinal(N), // Ordinal as assigned. | Ordinal(N), // Ordinal as assigned. | ||||
ScanResult(snf_ERROR_UNKNOWN), // No good result yet. | ScanResult(snf_ERROR_UNKNOWN), // No good result yet. | ||||
ScanXHeaders(0,XHeaderReserve), // Pre-allocate some space for our | |||||
ScanXMLLog(0, XMLLogReserve), // result caching buffers (strings) | |||||
ScanClassicLog(0, ClassicReserve) { // so we might not have to later. | |||||
ScanXHeaders(XHeaderReserve, '\0'), // Pre-allocate some space for our | |||||
ScanXMLLog(XMLLogReserve, '\0'), // result caching buffers (strings) | |||||
ScanClassicLog(ClassicReserve, '\0') { // so we might not have to later. | |||||
clearBuffers(); // Clear the buffers. | clearBuffers(); // Clear the buffers. | ||||
open(RBH); // Open the engine handler. | open(RBH); // Open the engine handler. | ||||
} | } | ||||
if(0 == myRulebaseHandler) return snf_ERROR_NO_HANDLE; // If we have no engine, punt! | if(0 == myRulebaseHandler) return snf_ERROR_NO_HANDLE; // If we have no engine, punt! | ||||
IPTestRecord Tester(IPToCheck); // Make up a test record for this IP. | IPTestRecord Tester(IPToCheck); // Make up a test record for this IP. | ||||
myRulebaseHandler->performIPTest(Tester); // Run it past the engine. | myRulebaseHandler->performIPTest(Tester); // Run it past the engine. | ||||
return Tester.R; // IPRange is an enum, so use as an int. | |||||
return static_cast<int>(Tester.R); // IPRange is an enum, so use as an int. | |||||
} | } | ||||
double snfScannerPool::getIPReputation(unsigned long int IPToCheck) { // This is how we get IP reps. | double snfScannerPool::getIPReputation(unsigned long int IPToCheck) { // This is how we get IP reps. |