Bug fix for bad .exe headers in x64 mode

This commit is contained in:
blueshogun96 2015-07-01 22:04:45 -07:00
parent 416967aed4
commit e61e7f5829
4 changed files with 19 additions and 4 deletions

View file

@ -17,7 +17,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v120</PlatformToolset>
<PlatformToolset>v120_xp</PlatformToolset>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>

View file

@ -23,7 +23,7 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v120</PlatformToolset>
<PlatformToolset>v120_xp</PlatformToolset>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>

View file

@ -329,6 +329,21 @@ void Exe::Export(const char *x_szExeFilename)
}
}
// Write correct SizeOfImage
{
printf( "Exe::Export: Writing Image Size..." );
int CurrentSize = ftell( ExeFile );
// Seek to offset of File Size
fseek( ExeFile, 0x108, SEEK_SET );
// Write calculated size
fwrite( &CurrentSize, sizeof( int ), 1, ExeFile );
printf( "OK\n" );
}
fflush( ExeFile );
cleanup:
if(GetError() != 0)

View file

@ -74,9 +74,9 @@ typedef signed long sint32;
#define _DEBUG_ALLOC
#endif
/*! define this to trace intercepted function calls */
#ifdef _DEBUG
//#ifdef _DEBUG
#define _DEBUG_TRACE
#endif
//#endif
/*! define this to trace warnings */
#define _DEBUG_WARNINGS
/*! define this to trace vertex shader constants */