diff --git a/CMakeLists.txt b/CMakeLists.txt index 3016ffe..df72242 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,12 +20,13 @@ add_executable(wibo dll/crt.cpp dll/kernel32.cpp dll/lmgr.cpp + dll/mscoree.cpp + dll/msvcrt.cpp dll/ntdll.cpp dll/ole32.cpp dll/user32.cpp dll/vcruntime.cpp dll/version.cpp - dll/msvcrt.cpp files.cpp handles.cpp loader.cpp diff --git a/dll/mscoree.cpp b/dll/mscoree.cpp new file mode 100644 index 0000000..deeb4f7 --- /dev/null +++ b/dll/mscoree.cpp @@ -0,0 +1,23 @@ +#include "common.h" + +namespace mscoree { + void WIN_FUNC CorExitProcess(int exitCode) { + exit(exitCode); + } +} + + +static void *resolveByName(const char *name) { + if (strcmp(name, "CorExitProcess") == 0) return (void *) mscoree::CorExitProcess; + return nullptr; +} + +wibo::Module lib_mscoree = { + (const char *[]){ + "mscoree", + "mscoree.dll", + nullptr, + }, + resolveByName, + nullptr, +}; diff --git a/dll/msvcrt.cpp b/dll/msvcrt.cpp index 729a73f..df078aa 100644 --- a/dll/msvcrt.cpp +++ b/dll/msvcrt.cpp @@ -27,8 +27,12 @@ static void *resolveByName(const char *name) { wibo::Module lib_msvcrt = { (const char *[]){ + "msvcrt", + "msvcrt.dll", "msvcrt40", "msvcrt40.dll", + "msvcr70", + "msvcr70.dll", nullptr, }, resolveByName, diff --git a/main.cpp b/main.cpp index 50b0d5d..bb73a22 100644 --- a/main.cpp +++ b/main.cpp @@ -77,6 +77,7 @@ extern const wibo::Module lib_bcrypt; extern const wibo::Module lib_crt; extern const wibo::Module lib_kernel32; extern const wibo::Module lib_lmgr; +extern const wibo::Module lib_mscoree; extern const wibo::Module lib_msvcrt; extern const wibo::Module lib_ntdll; extern const wibo::Module lib_ole32; @@ -89,6 +90,7 @@ const wibo::Module * wibo::modules[] = { &lib_crt, &lib_kernel32, &lib_lmgr, + &lib_mscoree, &lib_msvcrt, &lib_ntdll, &lib_ole32,