From 5afc353875bfd3f597ced8fc9a39b8da611034f6 Mon Sep 17 00:00:00 2001 From: Scott Ehlert Date: Fri, 11 May 2007 19:14:21 +0000 Subject: [PATCH] Fixed amb277 - failed to get user message list in Kreedz Climbing --HG-- extra : convert_revision : svn%3Ac2935e3e-5518-0410-8daf-afa5dab7d4e3/trunk%40387 --- sourcemm/CSmmAPI.cpp | 13 +++++++++++++ sourcemm/ISmmAPI.h | 16 ++++++++-------- sourcemm/changelog.txt | 3 ++- 3 files changed, 23 insertions(+), 9 deletions(-) diff --git a/sourcemm/CSmmAPI.cpp b/sourcemm/CSmmAPI.cpp index df10955..f047186 100644 --- a/sourcemm/CSmmAPI.cpp +++ b/sourcemm/CSmmAPI.cpp @@ -516,6 +516,11 @@ int CSmmAPI::GetGameDLLVersion() #define MSGCLASS2_SIGLEN 16 #define MSGCLASS2_SIG "\x56\x8B\x74\x24\x2A\x85\xF6\x7C\x2A\x3B\x35\x2A\x2A\x2A\x2A\x7D" #define MSGCLASS2_OFFS 11 + + /* Windows frame pointer sig */ + #define MSGCLASS3_SIGLEN 18 + #define MSGCLASS3_SIG "\x55\x8B\xEC\x51\x89\x2A\x2A\x8B\x2A\x2A\x50\x8B\x0D\x2A\x2A\x2A\x2A\xE8" + #define MSGCLASS3_OFFS 13 #elif defined OS_LINUX /* No frame pointer sig */ #define MSGCLASS_SIGLEN 14 @@ -586,6 +591,14 @@ bool CSmmAPI::CacheUserMessages() /* Get address of CUserMessages::m_UserMessages */ dict = reinterpret_cast(*userMsgClass); #endif + #ifdef OS_WIN32 + } else if (vcmp(vfunc, MSGCLASS3_SIG, MSGCLASS3_SIGLEN)) { + /* Get address of CUserMessages instance */ + char **userMsgClass = *reinterpret_cast(vfunc + MSGCLASS3_OFFS); + + /* Get address of CUserMessages::m_UserMessages */ + dict = reinterpret_cast(*userMsgClass); + #endif } if (dict) diff --git a/sourcemm/ISmmAPI.h b/sourcemm/ISmmAPI.h index 3b2d6b6..d4d04f2 100644 --- a/sourcemm/ISmmAPI.h +++ b/sourcemm/ISmmAPI.h @@ -205,7 +205,7 @@ public: // Added in 1.1.2 (1:1) */ virtual int FormatIface(char iface[], unsigned int maxlength) =0; -public: // Added in 1.2 (1:2) +public: // Added in 1.2.0 (1:2) /** * @brief Searches for an interface for you. * @@ -245,7 +245,7 @@ public: // Added in 1.2.2 (1:3) */ virtual void ClientConPrintf(edict_t *client, const char *fmt, ...) =0; -public: // Added in 1.3 (1:4) +public: // Added in 1.3.0 (1:4) /** * @brief Wrapper around InterfaceSearch(). Assumes no maximum. * This is designed to replace the fact that searches only went upwards. @@ -262,7 +262,7 @@ public: // Added in 1.3 (1:4) */ virtual void *VInterfaceMatch(CreateInterfaceFn fn, const char *iface, int min=-1) =0; -public: // Added in 1.4 (1:5) +public: // Added in 1.4.0 (1:5) /** * @brief Tells SourceMM to add VSP hooking capability to plugins. * @@ -303,7 +303,7 @@ public: // Added in 1.4 (1:5) * @return Message name, or NULL on failure. */ virtual const char *GetUserMessage(int index, int *size=NULL) =0; -public: // Added in 1.4.1 (1:6) +public: // Added in 1.5.0 (1:6) /** * @brief Returns the highest interface version of IServerPluginCallbacks that the engine supports. * This is useful for games that run on older versions of the Source engine, such as The Ship. @@ -320,11 +320,11 @@ public: // Added in 1.4.1 (1:6) * * 1.1.0 Bumped API to 1:0. The breaking changes occurred in SourceHook and the plugin API. * 1.1.2 Added API call for generating iface names. - * 1.2 Added API more helper functions and new SourceHook version. + * 1.2.0 Added API more helper functions and new SourceHook version. * 1.2.2 Added API for printing to client console (with string formatting). - * 1.3 Added new interface search API. - * 1.4 Added VSP listener and user message API. - * 1.4.1 Added API for getting highest supported version of IServerPluginCallbacks. + * 1.3.0 Added new interface search API. + * 1.4.0 Added VSP listener and user message API. + * 1.5.0 Added API for getting highest supported version of IServerPluginCallbacks. */ #endif //_INCLUDE_ISMM_API_H diff --git a/sourcemm/changelog.txt b/sourcemm/changelog.txt index cd41d76..9c676d4 100644 --- a/sourcemm/changelog.txt +++ b/sourcemm/changelog.txt @@ -1,7 +1,8 @@ -2007/??/?? 1.4.1: +2007/??/?? 1.5.0: - Added API for getting highest supported IServerPluginCallbacks interface version. - The client version of the "meta" command should now work on games that use ServerGameClients004 and beyond. + - Fixed amb277 (failed to get user message list in Kreezd Climbing). 2007/04/05 1.4.0: - Added API functions for retrieving User Message info without potentially crashing.