Player position - best method?  (what is base+0xF4?) menu

User Tag List

Page 2 of 2 FirstFirst 12
Results 16 to 20 of 20
  1. #16
    Tanaris4's Avatar Contributor Authenticator enabled
    Reputation
    148
    Join Date
    Oct 2008
    Posts
    646
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yea I have never seen a thiscall, ever
    https://tanaris4.com

    Player position - best method?  (what is base+0xF4?)
  2. #17
    wraithZX's Avatar Active Member
    Reputation
    43
    Join Date
    May 2007
    Posts
    122
    Thanks G/R
    0/1
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  3. #18
    _Mike's Avatar Contributor
    Reputation
    310
    Join Date
    Apr 2008
    Posts
    531
    Thanks G/R
    0/2
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Why are you linking that? It's already been stated that it isn't thiscall

  4. #19
    wraithZX's Avatar Active Member
    Reputation
    43
    Join Date
    May 2007
    Posts
    122
    Thanks G/R
    0/1
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Because it explains why "thiscall" would not be seen on the mac binary?
    The functions themselves ARE thiscall, but using the GCC calling convention for passing the this ptr.

    Although, now that I look at the function, the params seem to be backwards.
    Now I'm curious.
    Last edited by wraithZX; 04-29-2011 at 06:31 PM.

  5. #20
    TOM_RUS's Avatar Legendary
    Reputation
    914
    Join Date
    May 2008
    Posts
    699
    Thanks G/R
    0/52
    Trade Feedback
    0 (0%)
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Looks like object structs almost the same in 4.1.0.13914 as they were in 3.x:
    Paste2: Next Generation Pastebin - Viewing Paste 1391388

    For Mac build 13860 I had to change:
    in CGObject_C:
    remove DWORD field04;
    DWORD objectclass[59];->DWORD objectclass[57];

    in CGUnit_C:
    DWORD unitclass[1111];->DWORD unitclass[1088];

    Code:
    void *__stdcall CGUnit_C__GetPosition(void *a1, CGUnit_C *a2)
    {
      CPassenger__GetPosition(a1, (int)a2->PassengerPtr, &a2->PassengerPtr->Position);
      return a1;
    }
    
    signed int __cdecl Script_GetMoney(int a1)
    {
      CGPlayer_C *v1; // eax@1
      CGPlayer_C *v2; // edi@1
      __int64 v3; // qax@1
      sObjectFields *v4; // eax@2
      DWORD v5; // ebx@2
      DWORD v6; // esi@2
      __int64 v7; // qax@2
      long double v8; // fst7@3
      sPlayerFields *v10; // eax@6
      __int128 v15; // ST30_16@6
      __int128 v20; // ST20_16@6
      double v21; // [sp+4h] [bp-54h]@4
    
      v3 = ClntObjMgrGetActivePlayer();
      v1 = (CGPlayer_C *)ClntObjMgrObjectPtr(v3, 16);
      v2 = v1;
      if ( v1 )
      {
        v4 = v1->UnitBase.ObjectBase.ObjectData;
        v5 = v4->OBJECT_FIELD_GUID.Low;
        v6 = v4->OBJECT_FIELD_GUID.High;
        v7 = ClntObjMgrGetActivePlayer();
        if ( v5 ^ (_DWORD)v7 | HIDWORD(v7) ^ v6 )
        {
          v8 = 0.0;
        }
        else
        {
          v10 = v2->PlayerData;
          _EDX = v10->PLAYER_FIELD_COINAGE.High;
          __asm
          {
            movapd  xmm0, [ebp+var_28]
            cvtsi2sd xmm0, edx
            mulsd   xmm0, ds:qword_D476E0
            movapd  [ebp+var_28], xmm0
          }
          v15 = _FT0;
          _EAX = v10->PLAYER_FIELD_COINAGE.Low + 0x80000000;
          __asm
          {
            movd    xmm0, eax
            cvtdq2pd xmm0, xmm0
            addsd   xmm0, ds:qword_D476C0
            addsd   xmm0, qword ptr [ebp+var_28]
            movapd  [ebp+var_38], xmm0
          }
          v20 = _FT0;
          v8 = *(double *)&v20;
        }
        v21 = v8;
      }
      else
      {
        *(_QWORD *)&v21 = 0LL;
      }
      lua_pushnumber(a1, v21);
      return 1;
    }
    
    signed int __cdecl Script_UnitClass(int a1)
    {
      char *v1; // ebx@3
      CGUnit_C *v2; // eax@4
      CGUnit_C *v3; // ecx@4
      int v4; // ebx@4
      int v5; // esi@4
      int v6; // eax@5
      int v7; // edx@5
      char v8; // bl@6
      int v9; // esi@6
      const char *v10; // eax@7
      int v11; // eax@8
      int v12; // edx@8
      unsigned __int8 v13; // al@10
      int v15; // eax@19
      int v16; // ecx@19
      __int64 v17; // ST04_8@19
      int v18; // eax@20
      int v19; // edx@20
      __int64 v20; // [sp+20h] [bp-28h]@4
      int v21; // [sp+28h] [bp-20h]@19
      int v22; // [sp+2Ch] [bp-1Ch]@19
    
      if ( !lua_isstring(a1, 1) )
        luaL_error(a1, "Usage: UnitClass(\"unit\")");
      v1 = (char *)lua_tolstring(a1, 1, 0);
      if ( strcasecmp(v1, "player") )
      {
        v20 = 0LL;
        Script_GetGUIDFromToken(v1, (int)&v20, 0);
        v4 = v20;
        v5 = HIDWORD(v20);
        v2 = (CGUnit_C *)ClntObjMgrObjectPtr(v20, 8);
        v3 = v2;
        if ( v2 )
        {
          v7 = v2->UnitData->UNIT_FIELD_BYTES_0[1];
          v6 = *(&g_chrClassesDB + 3);
          if ( v7 < v6 || v7 > *(&g_chrClassesDB + 2) )
          {
            v9 = 0;
            v8 = 0;
          }
          else
          {
            v9 = *(_DWORD *)(*(&g_chrClassesDB + 6) + 4 * (v7 - v6));
            v8 = v9 != 0;
          }
          v10 = (const char *)CGUnit_C__GetDisplayClassName(v3, 0);
        }
        else
        {
          v21 = 0;
          v22 = 0;
          LODWORD(v17) = v4;
          HIDWORD(v17) = v5;
          v15 = DBCache_NameCache_unsigned_long_long_CHashKeyGUID___GetRecord((int)&g_nameDBCache, v17, (int)&v21, 0, 0, 0);
          v16 = v15;
          if ( !v15 )
          {
    LABEL_13:
            lua_pushnil(a1);
            lua_pushnil(a1);
            return 2;
          }
          v19 = *(_DWORD *)(v15 + 324);
          v18 = *(&g_chrClassesDB + 3);
          if ( v19 < v18 || v19 > *(&g_chrClassesDB + 2) )
          {
            v9 = 0;
            v8 = 0;
          }
          else
          {
            v9 = *(_DWORD *)(*(&g_chrClassesDB + 6) + 4 * (v19 - v18));
            v8 = v9 != 0;
          }
          v10 = (const char *)CGUnit_C__GetDisplayClassName(0, v16);
        }
      }
      else
      {
        v12 = (unsigned __int8)ClientServices__GetCharacterClass();
        v11 = *(&g_chrClassesDB + 3);
        if ( v12 < v11 || v12 > *(&g_chrClassesDB + 2) )
        {
          v9 = 0;
          v8 = 0;
        }
        else
        {
          v9 = *(_DWORD *)(*(&g_chrClassesDB + 6) + 4 * (v12 - v11));
          v8 = v9 != 0;
        }
        v13 = ClientServices__GetCharacterSex();
        v10 = (const char *)CGUnit_C__GetDisplayClassNameFromRecord(v9, v13, 0);
      }
      if ( !v10 || !v8 )
        goto LABEL_13;
      lua_pushstring(a1, v10);
      lua_pushstring(a1, *(const char **)(v9 + 24));
      return 2;
    }
    Last edited by TOM_RUS; 04-30-2011 at 02:53 AM.

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Whats your best method at quick/Easy gold
    By MrW0W in forum World of Warcraft General
    Replies: 5
    Last Post: 04-19-2014, 03:54 PM
  2. Best method to dump unit fields, player fields, etc...?
    By Tanaris4 in forum WoW Memory Editing
    Replies: 7
    Last Post: 10-08-2010, 09:57 AM
  3. Modifying player position
    By flo8464 in forum WoW Memory Editing
    Replies: 19
    Last Post: 07-21-2009, 08:51 PM
  4. [Help] player create info ids what do they all mean?
    By Masterkenshin in forum World of Warcraft Emulator Servers
    Replies: 7
    Last Post: 01-20-2008, 02:35 PM
All times are GMT -5. The time now is 02:43 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search