Skip to content

Commit

Permalink
Sync 9629
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan386 committed Sep 2, 2016
1 parent 41ed4f9 commit 735b215
Show file tree
Hide file tree
Showing 77 changed files with 1,161 additions and 442 deletions.
15 changes: 10 additions & 5 deletions BugTrap/BugTrap_14.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,19 @@
<ProjectGuid>{E8CF1ADA-264A-4127-86C2-FD7057D3792C}</ProjectGuid>
<RootNamespace>BugTrap</RootNamespace>
<Keyword>Win32Proj</Keyword>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v140_xp</PlatformToolset>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v140_xp</PlatformToolset>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
Expand Down Expand Up @@ -100,7 +101,7 @@
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\zlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;BUGTRAP_EXPORTS;ZLIB_WINAPI;ZLIB_DLL;_WINSOCK_DEPRECATED_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_ATL_XP_TARGETING;WIN32;_DEBUG;_WINDOWS;_USRDLL;BUGTRAP_EXPORTS;ZLIB_WINAPI;ZLIB_DLL;_WINSOCK_DEPRECATED_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ExceptionHandling>
</ExceptionHandling>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
Expand All @@ -110,13 +111,15 @@
<WarningLevel>Level4</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<AdditionalOptions>/Zc:threadSafeInit- %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<AdditionalDependencies>comctl32.lib;version.lib;shlwapi.lib;ws2_32.lib;wininet.lib;%(AdditionalDependencies)</AdditionalDependencies>
<TargetMachine>MachineX86</TargetMachine>
<SubSystem>Windows</SubSystem>
<AdditionalOptions>nothrownew.obj %(AdditionalOptions)</AdditionalOptions>
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
<MinimumRequiredVersion>5.01</MinimumRequiredVersion>
</Link>
<PreBuildEvent>
<Command>
Expand Down Expand Up @@ -179,7 +182,7 @@
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
<AdditionalIncludeDirectories>..\zlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;BUGTRAP_EXPORTS;ZLIB_DLL;ZLIB_WINAPI;_WINSOCK_DEPRECATED_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_ATL_XP_TARGETING;WIN32;NDEBUG;_WINDOWS;_USRDLL;BUGTRAP_EXPORTS;ZLIB_DLL;ZLIB_WINAPI;_WINSOCK_DEPRECATED_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<ExceptionHandling>
</ExceptionHandling>
Expand All @@ -191,6 +194,7 @@
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
<OmitFramePointers>false</OmitFramePointers>
<ControlFlowGuard>Guard</ControlFlowGuard>
<AdditionalOptions>/Zc:threadSafeInit- %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<AdditionalDependencies>comctl32.lib;version.lib;shlwapi.lib;ws2_32.lib;wininet.lib;%(AdditionalDependencies)</AdditionalDependencies>
Expand All @@ -200,6 +204,7 @@
<TargetMachine>MachineX86</TargetMachine>
<SubSystem>Windows</SubSystem>
<AdditionalOptions>nothrownew.obj %(AdditionalOptions)</AdditionalOptions>
<MinimumRequiredVersion>5.01</MinimumRequiredVersion>
</Link>
<PreBuildEvent>
<Command>
Expand Down Expand Up @@ -397,7 +402,7 @@
<ResourceCompile Include="BugTrap.rc" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\zlib\zlibwapi_12.vcxproj">
<ProjectReference Include="..\zlib\zlibwapi_14.vcxproj">
<Project>{39f34f2c-d42a-41d2-a0bc-54d7972e2bc5}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
Expand Down
11 changes: 1 addition & 10 deletions BugTrap/EnumProcess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,7 @@ CEnumProcess::CEnumProcess(void) :
FGetModuleFileNameEx = (PFGetModuleFileNameEx)GetProcAddress(m_hPsApiDll, "GetModuleFileNameExA");
#endif

OSVERSIONINFO osvi;
osvi.dwOSVersionInfoSize = sizeof(osvi);
GetVersionEx(&osvi);
if (osvi.dwMajorVersion >= 5) // Windows 2000 and newer
if (osvi.dwMinorVersion == 0)
m_dwSystemID = 2; // Windows 2000
else
m_dwSystemID = 4; // Windows XP and newer
else
m_dwSystemID = 8; // Windows NT
m_dwSystemID = 4; // Windows XP and newer
}

m_hKernelDll = GetModuleHandle(_T("KERNEL32.DLL"));
Expand Down
17 changes: 12 additions & 5 deletions Data/DefaultServices.dat
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
M http://cache.w3-hidden.cc/
M http://disobscure.velum-ultra.com/skulls.php
M http://gwc.gallaxial.com/beacon2/gwc.php
M http://gwc.mccarragher.org/skulls/skulls.php
M http://gwctest.zapto.org:1337/
M http://gweb.4octets.co.uk/skulls.php
M http://gweb.dwbo.nl/
M http://gweb2.4octets.co.uk/gwc.php
M http://tenafly5k.com/gwc/skulls.php
M http://webcache.peerproject.org/

2 http://cache.ce3c.be/
2 http://cache.ibel.de/
2 http://cache.peernix.com/gwc.php
2 http://cachechu.navhost.com/skulls.php
2 http://dkac.trillinux.org/dkac/dkac.php
2 http://ping.pongwar.com/
2 http://uk.gnutella.dyslexicfish.net:3559/
Expand Down Expand Up @@ -37,18 +38,21 @@ X http://fascination77.free.fr/cachechu/
X http://p2p.findclan.org/

# Duplicates:
X http://peerproject.org/webcache/
X http://gwc.gallaxial.com/beacon2/gwc

# Died:
# Died / Removed:
X http://1.gc.1e400.net/
X http://beacon.numberzero.org/gwc.php
X http://bootdesu.appspot.com/
X http://buriti2.serveftp.com:8080/skulls.php
X http://cache.hxdsecurity.com/gwc/
X http://cache.leite.us/
X http://cache.peernix.com/gwc.php
X http://cache.trillinux.org.nyud.net:8090/g2/bazooka.php
X http://cache.wru.pl/skulls.php
X http://cache2.bazookanetworks.com/g2/bazooka.php
X http://cache2.leite.us/
X http://cachechu.orgfree.com/
X http://dogma.cloud.bishopston.net:33559/
X http://fischaleck.net/cache/mcache.php
X http://g2cache.zapto.org/skulls.php
Expand All @@ -63,6 +67,7 @@ X http://gwc.iblinx.com:2108/gwc/cgi-bin/fc
X http://gwc.marksieklucki.com/skulls.php
X http://gwc2.wodi.org/skulls.php
X http://gwebcache.ns1.net/
X http://gwebcache.spearforensics.com/
X http://htmlhell.com/
X http://jayl.de/gweb/g2/bazooka.php
X http://karma.cloud.bishopston.net:33559/
Expand All @@ -72,10 +77,12 @@ X http://midian.jayl.de/g2/bazooka.php
X http://news.gallaxial.com/cachechu/
X http://news.mccarragher.org/cachechu/
X http://news.spacesst.com/cachechu/
X http://peerproject.org/webcache/
X http://piz.noip.me/cachechu/
X http://silvers.zyns.com/gwc/dkac.php
X http://spacesst.com/cachechu/
X http://timingsolution.com/curl/
X http://webcache.peerproject.org/
X http://witch.frodoslair.net/gwc/Beacon2/gwc.php
X http://www.ak-electron.eu/Beacon2/gwc.php
X http://www.gofoxy.net/gwc/cgi-bin/fc
Expand All @@ -85,7 +92,7 @@ X http://www.omhub.ru/mibew/view/

#
# Keep these comments at the end
# Last updated 11 Jan 2016
# Last updated 24 Apr 2016
#
# Make sure the different lists are kept sorted in alphabetical order.
#
Expand Down
30 changes: 15 additions & 15 deletions GeoIP/GeoIP.c
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ void _setup_segments(GeoIP * gi) {
unsigned char delim[3];
unsigned char buf[LARGE_SEGMENT_RECORD_LENGTH];
ssize_t silence;
int fno = fileno(gi->GeoIPDatabase);
int fno = _fileno(gi->GeoIPDatabase);

gi->databaseSegments = NULL;

Expand Down Expand Up @@ -571,7 +571,7 @@ void _setup_segments(GeoIP * gi) {
if ( gi->databaseType == GEOIP_CITYCONFIDENCE_EDITION
|| gi->databaseType == GEOIP_CITYCONFIDENCEDIST_EDITION
) {
silence = pread(fileno(gi->GeoIPDatabase), buf, gi->record_length, gi->databaseSegments[0] * 2 * gi->record_length);
silence = pread(_fileno(gi->GeoIPDatabase), buf, gi->record_length, gi->databaseSegments[0] * 2 * gi->record_length);
gi->dyn_seg_size = 0;
for (j = 0; j < gi->record_length; j++) {
gi->dyn_seg_size += (buf[j] << (j * 8));
Expand Down Expand Up @@ -672,7 +672,7 @@ int _check_mtime(GeoIP *gi) {
gi->cache = 0;
return -1;
#else
gi->cache = mmap(NULL, buf.st_size, PROT_READ, MAP_PRIVATE, fileno(gi->GeoIPDatabase), 0);
gi->cache = mmap(NULL, buf.st_size, PROT_READ, MAP_PRIVATE, _fileno(gi->GeoIPDatabase), 0);
if ( gi->cache == MAP_FAILED ) {

fprintf(stderr,"Error remapping file %s when reloading\n",gi->file_path);
Expand All @@ -682,7 +682,7 @@ int _check_mtime(GeoIP *gi) {
}
#endif
} else if ( gi->flags & GEOIP_MEMORY_CACHE ) {
if (pread(fileno(gi->GeoIPDatabase), gi->cache, buf.st_size, 0) != (ssize_t) buf.st_size) {
if (pread(_fileno(gi->GeoIPDatabase), gi->cache, buf.st_size, 0) != (ssize_t) buf.st_size) {
fprintf(stderr,"Error reading file %s when reloading\n",gi->file_path);
return -1;
}
Expand All @@ -700,7 +700,7 @@ int _check_mtime(GeoIP *gi) {
if (gi->flags & GEOIP_INDEX_CACHE) {
gi->index_cache = (unsigned char *) realloc(gi->index_cache, sizeof(unsigned char) * ((gi->databaseSegments[0] * (long)gi->record_length * 2)));
if (gi->index_cache != NULL) {
if (pread(fileno(gi->GeoIPDatabase), gi->index_cache,
if (pread(_fileno(gi->GeoIPDatabase), gi->index_cache,
gi->databaseSegments[0] * (long)gi->record_length * 2, 0 ) != (ssize_t) (gi->databaseSegments[0]*(long)gi->record_length * 2)) {
fprintf(stderr,"Error reading file %s where reloading\n",gi->file_path);
return -1;
Expand All @@ -725,7 +725,7 @@ unsigned int _GeoIP_seek_record_v6 (GeoIP *gi, geoipv6_t ipnum) {
const unsigned char * p;
int j;
ssize_t silence;
int fno = fileno(gi->GeoIPDatabase);
int fno = _fileno(gi->GeoIPDatabase);
_check_mtime(gi);
if ( GeoIP_teredo(gi) )
__GEOIP_PREPARE_TEREDO(&ipnum);
Expand Down Expand Up @@ -810,7 +810,7 @@ unsigned int _GeoIP_seek_record (GeoIP *gi, unsigned long ipnum) {

const unsigned char * p;
int j;
int fno = fileno(gi->GeoIPDatabase);
int fno = _fileno(gi->GeoIPDatabase);
_check_mtime(gi);
for (depth = 31; depth >= 0; depth--) {
if (gi->cache == NULL && gi->index_cache == NULL) {
Expand Down Expand Up @@ -952,7 +952,7 @@ GeoIP* GeoIP_open (const char * filename, int flags) {
return NULL;
} else {
if (flags & (GEOIP_MEMORY_CACHE | GEOIP_MMAP_CACHE) ) {
if (fstat(fileno(gi->GeoIPDatabase), &buf) == -1) {
if (fstat(_fileno(gi->GeoIPDatabase), &buf) == -1) {
fprintf(stderr,"Error stating file %s\n",filename);
free(gi->file_path);
free(gi);
Expand All @@ -964,7 +964,7 @@ GeoIP* GeoIP_open (const char * filename, int flags) {
/* MMAP added my Peter Shipley */
if ( flags & GEOIP_MMAP_CACHE ) {
#if !defined(_WIN32)
gi->cache = mmap(NULL, buf.st_size, PROT_READ, MAP_PRIVATE, fileno(gi->GeoIPDatabase), 0);
gi->cache = mmap(NULL, buf.st_size, PROT_READ, MAP_PRIVATE, _fileno(gi->GeoIPDatabase), 0);
if ( gi->cache == MAP_FAILED ) {
fprintf(stderr,"Error mmaping file %s\n",filename);
free(gi->file_path);
Expand All @@ -976,7 +976,7 @@ GeoIP* GeoIP_open (const char * filename, int flags) {
gi->cache = (unsigned char *) malloc(sizeof(unsigned char) * buf.st_size);

if (gi->cache != NULL) {
if (pread(fileno(gi->GeoIPDatabase),gi->cache, buf.st_size, 0) != (ssize_t) buf.st_size) {
if (pread(_fileno(gi->GeoIPDatabase),gi->cache, buf.st_size, 0) != (ssize_t) buf.st_size) {
fprintf(stderr,"Error reading file %s\n",filename);
free(gi->cache);
free(gi->file_path);
Expand All @@ -987,7 +987,7 @@ GeoIP* GeoIP_open (const char * filename, int flags) {
}
} else {
if (flags & GEOIP_CHECK_CACHE) {
if (fstat(fileno(gi->GeoIPDatabase), &buf) == -1) {
if (fstat(_fileno(gi->GeoIPDatabase), &buf) == -1) {
fprintf(stderr,"Error stating file %s\n",filename);
free(gi->file_path);
free(gi);
Expand All @@ -1004,7 +1004,7 @@ GeoIP* GeoIP_open (const char * filename, int flags) {
if (flags & GEOIP_INDEX_CACHE) {
gi->index_cache = (unsigned char *) malloc(sizeof(unsigned char) * ((gi->databaseSegments[0] * (long)gi->record_length * 2)));
if (gi->index_cache != NULL) {
if (pread(fileno(gi->GeoIPDatabase),gi->index_cache, gi->databaseSegments[0] * (long)gi->record_length * 2, 0) != (size_t) (gi->databaseSegments[0]*(long)gi->record_length * 2)) {
if (pread(_fileno(gi->GeoIPDatabase),gi->index_cache, gi->databaseSegments[0] * (long)gi->record_length * 2, 0) != (size_t) (gi->databaseSegments[0]*(long)gi->record_length * 2)) {
fprintf(stderr,"Error reading file %s\n",filename);
free(gi->databaseSegments);
free(gi->index_cache);
Expand Down Expand Up @@ -1356,7 +1356,7 @@ char *GeoIP_database_info (GeoIP* gi) {
char *retval;
int hasStructureInfo = 0;
ssize_t silence;
int fno = fileno(gi->GeoIPDatabase);
int fno = _fileno(gi->GeoIPDatabase);

if(gi == NULL)
return NULL;
Expand Down Expand Up @@ -1622,7 +1622,7 @@ char *_get_name (GeoIP* gi, unsigned long ipnum) {
record_pointer = seek_org + (2 * gi->record_length - 1) * gi->databaseSegments[0];

if (gi->cache == NULL) {
silence = pread(fileno(gi->GeoIPDatabase), buf, MAX_ORG_RECORD_LENGTH, record_pointer);
silence = pread(_fileno(gi->GeoIPDatabase), buf, MAX_ORG_RECORD_LENGTH, record_pointer);
if ( gi->charset == GEOIP_CHARSET_UTF8 ) {
org_buf = _GeoIP_iso_8859_1__utf8( (const char * ) buf );
} else {
Expand Down Expand Up @@ -1672,7 +1672,7 @@ char *_get_name_v6 (GeoIP* gi, geoipv6_t ipnum) {
record_pointer = seek_org + (2 * gi->record_length - 1) * gi->databaseSegments[0];

if (gi->cache == NULL) {
silence = pread(fileno(gi->GeoIPDatabase), buf, MAX_ORG_RECORD_LENGTH, record_pointer);
silence = pread(_fileno(gi->GeoIPDatabase), buf, MAX_ORG_RECORD_LENGTH, record_pointer);
if ( gi->charset == GEOIP_CHARSET_UTF8 ) {
org_buf = _GeoIP_iso_8859_1__utf8( (const char * ) buf );
} else {
Expand Down
Binary file modified GeoIP/GeoIP.dat
Binary file not shown.
Loading

0 comments on commit 735b215

Please sign in to comment.