Add _except_handler4_common
to MSVCRT.DLL
msvcrt-excepthandler4common
Purpose/History
Software intended to run on later than Windows 8/2012, does use _except_handler4_common
function in MSVCRT.DLL
. These steps allow you to add it.
This function is used for error handling in application in Windows 8/2012 and later.
These files come from the Microsoft Visual C++ Runtime Source Code that comes with Visual Studio 2017. The actual error handler code comes from https://github.com/Speedi13/ManualMapped_SEH_32bit
Requirements
- A x86 version of Windows 2003 / XP SP1 with source code available: see build-win2k3
- Recommended: version check unlock to allow run software for Windows Vista and above: kernel32-version-unlock
nullptr
emulation - new feature in C++ not supported in these build tools: extras-nullptr\base\crts\crtw32\extras
folder - where .c/.h files are stored that will be added to MSVCRT.DLL when compiled and linked
Changes
- Add
gs_cookie.c gs_report.c gs_support.c
from the Microsoft Visual C++ Runtime Source Code that comes with Visual Studio 2017 or from below links the\base\crts\crtw32\extras
folder:
https://public-archive.org/hacked_team/rcs-dev%5Cshare/HOME/cod/CRT/crt/src/vcruntime/gs_cookie.c
https://public-archive.org/hacked_team/rcs-dev%5Cshare/HOME/cod/CRT/crt/src/vcruntime/gs_report.c
https://public-archive.org/hacked_team/rcs-dev%5Cshare/HOME/cod/CRT/crt/src/vcruntime/gs_support.c - Add the following
chandler4.cpp
to the\base\crts\crtw32\extras
folder:
- Add (the name of the function)
_except_handler4_common
after_except_handler3
in\base\crts\libw32\lib\dll\obj\i386\ntcrt.def
- In
\base\crts\libw32\lib\dll40\crt40.def
, add
_except_handler4_common = msvcrt._except_handler4_common PRIVATE
after
_except_handler3 = msvcrt._except_handler3 PRIVATE
- Add the following
dirs
file to\base\crts\crtw32\extras
- Add the following
lsources
file to\base\crts\crtw32\extras
- Add the following
sources.nt
file to\base\crts\crtw32\extras
- Add the following
sources
file to\base\crts\crtw32\extras\dll
- Copy
makefile
from\base\crts\crtw32\dllstuff\dll
to\base\crts\crtw32\extras\dll
- Copy
sources
from\base\crts\crtw32\dllstuff\dll_dbg
to\base\crts\crtw32\extras\dll_dbg
- Copy
makefile
from\base\crts\crtw32\dllstuff\dll_dbg
to\base\crts\crtw32\extras\dll_dbg
- Add
extras
at the end of theDIRS
macro in\base\crts\crtw32\dirs
- make sure that the line above it is terminated with\
- Add
..\..\..\crtw32\extras\dll$(DOBJ)\$O\extras.lib
to theLINKLIBS
andOBJLIBFILES
macros in\base\crts\libw32\lib\sources.nt
- make sure that the line above it is terminated with\
- In
\base\crts\makefile.inc
, add
- In
\base\crts\makefile.inc
, after
add
- In
\base\crts\makefile.inc
, after
add
- Run
bcz
in\base\crts
- Overwrite the created
\base\crts\libw32\lib\dll\obj\i386\MSVCRT.DLL
in theC:\WINDOWS\SYSTEM32
folder of your Windows XP installation