1
0
mirror of https://github.com/alliedmodders/metamod-source.git synced 2024-12-01 13:24:25 +01:00

Added a check for relative jump in GetUserMessageInfo's vtable entry

Also, added more games to list...

--HG--
extra : convert_revision : svn%3Ac2935e3e-5518-0410-8daf-afa5dab7d4e3/trunk%40351
This commit is contained in:
Scott Ehlert 2007-03-26 19:44:04 +00:00
parent 3d38398eca
commit fbaa9221e3
2 changed files with 16 additions and 1 deletions

View File

@ -553,6 +553,19 @@ bool CSmmAPI::CacheUserMessages()
vfunc = vtable[info.vtblindex];
}
/* Oh dear, we have a relative jump on our hands
* PVK II on Windows made me do this, but I suppose it doesn't hurt to check this on Linux too...
*/
if (*vfunc == '\xE9')
{
/* Get address from displacement...
*
* Add 5 because it's relative to next instruction:
* Opcode <1 byte> + 32-bit displacement <4 bytes>
*/
vfunc = vfunc + *reinterpret_cast<unsigned int *>(vfunc + 1) + 5;
}
UserMsgDict *dict = NULL;
if (vcmp(vfunc, MSGCLASS_SIG, MSGCLASS_SIGLEN))

View File

@ -10,7 +10,9 @@ User Message API Functions - GetUserMessageCount(), FindUserMessage(), GetUserMe
- Day of Defeat: Source
- Dystopia
- Garry's Mod 10
- Half-Life 2: Capture the Flag
- Half-Life 2: Deathmatch
- The Hidden: Source
- Pirates, Vikings, and Knights II
- The Ship
- SourceForts