From 4fbda29751455e7ef9d1f1e765983eb34dcfbca1 Mon Sep 17 00:00:00 2001 From: hzqst <113660872@qq.com> Date: Tue, 8 Oct 2024 15:19:32 +0800 Subject: [PATCH] fix compile error --- fallguys/meta_api.cpp | 20 ++++++++++---------- metamod/signatures_template.h | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/fallguys/meta_api.cpp b/fallguys/meta_api.cpp index b535408..c360b1d 100644 --- a/fallguys/meta_api.cpp +++ b/fallguys/meta_api.cpp @@ -247,7 +247,7 @@ C_DLLEXPORT int Meta_Attach(PLUG_LOADTIME /* now */, return FALSE; } - LOG_MESSAGE(PLID, "Engine Type: %s", gpMetaUtilFuncs->pfnGetEngineType()); + LOG_MESSAGE(PLID, "Current engine type: %s!", gpMetaUtilFuncs->pfnGetEngineType()); #ifdef _WIN32 @@ -363,8 +363,8 @@ C_DLLEXPORT int Meta_Attach(PLUG_LOADTIME /* now */, { char pattern[] = host_frametime_Signature; - auto searchBegin = (PUCHAR)engineBase; - auto searchEnd = (PUCHAR)engineBase + gpMetaUtilFuncs->pfnGetImageSize(engineBase); + auto searchBegin = (char *)engineBase; + auto searchEnd = (char *)engineBase + gpMetaUtilFuncs->pfnGetImageSize(engineBase); while (1) { auto pFound = LOCATE_FROM_SIGNATURE_FROM_FUNCTION(searchBegin, searchEnd - searchBegin, pattern); @@ -384,7 +384,7 @@ C_DLLEXPORT int Meta_Attach(PLUG_LOADTIME /* now */, break; } - searchBegin = (PUCHAR)pFound + sizeof(pattern) - 1; + searchBegin = (char *)pFound + sizeof(pattern) - 1; } else { @@ -425,8 +425,8 @@ C_DLLEXPORT int Meta_Attach(PLUG_LOADTIME /* now */, { char pattern[] = sv_areanodes_Signature; - auto searchBegin = (PUCHAR)engineBase; - auto searchEnd = (PUCHAR)engineBase + gpMetaUtilFuncs->pfnGetImageSize(engineBase); + auto searchBegin = (char *)engineBase; + auto searchEnd = (char *)engineBase + gpMetaUtilFuncs->pfnGetImageSize(engineBase); while (1) { auto pFound = LOCATE_FROM_SIGNATURE_FROM_FUNCTION(searchBegin, searchEnd - searchBegin, pattern); @@ -446,7 +446,7 @@ C_DLLEXPORT int Meta_Attach(PLUG_LOADTIME /* now */, break; } - searchBegin = (PUCHAR)pFound + sizeof(pattern) - 1; + searchBegin = (char *)pFound + sizeof(pattern) - 1; } else { @@ -466,8 +466,8 @@ C_DLLEXPORT int Meta_Attach(PLUG_LOADTIME /* now */, { char pattern[] = PF_SetGroupMask_Signature; - auto searchBegin = (PUCHAR)engineBase; - auto searchEnd = (PUCHAR)engineBase + gpMetaUtilFuncs->pfnGetImageSize(engineBase); + auto searchBegin = (char *)engineBase; + auto searchEnd = (char *)engineBase + gpMetaUtilFuncs->pfnGetImageSize(engineBase); while (1) { auto pFound = LOCATE_FROM_SIGNATURE_FROM_FUNCTION(searchBegin, searchEnd - searchBegin, pattern); @@ -506,7 +506,7 @@ C_DLLEXPORT int Meta_Attach(PLUG_LOADTIME /* now */, } } - searchBegin = (PUCHAR)pFound + sizeof(pattern) - 1; + searchBegin = (char *)pFound + sizeof(pattern) - 1; } else { diff --git a/metamod/signatures_template.h b/metamod/signatures_template.h index 4e75e1b..1ebebcf 100644 --- a/metamod/signatures_template.h +++ b/metamod/signatures_template.h @@ -106,7 +106,7 @@ if (!Caller_of_##name)\ LOG_ERROR(PLID, "Failed to locate Caller of " #name " from " #dll " dll !");\ return FALSE;\ }\ -g_pfn_##name = g_call_original_##name = (decltype(g_pfn_##name))gpMetaUtilFuncs->pfnGetNextCallAddr(Caller_of_##name + (sizeof(name##_Signature) - 1) + (offset), 1);\ +g_pfn_##name = g_call_original_##name = (decltype(g_pfn_##name))gpMetaUtilFuncs->pfnGetNextCallAddr(Caller_of_##name + (sizeof(name##_Signature_##ty) - 1) + (offset), 1);\ if (!gpMetaUtilFuncs->pfnIsAddressInModuleRange((void *)g_pfn_##name, dll##Base))\ {\ LOG_ERROR(PLID, "Failed to locate " #name " from " #dll " dll !"); \