Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

MatchServer:: MMatchObject Class

Elite Diviner
Joined
Apr 23, 2006
Messages
415
Reaction score
45
Hey guys, here I am, willing for help again =D

I was currently trying to get player's name, and I noticed that most time, players are defined by their UID, or by the MMatchObject class. So, I'm trying to look if there is a pointer to the player's name inside the MMatchObject class, or if there is any other way to get the player name by the UID. I'm not really good at reversing, the only thing i found for now is the player UGradeID (located at MMatchObject + 0x44). Help would be really appreciated. Thanks
 
Elite Diviner
Joined
Apr 23, 2006
Messages
415
Reaction score
45
The player name should be a bit before the UGradeID, since the UGradeID is in the MMatchAccountInfo struct you can access it.

You mean a bit before the UGradeID inside the MMatchObject class?
 
Upvote 0
Skilled Illusionist
Joined
Sep 10, 2007
Messages
380
Reaction score
157
Yes, the MMatchAccountInfo struct is inside the MMatchObject class, the first member is the UserID, so the userid would be.

Code:
const char* szUserID = ( const char* )( pMatchObject + 0x2C )
 
Upvote 0
Elite Diviner
Joined
Apr 23, 2006
Messages
415
Reaction score
45
Yes, the MMatchAccountInfo struct is inside the MMatchObject class, the first member is the UserID, so the userid would be.

Code:
const char* szUserID = ( const char* )( pMatchObject + 0x2C )

Ok, I'll give it a try. Big thanks =D

Edit: It's returning nothing, but may be some mistake i did while calling the function, I'll take a look later.
 
Last edited:
Upvote 0
Praise the Sun!
Loyal Member
Joined
Dec 4, 2007
Messages
2,502
Reaction score
986
+ 2C => UserID
+ 60 or 6C (not sure) is the character name

I'll look it up next week if I need to.
 
Upvote 0
Elite Diviner
Joined
Apr 23, 2006
Messages
415
Reaction score
45
Thanks for the help, but it's weirdly crashing/returning random stuff, depends on the function that I'm hooking...

Take a look at the code:
Code:
const char* GetUserID(const struct MUID &uidObject)
{
	DWORD pObject;
	__asm
	{
		pushad

		mov eax, MMATCHSERVER_GETINSTANCE // Class instance
                call eax
                mov ecx, eax

		push uidObject
		mov eax, ZGetObjectA // MMatchServer::ZGetObjectA
		call eax
		mov pObject,eax

		popad
	}
	const char* szUserID = (const char *) (pObject + 0x2C);
	return szUserID;
}
 
Upvote 0
Skilled Illusionist
Joined
Sep 10, 2007
Messages
380
Reaction score
157
Try this, im not totally sure if it will work, but since the other method is giving you garbage, maybe that one works.

Code:
const char* GetUserID(const struct MUID &uidObject)
{
    const char* p = NULL;

    __asm
    {
        pushad

        mov eax, MMATCHSERVER_GETINSTANCE // Class instance
        call eax
        mov ecx, eax

        push uidObject
        mov eax, ZGetObjectA // MMatchServer::ZGetObjectA
        call eax
        mov eax, dword ptr ds:[eax+0x2C]
        mov p, eax

        popad
    }

    return p;
}
 
Upvote 0
Elite Diviner
Joined
Apr 23, 2006
Messages
415
Reaction score
45
Try this, im not totally sure if it will work, but since the other method is giving you garbage, maybe that one works.

Code:
const char* GetUserID(const struct MUID &uidObject)
{
    const char* p = NULL;

    __asm
    {
        pushad

        mov eax, MMATCHSERVER_GETINSTANCE // Class instance
        call eax
        mov ecx, eax

        push uidObject
        mov eax, ZGetObjectA // MMatchServer::ZGetObjectA
        call eax
        mov eax, dword ptr ds:[eax+0x2C]
        mov p, eax

        popad
    }

    return p;
}

Thanks, but I already tried that, it keeps crashing... I really don't have any idea anymore.
 
Upvote 0
Elite Diviner
Joined
Apr 23, 2006
Messages
415
Reaction score
45
Meh, i dont think that the values have changed since im using it right now and works fine.

Dunno what's the problem then. Take a look:

Code:
void __stdcall OnChannelChatHook(const struct MUID &uidPlayer,const struct MUID &uidChannel,char *szText)
{
	try
	{
		char szBuff[128];
		sprintf( szBuff,"UserID: %s",GetUserID(uidPlayer) );
		ConsoleOutput(szBuff);
	}
	catch(...)
	{
		ConsoleOutput("Error!");
	}
}
Code:
const char* GetUserID(const struct MUID &uidObject)
{
    const char* szUserID = NULL;
    __asm
    {
        pushad

        mov eax, MMATCHSERVER_GETINSTANCE // Class instance
        call eax
        mov ecx, eax

        push uidObject
        mov eax, ZGetObjectA // MMatchServer::ZGetObjectA
        call eax
        mov eax, dword ptr ds:[eax+0x2C]
        mov szUserID, eax

        popad
    }

    return szUserID;
}
BTW, Thanks for the help you're giving =D
 
Last edited:
Upvote 0
Skilled Illusionist
Joined
Sep 10, 2007
Messages
380
Reaction score
157
Oh, i was wrong, the first member is the AID, so the UserID would be 0x30.

So this should finally work.

Code:
const char* GetUserID(const struct MUID &uidObject)
{
    const char* p = NULL;

    __asm
    {
        pushad

        mov eax, MMATCHSERVER_GETINSTANCE // Class instance
        call eax
        mov ecx, eax

        push uidObject
        mov eax, ZGetObjectA // MMatchServer::ZGetObjectA
        call eax
        add eax, 0x30
        mov p, eax

        popad
    }

    return p;
}
 
Upvote 0
Elite Diviner
Joined
Apr 23, 2006
Messages
415
Reaction score
45
Oh, i was wrong, the first member is the AID, so the UserID would be 0x30.

So this should finally work.

Code:
const char* GetUserID(const struct MUID &uidObject)
{
    const char* p = NULL;

    __asm
    {
        pushad

        mov eax, MMATCHSERVER_GETINSTANCE // Class instance
        call eax
        mov ecx, eax

        push uidObject
        mov eax, ZGetObjectA // MMatchServer::ZGetObjectA
        call eax
        add eax, 0x30
        mov p, eax

        popad
    }

    return p;
}

Yaay, it worked now, big Thanks <3
 
Upvote 0
Joined
Oct 8, 2006
Messages
446
Reaction score
27
if I'm not wrong..this can work.

Code:
const char* GetCharName(const struct MUID &uidObject)
{
    const char* p = NULL;

    __asm
    {
        pushad

        mov eax, MMATCHSERVER__GETINSTANCE // Class instance
        call eax
        mov ecx, eax

        push uidObject
        mov eax, MMATCHSERVER__GETOBJECTA // MMatchServer::ZGetObjectA
        call eax
        mov eax, dword ptr ds:[eax+0x58]
        add eax,[COLOR=Red]4[/COLOR]
        mov p,eax

        popad
    }

    return p;
}
P.D.:it works matchserver 2008 still can't find it for 2007 ):
 
Last edited:
Upvote 0
Elite Diviner
Joined
Apr 23, 2006
Messages
415
Reaction score
45
if I'm not wrong..this can work.

Code:
const char* GetCharName(const struct MUID &uidObject)
{
    const char* p = NULL;

    __asm
    {
        pushad

        mov eax, MMATCHSERVER__GETINSTANCE // Class instance
        call eax
        mov ecx, eax

        push uidObject
        mov eax, MMATCHSERVER__GETOBJECTA // MMatchServer::ZGetObjectA
        call eax
        mov eax, dword ptr ds:[eax+0x58]
        add eax,[COLOR=Red]4[/COLOR]
        mov p,eax

        popad
    }

    return p;
}
P.D.:it works matchserver 2008 still can't find it for 2007 ):

Yea, I'm using 2007 and it doesn't work. Thanks anyway =D
 
Upvote 0
Back
Top