MatchServer: Calling ZGetObjectA

Results 1 to 12 of 12
  1. #1
    Account Upgraded | Title Enabled! cerealnp is offline
    MemberRank
    Apr 2006 Join Date
    BrazilLocation
    441Posts

    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.


  2. #2

    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;
    }
    Last edited by Linear88; 29-12-09 at 05:09 PM.

  3. #3
    Account Upgraded | Title Enabled! x1nixmzeng is offline
    MemberRank
    Nov 2007 Join Date
    England, UKLocation
    240Posts

    Re: MatchServer: Calling ZGetObjectA

    Code:
    PUSH 0; lowid
    PUSH highid; unsigned long
    Last edited by x1nixmzeng; 29-12-09 at 05:17 PM.

  4. #4
    Praise the Sun! Solaire is offline
    MemberRank
    Dec 2007 Join Date
    Undead BurgLocation
    2,862Posts

    Re: MatchServer: Calling ZGetObjectA

    MUID should be passed as reference.

    GetGrade(struct MUID &uidPlayer)

    Then push uidPlayer.

  5. #5

    Re: MatchServer: Calling ZGetObjectA

    Thanks for the help.

  6. #6
    Account Upgraded | Title Enabled! cerealnp is offline
    MemberRank
    Apr 2006 Join Date
    BrazilLocation
    441Posts

    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
    Last edited by cerealnp; 29-12-09 at 10:00 PM.

  7. #7

    Re: MatchServer: Calling ZGetObjectA

    Getting weird values.

  8. #8
    Account Upgraded | Title Enabled! cerealnp is offline
    MemberRank
    Apr 2006 Join Date
    BrazilLocation
    441Posts

    Re: MatchServer: Calling ZGetObjectA

    Yeah, me too.

  9. #9
    Programming Addict Lambda is offline
    MemberRank
    Sep 2007 Join Date
    SpainLocation
    393Posts

    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;
    }
    Last edited by Lambda; 29-12-09 at 07:51 PM.

  10. #10
    Account Upgraded | Title Enabled! cerealnp is offline
    MemberRank
    Apr 2006 Join Date
    BrazilLocation
    441Posts

    Re: MatchServer: Calling ZGetObjectA

    Quote Originally Posted by Lambda View Post
    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?
    Last edited by cerealnp; 29-12-09 at 08:18 PM.

  11. #11
    Praise the Sun! Solaire is offline
    MemberRank
    Dec 2007 Join Date
    Undead BurgLocation
    2,862Posts

    Re: MatchServer: Calling ZGetObjectA

    Quote Originally Posted by cerealnp View Post
    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)

  12. #12

    Re: MatchServer: Calling ZGetObjectA

    Thanks a lot!



Advertisement