Skip to content

Commit

Permalink
CorExitProcess for armcc_41_1440 (#44)
Browse files Browse the repository at this point in the history
* Implement CorExitProcess for armcc_41_1440

* Fix function signature, add dll coverage
  • Loading branch information
ethteck authored Sep 12, 2023
1 parent d27fc94 commit 6a42066
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
23 changes: 23 additions & 0 deletions dll/mscoree.cpp
Original file line number Diff line number Diff line change
@@ -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,
};
4 changes: 4 additions & 0 deletions dll/msvcrt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -89,6 +90,7 @@ const wibo::Module * wibo::modules[] = {
&lib_crt,
&lib_kernel32,
&lib_lmgr,
&lib_mscoree,
&lib_msvcrt,
&lib_ntdll,
&lib_ole32,
Expand Down

0 comments on commit 6a42066

Please sign in to comment.