diff --git a/Dockerfile b/Dockerfile index ba78c39..6163459 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ghcr.io/wiiu-env/devkitppc:20221228 +FROM ghcr.io/wiiu-env/devkitppc:20230326 WORKDIR tmp_build COPY . . diff --git a/Dockerfile.buildlocal b/Dockerfile.buildlocal index 33c5319..3373ac9 100644 --- a/Dockerfile.buildlocal +++ b/Dockerfile.buildlocal @@ -1,3 +1,3 @@ -FROM ghcr.io/wiiu-env/devkitppc:20221228 +FROM ghcr.io/wiiu-env/devkitppc:20230326 WORKDIR project \ No newline at end of file diff --git a/source/macro_magic.h b/source/macro_magic.h index 32ab3bc..b9a0b49 100644 --- a/source/macro_magic.h +++ b/source/macro_magic.h @@ -7,14 +7,14 @@ struct curl_blob { left zeroes */ }; -#define MAGIC_CHECK_FUNCTION_PTR(function_name, error_return) \ - if (WUT_PP_CAT(s_, function_name) == nullptr) { \ - if (sModuleHandle == nullptr || OSDynLoad_FindExport(sModuleHandle, FALSE, #function_name, (void **) &WUT_PP_CAT(s_, function_name)) != OS_DYNLOAD_OK) { \ - DEBUG_FUNCTION_LINE_ERR("FindExport " #function_name " failed."); \ - return error_return; \ - } else { \ - functionHandles.push_front((uint32_t *) &WUT_PP_CAT(s_, function_name)); \ - } \ +#define MAGIC_CHECK_FUNCTION_PTR(function_name, error_return) \ + if (WUT_PP_CAT(s_, function_name) == nullptr) { \ + if (sModuleHandle == nullptr || OSDynLoad_FindExport(sModuleHandle, OS_DYNLOAD_EXPORT_FUNC, #function_name, (void **) &WUT_PP_CAT(s_, function_name)) != OS_DYNLOAD_OK) { \ + DEBUG_FUNCTION_LINE_ERR("FindExport " #function_name " failed."); \ + return error_return; \ + } else { \ + functionHandles.push_front((uint32_t *) &WUT_PP_CAT(s_, function_name)); \ + } \ } #define MAGIC_FUNCTION_ARG8(res, function_name, error_return, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) \ diff --git a/source/main.cpp b/source/main.cpp index 78ba5ba..a857cb1 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -27,21 +27,21 @@ extern "C" int curl_global_init() { return -1; } - if (OSDynLoad_FindExport(sModuleHandle, FALSE, "setsockopt", (void **) &s_setsockopt) != OS_DYNLOAD_OK) { + if (OSDynLoad_FindExport(sModuleHandle, OS_DYNLOAD_EXPORT_FUNC, "setsockopt", (void **) &s_setsockopt) != OS_DYNLOAD_OK) { DEBUG_FUNCTION_LINE_ERR("FindExport setsockopt failed."); return -2; } - if (OSDynLoad_FindExport(sModuleHandle, true, "cacert_pem", (void **) &s_cacert_pem) != OS_DYNLOAD_OK) { + if (OSDynLoad_FindExport(sModuleHandle, OS_DYNLOAD_EXPORT_DATA, "cacert_pem", (void **) &s_cacert_pem) != OS_DYNLOAD_OK) { DEBUG_FUNCTION_LINE_WARN("FindExport cacert_pem failed."); } - if (OSDynLoad_FindExport(sModuleHandle, true, "cacert_pem_size", (void **) &s_cacert_pem_size) != OS_DYNLOAD_OK) { + if (OSDynLoad_FindExport(sModuleHandle, OS_DYNLOAD_EXPORT_DATA, "cacert_pem_size", (void **) &s_cacert_pem_size) != OS_DYNLOAD_OK) { DEBUG_FUNCTION_LINE_WARN("FindExport cacert_pem_size failed."); } char *(*s_curl_version_tmp)() = nullptr; - if (OSDynLoad_FindExport(sModuleHandle, false, "curl_version", (void **) &s_curl_version_tmp) == OS_DYNLOAD_OK) { + if (OSDynLoad_FindExport(sModuleHandle, OS_DYNLOAD_EXPORT_FUNC, "curl_version", (void **) &s_curl_version_tmp) == OS_DYNLOAD_OK) { const char *expectedCURLVersion = "libcurl/7.84.0"; if (!std::string_view(s_curl_version_tmp()).starts_with(expectedCURLVersion)) { DEBUG_FUNCTION_LINE_WARN("Unexpected libcurl version: %s (expected %s)", s_curl_version_tmp(), expectedCURLVersion); @@ -80,7 +80,7 @@ extern "C" int curlwrapper_setsockopt(int sockfd, int level, int optname, const static void *(*s_curl_easy_setopt)() = nullptr; extern "C" int curl_easy_setopt(void *param1, void *param2, void *param3) { if (s_curl_easy_setopt == nullptr) { - if (sModuleHandle == nullptr || OSDynLoad_FindExport(sModuleHandle, 0, "curl_easy_setopt", (void **) &s_curl_easy_setopt) != OS_DYNLOAD_OK) { + if (sModuleHandle == nullptr || OSDynLoad_FindExport(sModuleHandle, OS_DYNLOAD_EXPORT_FUNC, "curl_easy_setopt", (void **) &s_curl_easy_setopt) != OS_DYNLOAD_OK) { DEBUG_FUNCTION_LINE_ERR("Failed to find export curl_easy_setopt"); return CURLE_FAILED_INIT; } else { @@ -100,7 +100,7 @@ extern "C" int curl_easy_setopt(void *param1, void *param2, void *param3) { static void *(*s_curl_easy_init)() = nullptr; extern "C" void *curl_easy_init() { if (s_curl_easy_init == nullptr) { - if (sModuleHandle == nullptr || OSDynLoad_FindExport(sModuleHandle, 0, "curl_easy_init", (void **) &s_curl_easy_init) != OS_DYNLOAD_OK) { + if (sModuleHandle == nullptr || OSDynLoad_FindExport(sModuleHandle, OS_DYNLOAD_EXPORT_FUNC, "curl_easy_init", (void **) &s_curl_easy_init) != OS_DYNLOAD_OK) { DEBUG_FUNCTION_LINE_ERR("Failed to find export curl_easy_init"); return nullptr; } else {