static link to MFC, c runtime, zlib, libpng
This commit is contained in:
parent
0caa163467
commit
49523c372c
|
@ -24,7 +24,7 @@
|
||||||
OutputDirectory="$(ProjectDir)$(PlatformName)\$(ConfigurationName)"
|
OutputDirectory="$(ProjectDir)$(PlatformName)\$(ConfigurationName)"
|
||||||
IntermediateDirectory="$(ProjectDir)$(PlatformName)\$(ConfigurationName)_temp"
|
IntermediateDirectory="$(ProjectDir)$(PlatformName)\$(ConfigurationName)_temp"
|
||||||
ConfigurationType="1"
|
ConfigurationType="1"
|
||||||
UseOfMFC="2"
|
UseOfMFC="1"
|
||||||
CharacterSet="0"
|
CharacterSet="0"
|
||||||
BuildLogFile="$(IntDir)\$(ProjectName)_BuildLog.htm"
|
BuildLogFile="$(IntDir)\$(ProjectName)_BuildLog.htm"
|
||||||
>
|
>
|
||||||
|
@ -58,7 +58,7 @@
|
||||||
MinimalRebuild="true"
|
MinimalRebuild="true"
|
||||||
BasicRuntimeChecks="3"
|
BasicRuntimeChecks="3"
|
||||||
SmallerTypeCheck="false"
|
SmallerTypeCheck="false"
|
||||||
RuntimeLibrary="3"
|
RuntimeLibrary="1"
|
||||||
StructMemberAlignment="0"
|
StructMemberAlignment="0"
|
||||||
BufferSecurityCheck="false"
|
BufferSecurityCheck="false"
|
||||||
EnableFunctionLevelLinking="false"
|
EnableFunctionLevelLinking="false"
|
||||||
|
@ -85,14 +85,14 @@
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCLinkerTool"
|
Name="VCLinkerTool"
|
||||||
AdditionalDependencies="zlib1d.lib libpng13d.lib"
|
AdditionalDependencies="nafxcwd.lib libcmtd.lib zlibd.lib libpngd.lib"
|
||||||
OutputFile="$(OutDir)\VisualBoyAdvance.exe"
|
OutputFile="$(OutDir)\VisualBoyAdvance.exe"
|
||||||
Version=""
|
Version=""
|
||||||
LinkIncremental="2"
|
LinkIncremental="2"
|
||||||
AdditionalLibraryDirectories=""
|
AdditionalLibraryDirectories=""
|
||||||
GenerateManifest="true"
|
GenerateManifest="true"
|
||||||
AdditionalManifestDependencies="type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'"
|
AdditionalManifestDependencies="type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'"
|
||||||
IgnoreDefaultLibraryNames=""
|
IgnoreDefaultLibraryNames="nafxcwd.lib;libcmtd.lib"
|
||||||
GenerateDebugInformation="true"
|
GenerateDebugInformation="true"
|
||||||
SubSystem="2"
|
SubSystem="2"
|
||||||
OptimizeReferences="1"
|
OptimizeReferences="1"
|
||||||
|
@ -129,7 +129,7 @@
|
||||||
OutputDirectory="$(ProjectDir)$(PlatformName)\$(ConfigurationName)"
|
OutputDirectory="$(ProjectDir)$(PlatformName)\$(ConfigurationName)"
|
||||||
IntermediateDirectory="$(ProjectDir)$(PlatformName)\$(ConfigurationName)_temp"
|
IntermediateDirectory="$(ProjectDir)$(PlatformName)\$(ConfigurationName)_temp"
|
||||||
ConfigurationType="1"
|
ConfigurationType="1"
|
||||||
UseOfMFC="2"
|
UseOfMFC="1"
|
||||||
UseOfATL="0"
|
UseOfATL="0"
|
||||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||||
CharacterSet="0"
|
CharacterSet="0"
|
||||||
|
@ -166,7 +166,7 @@
|
||||||
WholeProgramOptimization="true"
|
WholeProgramOptimization="true"
|
||||||
AdditionalIncludeDirectories=""..\..\..\dependencies\File_Extractor-0.4.3\fex";..\..\..\dependencies\msvc"
|
AdditionalIncludeDirectories=""..\..\..\dependencies\File_Extractor-0.4.3\fex";..\..\..\dependencies\msvc"
|
||||||
PreprocessorDefinitions="WIN32;_WINDOWS;NDEBUG;GBA_LOGGING;OEMRESOURCE;MMX;ASM;FINAL_VERSION;BKPT_SUPPORT;_CRT_SECURE_NO_DEPRECATE;HAS_FILE_EXTRACTOR"
|
PreprocessorDefinitions="WIN32;_WINDOWS;NDEBUG;GBA_LOGGING;OEMRESOURCE;MMX;ASM;FINAL_VERSION;BKPT_SUPPORT;_CRT_SECURE_NO_DEPRECATE;HAS_FILE_EXTRACTOR"
|
||||||
RuntimeLibrary="2"
|
RuntimeLibrary="0"
|
||||||
BufferSecurityCheck="false"
|
BufferSecurityCheck="false"
|
||||||
EnableEnhancedInstructionSet="0"
|
EnableEnhancedInstructionSet="0"
|
||||||
FloatingPointModel="2"
|
FloatingPointModel="2"
|
||||||
|
@ -193,7 +193,7 @@
|
||||||
Name="VCLinkerTool"
|
Name="VCLinkerTool"
|
||||||
RegisterOutput="false"
|
RegisterOutput="false"
|
||||||
IgnoreImportLibrary="false"
|
IgnoreImportLibrary="false"
|
||||||
AdditionalDependencies="zlib1.lib libpng13.lib"
|
AdditionalDependencies="nafxcw.lib libcmt.lib zlib.lib libpng.lib"
|
||||||
OutputFile="$(OutDir)\VisualBoyAdvance.exe"
|
OutputFile="$(OutDir)\VisualBoyAdvance.exe"
|
||||||
Version=""
|
Version=""
|
||||||
LinkIncremental="0"
|
LinkIncremental="0"
|
||||||
|
@ -201,7 +201,7 @@
|
||||||
AdditionalLibraryDirectories=""
|
AdditionalLibraryDirectories=""
|
||||||
GenerateManifest="true"
|
GenerateManifest="true"
|
||||||
AdditionalManifestDependencies="type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'"
|
AdditionalManifestDependencies="type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'"
|
||||||
IgnoreDefaultLibraryNames=""
|
IgnoreDefaultLibraryNames="nafxcw.lib;libcmt.lib"
|
||||||
GenerateDebugInformation="false"
|
GenerateDebugInformation="false"
|
||||||
AssemblyDebug="2"
|
AssemblyDebug="2"
|
||||||
GenerateMapFile="false"
|
GenerateMapFile="false"
|
||||||
|
|
|
@ -6,94 +6,6 @@
|
||||||
#include <zlib.h>
|
#include <zlib.h>
|
||||||
#include "protect.h"
|
#include "protect.h"
|
||||||
|
|
||||||
/* ========================================================================= */
|
|
||||||
// read below
|
|
||||||
static unsigned long gf2_matrix_times(mat, vec)
|
|
||||||
unsigned long *mat;
|
|
||||||
unsigned long vec;
|
|
||||||
{
|
|
||||||
unsigned long sum;
|
|
||||||
|
|
||||||
sum = 0;
|
|
||||||
while (vec) {
|
|
||||||
if (vec & 1)
|
|
||||||
sum ^= *mat;
|
|
||||||
vec >>= 1;
|
|
||||||
mat++;
|
|
||||||
}
|
|
||||||
return sum;
|
|
||||||
}
|
|
||||||
|
|
||||||
// read below
|
|
||||||
static void gf2_matrix_square(square, mat)
|
|
||||||
unsigned long *square;
|
|
||||||
unsigned long *mat;
|
|
||||||
{
|
|
||||||
int n;
|
|
||||||
|
|
||||||
for (n = 0; n < 32; n++)
|
|
||||||
square[n] = gf2_matrix_times(mat, mat[n]);
|
|
||||||
}
|
|
||||||
|
|
||||||
// This function is taken from zlib 1.2.3 (file: crc32.c)
|
|
||||||
// It is not exported by the DLL even though it is listed in zlib.h (bug?)
|
|
||||||
uLong ZEXPORT crc32_combine(crc1, crc2, len2)
|
|
||||||
uLong crc1;
|
|
||||||
uLong crc2;
|
|
||||||
z_off_t len2;
|
|
||||||
{
|
|
||||||
int n;
|
|
||||||
unsigned long row;
|
|
||||||
unsigned long even[32]; /* even-power-of-two zeros operator */
|
|
||||||
unsigned long odd[32]; /* odd-power-of-two zeros operator */
|
|
||||||
|
|
||||||
/* degenerate case */
|
|
||||||
if (len2 == 0)
|
|
||||||
return crc1;
|
|
||||||
|
|
||||||
/* put operator for one zero bit in odd */
|
|
||||||
odd[0] = 0xedb88320L; /* CRC-32 polynomial */
|
|
||||||
row = 1;
|
|
||||||
for (n = 1; n < 32; n++) {
|
|
||||||
odd[n] = row;
|
|
||||||
row <<= 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* put operator for two zero bits in even */
|
|
||||||
gf2_matrix_square(even, odd);
|
|
||||||
|
|
||||||
/* put operator for four zero bits in odd */
|
|
||||||
gf2_matrix_square(odd, even);
|
|
||||||
|
|
||||||
/* apply len2 zeros to crc1 (first square will put the operator for one
|
|
||||||
zero byte, eight zero bits, in even) */
|
|
||||||
do {
|
|
||||||
/* apply zeros operator for this bit of len2 */
|
|
||||||
gf2_matrix_square(even, odd);
|
|
||||||
if (len2 & 1)
|
|
||||||
crc1 = gf2_matrix_times(even, crc1);
|
|
||||||
len2 >>= 1;
|
|
||||||
|
|
||||||
/* if no more bits set, then done */
|
|
||||||
if (len2 == 0)
|
|
||||||
break;
|
|
||||||
|
|
||||||
/* another iteration of the loop with odd and even swapped */
|
|
||||||
gf2_matrix_square(odd, even);
|
|
||||||
if (len2 & 1)
|
|
||||||
crc1 = gf2_matrix_times(odd, crc1);
|
|
||||||
len2 >>= 1;
|
|
||||||
|
|
||||||
/* if no more bits set, then done */
|
|
||||||
} while (len2 != 0);
|
|
||||||
|
|
||||||
/* return combined crc */
|
|
||||||
crc1 ^= crc2;
|
|
||||||
return crc1;
|
|
||||||
}
|
|
||||||
/* ========================================================================= */
|
|
||||||
|
|
||||||
|
|
||||||
char *unprotect_buffer(unsigned char *buffer, size_t buffer_len)
|
char *unprotect_buffer(unsigned char *buffer, size_t buffer_len)
|
||||||
{
|
{
|
||||||
unsigned char *p = buffer, *end_p = p+buffer_len-1, previous = 0x11;
|
unsigned char *p = buffer, *end_p = p+buffer_len-1, previous = 0x11;
|
||||||
|
|
Loading…
Reference in New Issue