MatchServer: Calling ZGetObjectA
Hey guys, I'm coding at matchserver, and I was trying to call MMatchServer::GetObjectA in order to get the User's UGradeID that's stored at GetOBjectA + 0x44. Everything I got so far was alot of crashes, so I'm here to ask you guys a little help, take a look at my code:
Code:
public: class MMatchObject * __thiscall MMatchServer::GetObjectA(struct MUID const &)
Code:
int GetGrade(MUID id)
{
DWORD result;
__asm
{
mov eax, MMATCHSERVER_GETINSTANCE // Class instance
call eax
mov ecx, eax
push id
mov eax, ZGetObjectA // Calling the function
call eax
mov result,eax
}
result = result + 0x44; // That's the pointer to User's UGradeID (I guess atleast xP)
return (int)result;
}
Thanks.
Re: MatchServer: Calling ZGetObjectA
I've tried doing this before too.
I guess it's wrong, but it was worth a try.
Code:
int GetUGradeID(MUID ObjectUID)
{
int UGradeID = 0;
__asm
{
mov eax, MMATCHSERVER_GETINSTANCE
call eax
mov ecx, eax
push ObjectUID
add eax, 50
mov eax, MMATCHSERVER_GETOBJECTA
call eax
mov eax, UGradeID
}
return UGradeID;
}
Re: MatchServer: Calling ZGetObjectA
Code:
PUSH 0; lowid
PUSH highid; unsigned long
Re: MatchServer: Calling ZGetObjectA
MUID should be passed as reference.
GetGrade(struct MUID &uidPlayer)
Then push uidPlayer.
Re: MatchServer: Calling ZGetObjectA
Re: MatchServer: Calling ZGetObjectA
Thanks Wiz, it doesn't crash anymore at least, the return seems a little bugged though ([12/29/09 15:04:30] Grade: 108148500), but that's fine, I'll find a way to solve it. Thanks again.
@Linear, your code doesn't work, but thanks anyway =D
Re: MatchServer: Calling ZGetObjectA
Re: MatchServer: Calling ZGetObjectA
Re: MatchServer: Calling ZGetObjectA
Try this.
Code:
int GetUGradeID(const MUID& ObjectUID)
{
int UGradeID = 0;
__asm
{
mov eax, MMATCHSERVER_GETINSTANCE
call eax
mov ecx, eax
push ObjectUID
mov eax, MMATCHSERVER_GETOBJECTA
call eax
mov UGradeID, dword ptr ds:[eax+0x44]
}
return UGradeID;
}
Re: MatchServer: Calling ZGetObjectA
Quote:
Originally Posted by
Lambda
Try this.
Code:
int GetUGradeID(const MUID& ObjectUID)
{
int UGradeID = 0;
__asm
{
mov eax, MMATCHSERVER_GETINSTANCE
call eax
mov ecx, eax
push ObjectUID
mov eax, MMATCHSERVER_GETOBJECTA
call eax
mov UGradeID, dword ptr ds:[eax+0x44]
}
return UGradeID;
}
Thanks, but that's giving me the following error:
Code:
error C2415: improper operand type
at
Code:
mov UGradeID, dword ptr ds:[eax+0x44]
EDIT: BTW, i've tried that:
Code:
mov eax, MMATCHSERVER_GETINSTANCE // Class instance
call eax
mov ecx, eax
push uidObject
mov eax, ZGetObjectA // Calling the function
call eax
mov eax, dword ptr ds:[eax+0x44]
mov UGradeID, eax
It returns the UGradeID well, but crashes after the command is completed.
Any tips?
Re: MatchServer: Calling ZGetObjectA
Quote:
Originally Posted by
cerealnp
Thanks, but that's giving me the following error:
Code:
error C2415: improper operand type
at
Code:
mov UGradeID, dword ptr ds:[eax+0x44]
EDIT: BTW, i've tried that:
Code:
mov eax, MMATCHSERVER_GETINSTANCE // Class instance
call eax
mov ecx, eax
push uidObject
mov eax, ZGetObjectA // Calling the function
call eax
mov eax, dword ptr ds:[eax+0x44]
mov UGradeID, eax
It returns the UGradeID well, but crashes after the command is completed.
Any tips?
Save your registers. (PUSHAD, POPAD)
Re: MatchServer: Calling ZGetObjectA