diff --git a/cmake/modules/FindCoreClrEmbed.cmake b/cmake/modules/FindCoreClrEmbed.cmake index 83f0356e1..c61acd165 100644 --- a/cmake/modules/FindCoreClrEmbed.cmake +++ b/cmake/modules/FindCoreClrEmbed.cmake @@ -11,6 +11,14 @@ if (UNIX) set(CORECLR_SUBARCH "arm64") endif() endif() +if (APPLE) + if (CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64") + set(CORECLR_ARCH "osx-arm64") + set(CORECLR_SUBARCH "arm64") + else() + set(CORECLR_ARCH "osx-x64") + endif() +endif() if (NOT DOTNET_EXECUTABLE) set(DOTNET_EXECUTABLE dotnet) diff --git a/lib/libimhex/include/hex/api/content_registry.hpp b/lib/libimhex/include/hex/api/content_registry.hpp index 4023b63f6..becb662f1 100644 --- a/lib/libimhex/include/hex/api/content_registry.hpp +++ b/lib/libimhex/include/hex/api/content_registry.hpp @@ -6,6 +6,7 @@ #include #include +#include #include #include #include diff --git a/plugins/script_loader/source/loaders/dotnet/dotnet_loader.cpp b/plugins/script_loader/source/loaders/dotnet/dotnet_loader.cpp index 5f53933b9..a0543c167 100644 --- a/plugins/script_loader/source/loaders/dotnet/dotnet_loader.cpp +++ b/plugins/script_loader/source/loaders/dotnet/dotnet_loader.cpp @@ -63,6 +63,13 @@ namespace hex::script::loader { if (netHostLibrary != nullptr) break; } + if (netHostLibrary == nullptr) { + for (const auto &librariesPath : fs::getDefaultPaths(fs::ImHexPath::Libraries)) { + netHostLibrary = loadLibrary((librariesPath / "libnethost.dylib").c_str()); + if (netHostLibrary != nullptr) + break; + } + } #endif if (netHostLibrary == nullptr) { @@ -75,7 +82,7 @@ namespace hex::script::loader { std::array buffer = { }; size_t bufferSize = buffer.size(); - auto result = get_hostfxr_path_ptr(buffer.data(), &bufferSize, nullptr); + u32 result = get_hostfxr_path_ptr(buffer.data(), &bufferSize, nullptr); if (result != 0) { log::error(hex::format("Could not get hostfxr path! 0x{:X}", result)); return false;