[AutoIt] Getting target name? menu

Shout-Out

User Tag List

Results 1 to 12 of 12
  1. #1
    Ohsnap's Avatar Member
    Reputation
    1
    Join Date
    Feb 2008
    Posts
    6
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [AutoIt] Getting target name?

    I've been reading these forums for a few weeks gaining knowledge about various things. I've come to the conclusion that beginning with AutoIt as a programming language is a wise idea before I move onto anything more advanced and my end game goal was to release something before I moved onto another language. I've hit a problem when trying to get a target name which I've searched several times but the search engine would only search for the world "Target" or "Get" which made my search worthless

    Func Target()
    $Target = _BMReadMemory($Handle, $STATIC_TARGET, "ptr")
    GUICtrlSetData($Label6, $Target)
    EndFunc

    Is my code which seems to return several numbers and not an actual name. I've mixed things up a few times and it began giving me acsii characters instead. What am I doing wrong? Yes I'm useing 3.2.2 offsets. If anyone could point me in the right direction would be much appreciated. Thank you.

    [AutoIt] Getting target name?
  2. #2
    MaiN's Avatar Elite User
    Reputation
    335
    Join Date
    Sep 2006
    Posts
    1,047
    Thanks G/R
    0/10
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    My guess is that the STATIC_TARGET offset gives you the baseaddress or GUID of the local player target.
    [16:15:41] Cypher: caus the CPU is a dick
    [16:16:07] kynox: CPU is mad
    [16:16:15] Cypher: CPU is all like
    [16:16:16] Cypher: whatever, i do what i want

  3. #3
    Ohsnap's Avatar Member
    Reputation
    1
    Join Date
    Feb 2008
    Posts
    6
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    $STATIC_TARGET = (0x113d7a

    This is the offset that I'm useing. What is it I'm missing? All I want it for is to display my target as my bot roams in-game and possibly down the road log it with other information if I want to read what my character got up to while I was gone.

  4. #4
    spudstar99's Avatar Member
    Reputation
    12
    Join Date
    Aug 2008
    Posts
    99
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    A Function from Ninjaskid ... not nice coded .. but it should work ...

    thank the "developer" of Ninjaskid ... don't know the names ...

    Func _WoWGetName($Handle, $ObjectBase)
    Local $l_Type = _WoWGetObjectType($Handle, $ObjectBase)

    Switch ($l_Type)
    Case $OT_Unit
    Return _BMReadASCIIString($Handle, _BMReadUint($Handle, (_BMReadUInt($Handle, ($ObjectBase + $UNIT_NAMEOFFSET_1)) + $UNIT_NAMEOFFSET_2)), 30)

    Case $OT_GameObject
    Return _BMReadASCIIString($Handle, _BMReadUint($Handle, (_BMReadUInt($Handle, ($ObjectBase + $GAMEOBJECT_NAMEOFFSET_1)) + $GAMEOBJECT_NAMEOFFSET_2)), 30)
    Case $OT_Player ;;;;;Not Working!!!!!!!
    ;$ObjectBase = _WoWPlayerBase($handle)
    ;return ""
    Return _BMReadASCIIString($Handle, _BMReadUint($Handle, (_BMReadUInt($Handle, ($ObjectBase + $UNIT_NAMEOFFSET_1)) + $UNIT_NAMEOFFSET_2)), 30)
    Case Else

    Return StringFormat("Unknown %s", _WoWGetTypeString($l_Type))


    EndSwitch
    EndFunc

  5. #5
    Ohsnap's Avatar Member
    Reputation
    1
    Join Date
    Feb 2008
    Posts
    6
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you mate, I'm going to go play with this then post the working product.

  6. #6
    The-Guardian's Avatar Active Member
    Reputation
    68
    Join Date
    Feb 2009
    Posts
    116
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry to bump an old post but $objectbase would be the $STATIC_TARGET = (0x113d7a correct? cause if it is then theres something going wrong cause i just get 0

  7. #7
    Nesox's Avatar ★ Elder ★
    Reputation
    1280
    Join Date
    Mar 2007
    Posts
    1,238
    Thanks G/R
    0/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    char *__thiscall CGObject_C__GetObjectName(int this, int a2, int a3)
    {
      int v3; // ebx@1
      int v4; // esi@1
      unsigned int v5; // eax@4
      int v6; // edi@8
      unsigned int v7; // ecx@12
      int v8; // eax@18
      char *result; // eax@19
      int v10; // eax@23
      int v11; // ecx@26
      int v12; // esi@34
      int v13; // edi@16
      int v14; // esi@19
      char *v15; // esi@24
      char *v16; // esi@25
      int v17; // eax@29
      int v18; // ecx@29
      char v19; // [sp+Ch] [bp-2C4h]@11
      _DWORD v20[74]; // [sp+1A0h] [bp-130h]@13
      int v21; // [sp+2C8h] [bp-8h]@19
      int v22; // [sp+2CCh] [bp-4h]@19
    
      v3 = 0;
      v4 = this;
      if ( a3 && *(_BYTE *)(this + 3914) & 0x80 )
      {
        sub_92BFE0();
        a3 = 0;
        if ( sub_4990C0() )
        {
          while ( 1 )
          {
            v5 = *(_DWORD *)(v4 + 3544);
            if ( v5 == -1 )
              v5 = *(_DWORD *)(v4 + 3164);
            if ( a3 >= v5 )
            {
              v6 = 0;
            }
            else
            {
              if ( *(_DWORD *)(v4 + 3544) != -1 )
                v6 = v3 + v4 + 3160;
              else
                v6 = v3 + *(_DWORD *)(v4 + 3168);
            }
            if ( ClientDb_GetLocalizedRow(*(_DWORD *)(v6 + 8), &v19) )
              break;
    LABEL_16:
            v13 = a3++ + 1;
            v3 += 24;
            if ( (unsigned int)v13 >= sub_4990C0() )
              goto LABEL_17;
          }
          v7 = 0;
          while ( v20[v7] != 279 || !((unsigned __int8)(1 << (char)v7) & *(_BYTE *)(v6 + 12)) )
          {
            ++v7;
            if ( v7 >= 3 )
              goto LABEL_16;
          }
          v10 = GetObjectByGuid(*(_DWORD *)v6, *(_DWORD *)(v6 + 4), 8);
          if ( v10 )
          {
            v15 = CGObject_C__GetObjectName(v10, a2, 0);
            nullsub_6();
            result = v15;
          }
          else
          {
            v16 = (char *)sub_6C4510(v6);
            nullsub_6();
            result = v16;
          }
          return result;
        }
    LABEL_17:
        nullsub_6();
      }
      v8 = *(_DWORD *)(v4 + 8);
      if ( (*(_DWORD *)(v8 + 8) >> 4) & 1 )
      {
        v14 = *(_DWORD *)(v4 + 8);
        v21 = *(_DWORD *)v8;
        v22 = *(_DWORD *)(v8 + 4);
        result = (char *)DbNameCache_GetInfoBlockById(*(_DWORD *)v8, *(_DWORD *)(v14 + 4), &v21, sub_6A0970, 0, 1);
        if ( result )
        {
          if ( a2 )
          {
            if ( *(result + 52) )
              *(_DWORD *)a2 = result + 52;
          }
          return result;
        }
      }
      else
      {
        v11 = *(_DWORD *)(v4 + 208);
        if ( *(_DWORD *)(v11 + 272) )
        {
          v21 = *(_DWORD *)v8;
          v22 = *(_DWORD *)(v8 + 4);
          result = (char *)DbPetNameCache_GetInfoBlockById(*(_DWORD *)(v11 + 272), &v21, sub_6A0970, 0, 1);
          if ( result )
          {
            if ( *((_DWORD *)result + 22) == *(_DWORD *)(*(_DWORD *)(v4 + 208) + 276) )
              return result;
            sub_6C6160(result);
            sub_5FB920(*(_DWORD *)(*(_DWORD *)(v4 + 208) + 272));
            v17 = *(_DWORD *)(v4 + 8);
            v21 = *(_DWORD *)v17;
            v18 = *(_DWORD *)(v4 + 208);
            v22 = *(_DWORD *)(v17 + 4);
            DbPetNameCache_GetInfoBlockById(*(_DWORD *)(v18 + 272), &v21, sub_6A0970, 0, 1);
          }
        }
        else
        {
          v12 = *(_DWORD *)(v4 + 2408);
          if ( v12 )
            return *(char **)(v12 + 92);
        }
      }
      result = (char *)FrameScript_GetText("UNKNOWNOBJECT", -1, 0);
      if ( !result || !*result )
        result = "Unknown Being";
      return result;
    }

  8. #8
    flo8464's Avatar Active Member
    Reputation
    30
    Join Date
    Apr 2009
    Posts
    434
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Uhm, as you reversed UnitName, maybe you can help me with a bit of it

    Here is what I don't understand:

    Code:
     getGuidByKeyword(unitName_c, &guid, 0);
      guid_c = guid;
      if ( guid && ((_DWORD)guid != -2 || *((_DWORD *)&guid + 1) != -1) )
      {
        object = getObjectByGuidFiltered(guid, 1);
        object_c = object;
        if ( object )
        {
          objDescriptorTable = *(_DWORD *)(object + 8);
          objType = *(_DWORD *)(objDescriptorTable + 8);
          if ( (objType >> 3) & 1 )
          {
            unitName_c2 = WoWUnit_getNameInfo(object_c, (char *)&serverName_c, 1);
            goto LABEL_28;
          }
          if ( (objType >> 5) & 1 )
          {
            unitName_c2 = (char *)sub_68B480();
            goto LABEL_28;
          }
    Maybe i completly misunderstood something, but as far as I remember there is a pointer to the descriptor-structure at base+0x8. But what the heck is it doing in those if-clauses here? Whats the point in shifting + checking the last byte here? (its checking dl, HeyRays just interpreted it as an AND)
    Hey, it compiles! Ship it!

  9. #9
    MaiN's Avatar Elite User
    Reputation
    335
    Join Date
    Sep 2006
    Posts
    1,047
    Thanks G/R
    0/10
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by flo8464 View Post
    Uhm, as you reversed UnitName, maybe you can help me with a bit of it

    Here is what I don't understand:

    Code:
     getGuidByKeyword(unitName_c, &guid, 0);
      guid_c = guid;
      if ( guid && ((_DWORD)guid != -2 || *((_DWORD *)&guid + 1) != -1) )
      {
        object = getObjectByGuidFiltered(guid, 1);
        object_c = object;
        if ( object )
        {
          objDescriptorTable = *(_DWORD *)(object + 8);
          objType = *(_DWORD *)(objDescriptorTable + 8);
          if ( (objType >> 3) & 1 )
          {
            unitName_c2 = WoWUnit_getNameInfo(object_c, (char *)&serverName_c, 1);
            goto LABEL_28;
          }
          if ( (objType >> 5) & 1 )
          {
            unitName_c2 = (char *)sub_68B480();
            goto LABEL_28;
          }
    Maybe i completly misunderstood something, but as far as I remember there is a pointer to the descriptor-structure at base+0x8. But what the heck is it doing in those if-clauses here? Whats the point in shifting + checking the last byte here? (its checking dl, HeyRays just interpreted it as an AND)
    It's checking the obj type.
    Code:
    if ( (objType >> 3) & 1 )
    Is just checking the obj type flag.
    It's the same as
    Code:
    if (objType & 8)
    While
    Code:
    if ( (objType >> 5) & 1 )
    Is the same as
    Code:
    if (objType & 32)
    [16:15:41] Cypher: caus the CPU is a dick
    [16:16:07] kynox: CPU is mad
    [16:16:15] Cypher: CPU is all like
    [16:16:16] Cypher: whatever, i do what i want

  10. #10
    flo8464's Avatar Active Member
    Reputation
    30
    Join Date
    Apr 2009
    Posts
    434
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks
    But I don't get why that is done.
    Does it really make any difference in codesize/speed ?
    Hey, it compiles! Ship it!

  11. #11
    MaiN's Avatar Elite User
    Reputation
    335
    Join Date
    Sep 2006
    Posts
    1,047
    Thanks G/R
    0/10
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by flo8464 View Post
    Thanks
    But I don't get why that is done.
    Does it really make any difference in codesize/speed ?
    Well, I don't think it does. But personally I think it's a nicer format. Eg., I don't know which bit 0x40 is - if it's written like that it's a little easier to understand when you don't have the full flag enum.
    (flag >> 7) & 1 - I know that bit 8 in the bitmask is being checked as opposed to (flag & 0x40). If I have the full enum, it's easier to use that format though.
    Last edited by MaiN; 11-14-2009 at 02:24 PM.
    [16:15:41] Cypher: caus the CPU is a dick
    [16:16:07] kynox: CPU is mad
    [16:16:15] Cypher: CPU is all like
    [16:16:16] Cypher: whatever, i do what i want

  12. #12
    Cypher's Avatar Kynox's Sister's Pimp
    Reputation
    1358
    Join Date
    Apr 2006
    Posts
    5,368
    Thanks G/R
    0/6
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by MaiN View Post
    Well, I don't think it does. But personally I think it's a nicer format. Eg., I don't know which bit 0x40 is - if it's written like that it's a little easier to understand when you don't have the full flag enum.
    (flag >> 7) & 1 - I know that bit 7 in the bitmask is being checked as opposed to (flag & 0x40). If I have the full enum, it's easier to use that format though.
    It makes no difference in terms of code size or speed.

    I agree however. Bit shift notation is much better than a direct bitwise AND.

Similar Threads

  1. Get target name (and other info) in Wow 3.3.5a
    By Breket in forum WoW Memory Editing
    Replies: 2
    Last Post: 11-11-2013, 12:52 AM
  2. Getting account name changed.
    By UneekOne in forum World of Warcraft General
    Replies: 5
    Last Post: 09-23-2007, 06:09 PM
All times are GMT -5. The time now is 02:45 AM. 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