| | WoW Memory Editing WoW Memory Editing for learning purposes only.
This section is more advanced than others on MMOwned Read the section specific rules, infractions will be given out if u break them!That is including the expectations! - If you don't meet them then don't post |  | 
10-07-2009
| | New User | | | Join Date: Feb 2008
Posts: 6
Reputation: 1 Level up: 88%, 51 Points needed | | | | [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. | Donate to remove ads, get your "DONATOR title, and get access to the MMOwned community's elite Shoutbawx. 
10-07-2009
| | Contributor | | | Join Date: Sep 2006 Location: Jaedenar O.o
Posts: 568
Reputation: 162 Level up: 58%, 336 Points needed |     | | | My guess is that the STATIC_TARGET offset gives you the baseaddress or GUID of the local player target.
__________________ http://www.main-dev.com/
I was here. ~Dragon[Sky] I was here too. ~Kuiren | 
10-07-2009
| | New User | | | Join Date: Feb 2008
Posts: 6
Reputation: 1 Level up: 88%, 51 Points needed | | | | $STATIC_TARGET = (0x113d7a8)
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. | 
10-07-2009
| | Sergeant | | | Join Date: Aug 2008
Posts: 68
Reputation: 10 Level up: 14%, 432 Points needed |  | | A Function from Ninjaskid ... not nice coded .. but it should work ...
thank the "developer" of Ninjaskid ... don't know the names ... Quote:
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
| | 
10-07-2009
| | New User | | | Join Date: Feb 2008
Posts: 6
Reputation: 1 Level up: 88%, 51 Points needed | | | | Thank you mate, I'm going to go play with this then post the working product. | 
1 Week Ago
|  | Sergeant | | | Join Date: Feb 2009 Location: AZ
Posts: 43
Reputation: 12 Level up: 2%, 493 Points needed |   | | | Sorry to bump an old post but $objectbase would be the $STATIC_TARGET = (0x113d7a8) correct? cause if it is then theres something going wrong cause i just get 0 | 
1 Week Ago
|  | MaiN's Biatch Legendary User | | | Join Date: Mar 2007 Location: VirtualAllocEx
Posts: 1,115
Nominated 26 Times in 3 Posts  TOTM/W Award(s): 1 Reputation: 727 Points: 36,171, Level: 28 | Level up: 95%, 129 Points needed |     | | 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;
}
| 
1 Week Ago
|  | Knight | | | Join Date: Apr 2009
Posts: 219
Reputation: 11 Level up: 10%, 454 Points needed |   | | 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! | 
1 Week Ago
| | Contributor | | | Join Date: Sep 2006 Location: Jaedenar O.o
Posts: 568
Reputation: 162 Level up: 58%, 336 Points needed |     | | Quote:
Originally Posted by flo8464 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 While Code: if ( (objType >> 5) & 1 )
Is the same as
__________________ http://www.main-dev.com/
I was here. ~Dragon[Sky] I was here too. ~Kuiren | 
1 Week Ago
|  | Knight | | | Join Date: Apr 2009
Posts: 219
Reputation: 11 Level up: 10%, 454 Points needed |   | | Thanks 
But I don't get why that is done.
Does it really make any difference in codesize/speed ?
__________________ Hey, it compiles! Ship it! | 
1 Week Ago
| | Contributor | | | Join Date: Sep 2006 Location: Jaedenar O.o
Posts: 568
Reputation: 162 Level up: 58%, 336 Points needed |     | | Quote:
Originally Posted by flo8464 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.
__________________ http://www.main-dev.com/
I was here. ~Dragon[Sky] I was here too. ~Kuiren
Last edited by MaiN; 6 Days Ago at 03:24 PM.
| 
1 Week Ago
|  | Kynox's sister's pimp Legendary User | | | Join Date: Apr 2006 Location: ntdll.dll
Posts: 4,178
Nominated 63 Times in 4 Posts  TOTM/W Award(s): 1 Reputation: 1074 Points: 55,512, Level: 35 | Level up: 14%, 3,188 Points needed |     | | Quote:
Originally Posted by MaiN 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. |  |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | All times are GMT -4. The time now is 12:02 PM. |