Skip to content

Commit

Permalink
add more logs
Browse files Browse the repository at this point in the history
  • Loading branch information
hzqst committed Oct 8, 2024
1 parent fd86175 commit e6372ec
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
5 changes: 5 additions & 0 deletions asext/meta_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,11 @@ C_DLLEXPORT int Meta_Attach(PLUG_LOADTIME /* now */,
return FALSE;
}

auto serverSize = gpMetaUtilFuncs->pfnGetImageSize(serverBase);
auto serverEnd = (char*)serverBase + serverSize;

LOG_MESSAGE(PLID, "Current server dll range: %p ~ %p!", serverBase, serverEnd);

auto CreateInterface = (CreateInterfaceFn)gpMetaUtilFuncs->pfnGetProcAddress(serverHandle, "CreateInterface");

if (!CreateInterface)
Expand Down
10 changes: 9 additions & 1 deletion fallguys/meta_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,10 @@ C_DLLEXPORT int Meta_Attach(PLUG_LOADTIME /* now */,
return FALSE;
}

auto engineEnd = (char *)engineBase + gpMetaUtilFuncs->pfnGetImageSize(engineBase);
auto engineSize = gpMetaUtilFuncs->pfnGetImageSize(engineBase);
auto engineEnd = (char *)engineBase + engineSize;

LOG_MESSAGE(PLID, "Current engine dll range: %p ~ %p!", engineBase, engineEnd);

auto serverHandle = gpMetaUtilFuncs->pfnGetGameDllHandle();
auto serverBase = gpMetaUtilFuncs->pfnGetGameDllBase();
Expand All @@ -227,6 +230,11 @@ C_DLLEXPORT int Meta_Attach(PLUG_LOADTIME /* now */,
return FALSE;
}

auto serverSize = gpMetaUtilFuncs->pfnGetImageSize(serverBase);
auto serverEnd = (char*)serverBase + serverSize;

LOG_MESSAGE(PLID, "Current server dll range: %p ~ %p!", serverBase, serverEnd);

void *asextHandle = NULL;

#ifdef _WIN32
Expand Down
2 changes: 1 addition & 1 deletion metamod/signatures_template.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

#define PRIVATE_FUNCTION_EXTERN(name) extern fn##name g_pfn_##name; extern fn##name g_call_original_##name;

#define LOCATE_FROM_SIGNATURE(dll, sig) gpMetaUtilFuncs->pfnSearchPattern(dll##Base, gpMetaUtilFuncs->pfnGetImageSize(dll##Base), sig, sizeof(sig) - 1)
#define LOCATE_FROM_SIGNATURE(dll, sig) gpMetaUtilFuncs->pfnSearchPattern(dll##Base, dll##Size, sig, sizeof(sig) - 1)
#define LOCATE_FROM_SIGNATURE_FROM_FUNCTION(func, size, sig) gpMetaUtilFuncs->pfnSearchPattern(func, size, sig, sizeof(sig) - 1)
#define LOCATE_FROM_SYMBOL(dll, sym) gpMetaUtilFuncs->pfnGetProcAddress(dll##Handle, sym)

Expand Down

0 comments on commit e6372ec

Please sign in to comment.