more security improvements

This commit is contained in:
Silent 2017-04-09 20:25:19 +02:00
parent 6bdd02ffdd
commit f39c7c8d2c
9 changed files with 17 additions and 23 deletions

View file

@ -1,5 +1,4 @@
#define WIN32_LEAN_AND_MEAN
#define _CRT_SECURE_NO_WARNINGS
#define WINVER 0x0501
#define _WIN32_WINNT 0x0501

View file

@ -1,9 +1,8 @@
#define WIN32_LEAN_AND_MEAN
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#define WINVER 0x0501
#define _WIN32_WINNT 0x0501
#define NOMINMAX
#include <windows.h>
#include <mmsystem.h>

View file

@ -85,6 +85,7 @@
<EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
<FloatingPointModel>Fast</FloatingPointModel>
<AdditionalOptions>/Zc:threadSafeInit- /std:c++latest %(AdditionalOptions)</AdditionalOptions>
<SDLCheck>true</SDLCheck>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
@ -115,6 +116,7 @@
<EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
<FloatingPointModel>Fast</FloatingPointModel>
<AdditionalOptions>/Zc:threadSafeInit- /std:c++latest %(AdditionalOptions)</AdditionalOptions>
<SDLCheck>true</SDLCheck>
</ClCompile>
<Link>
<GenerateDebugInformation>false</GenerateDebugInformation>

View file

@ -30,7 +30,7 @@ void CVehicleModelInfo::FindEditableMaterialList()
{
if ( const char* texName = RwTextureGetName(texture) )
{
if ( _strnicmp(texName, "vehiclegrunge256", 16) == 0 )
if ( _stricmp(texName, "vehiclegrunge256") == 0 )
{
if ( materialCount < _countof(m_apDirtMaterials) )
m_apDirtMaterials[materialCount++] = material;
@ -81,7 +81,7 @@ void CCustomCarPlateMgr::PollPlates( RpClump* clump, RpMaterial** materials )
{
if ( const char* texName = RwTextureGetName(texture) )
{
if ( _strnicmp( texName, "carplate", 8 ) == 0 )
if ( _stricmp( texName, "carplate" ) == 0 )
{
assert(numCarplates < NUM_MAX_PLATES);
if ( numCarplates < NUM_MAX_PLATES )
@ -89,7 +89,7 @@ void CCustomCarPlateMgr::PollPlates( RpClump* clump, RpMaterial** materials )
carplates[numCarplates++] = material;
}
}
else if ( _strnicmp( texName, "carpback", 8 ) == 0 )
else if ( _stricmp( texName, "carpback" ) == 0 )
{
assert(numCarpbacks < NUM_MAX_PLATES);
if ( numCarpbacks < NUM_MAX_PLATES )

View file

@ -774,9 +774,7 @@ void DrawMoonWithPhases(int moonColor, float* screenPos, float sizeX, float size
CRGBA* CRGBA::BlendGangColour(uint8_t r, uint8_t g, uint8_t b, uint8_t a)
{
double colourIntensity = static_cast<double>(pCurrZoneInfo->ZoneColour.a) / 255.0;
*this = BlendSqr(CRGBA(r, g, b), HudColour[3], colourIntensity);
this->a = a;
*this = CRGBA(BlendSqr( CRGBA(r, g, b), HudColour[3], colourIntensity ), a);
return this;
}
@ -809,7 +807,7 @@ void DrawRect_HalfPixel_Steam(CRect& rect, const CRGBA& rgba)
char* GetMyDocumentsPath()
{
static char cUserFilesPath[MAX_PATH];
static char* ppTempBufPtr = *GetVer() == 0 ? *AddressByRegion_10<char**>(0x744FE5) : cUserFilesPath;
static char* const ppTempBufPtr = *GetVer() == 0 ? *AddressByRegion_10<char**>(0x744FE5) : cUserFilesPath;
if (ppTempBufPtr[0] == '\0')
{
@ -932,7 +930,7 @@ void SetMultiSamplingLevels( RwUInt32 level )
void MSAAText( char* buffer, const char*, DWORD level )
{
sprintf( buffer, "%ux", 1 << level );
sprintf_s( buffer, 100, "%ux", 1 << level );
}
@ -3189,8 +3187,8 @@ void Patch_SA_10()
// Fixed police scanner names
char* pScannerNames = *(char**)0x4E72D4;
strcpy(pScannerNames + (8*113), "WESTP");
strcpy(pScannerNames + (8*134), "????");
strcpy_s(pScannerNames + (8*113), 8, "WESTP");
strcpy_s(pScannerNames + (8*134), 8, "????");
// Handle IMGs bigger than 4GB
Nop( 0x4065BB, 3 );
@ -3581,8 +3579,8 @@ void Patch_SA_11()
// Fixed police scanner names
char* pScannerNames = *(char**)0x4E7714;
strcpy(pScannerNames + (8*113), "WESTP");
strcpy(pScannerNames + (8*134), "????");
strcpy_s(pScannerNames + (8*113), 8, "WESTP");
strcpy_s(pScannerNames + (8*134), 8, "????");
// 1.01 ONLY
@ -3963,8 +3961,8 @@ void Patch_SA_Steam()
// Fixed police scanner names
char* pScannerNames = *(char**)0x4F2B83;
strcpy(pScannerNames + (8*113), "WESTP");
strcpy(pScannerNames + (8*134), "????");
strcpy_s(pScannerNames + (8*113), 8, "WESTP");
strcpy_s(pScannerNames + (8*134), 8, "????");
// STEAM ONLY
// Proper aspect ratios - why Rockstar, why?

View file

@ -164,7 +164,6 @@ copy /y "$(TargetPath)" "D:\gry\GTA San Andreas clean\scripts\newsteam_r2_lowvio
<ClInclude Include="..\SilentPatch\MemoryMgr.h" />
<ClInclude Include="..\SilentPatch\Patterns.h" />
<ClInclude Include="..\SilentPatch\resource1.h" />
<ClInclude Include="..\SilentPatch\Timer.h" />
<ClInclude Include="AudioHardwareSA.h" />
<ClInclude Include="FLACDecoderSA.h" />
<ClInclude Include="GeneralSA.h" />

View file

@ -68,9 +68,6 @@
<ClInclude Include="..\SilentPatch\MemoryMgr.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\SilentPatch\Timer.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\SilentPatch\FLAC\callback.h">
<Filter>Header Files\FLAC</Filter>
</ClInclude>

View file

@ -3,8 +3,6 @@
#pragma warning(disable:4100) // unreferenced formal parameter
#define WIN32_LEAN_AND_MEAN
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#define NOMINMAX
#define WINVER 0x0502

View file

@ -63,6 +63,7 @@
<EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
<FloatingPointModel>Fast</FloatingPointModel>
<AdditionalOptions>/Zc:threadSafeInit- /std:c++latest %(AdditionalOptions)</AdditionalOptions>
<SDLCheck>true</SDLCheck>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
@ -91,6 +92,7 @@
<EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
<FloatingPointModel>Fast</FloatingPointModel>
<AdditionalOptions>/Zc:threadSafeInit- /std:c++latest %(AdditionalOptions)</AdditionalOptions>
<SDLCheck>true</SDLCheck>
</ClCompile>
<Link>
<GenerateDebugInformation>false</GenerateDebugInformation>