C# Finding buffs menu

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    Hawker's Avatar Active Member
    Reputation
    55
    Join Date
    Jan 2009
    Posts
    214
    Thanks G/R
    1/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    C# Finding buffs

    Can anyone see why this hasBuff code is working on some WoW clients and not on others? I'm baffled

    Code:
            /// <summary>
            /// Returns true if the player got the specific buff id (look at thottbot to get the id's)
            /// </summary>
            public bool hasBuff(uint buffID)
            {
                try
                {
                    GUnit temp = new GUnit(objectList, ObjectPointer);
                    for (int i = 0; i < 20; i++)
                    {
                        uint curAura = Memory.ReadUInt((uint)(temp.ObjectPointer + 0xDB8 + (i * 4)));
                        Output.LogToFile("Buff found: " + curAura.ToString());
                        if (curAura == buffID)
                        {
                            Output.LogToFile("Wanted Buff: " + buffID); 
                            return true;
                        }
                    }
                    return false;
                }
                catch
                {
                    return false;
                }
            }
    Output from my own druid:
    [16/07/2009 11:45:28]:Maneuvering towards Felweed: ( 537.116 2828.452 214.1415 ) 17370386803974151545
    [16/07/2009 11:45:28]:Moving to node...
    [16/07/2009 11:45:29]:Buff found: 33943
    [16/07/2009 11:45:29]:Wanted Buff: 33943
    Strange output from a user's druid:
    [7/16/2009 3:36:23 AM]:Maneuvering towards Icethorn: ( 6020.106 -476.5709 367.1697 ) 17370386953324909881
    [7/16/2009 3:36:23 AM]:Moving to node...
    [7/16/2009 3:36:23 AM]:Buff found: 24
    [7/16/2009 3:36:23 AM]:Buff found: 728301552
    [7/16/2009 3:36:23 AM]:Buff found: 0
    [7/16/2009 3:36:23 AM]:Buff found: 256
    [7/16/2009 3:36:23 AM]:Buff found: 0
    [7/16/2009 3:36:23 AM]:Buff found: 256
    [7/16/2009 3:36:23 AM]:Buff found: 0
    [7/16/2009 3:36:23 AM]:Buff found: 256
    [7/16/2009 3:36:23 AM]:Buff found: 0
    [7/16/2009 3:36:23 AM]:Buff found: 256

    C# Finding buffs
  2. #2
    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)
    Lol @ the "just sweep it under the rug" style exception handling.

  3. #3
    Hawker's Avatar Active Member
    Reputation
    55
    Join Date
    Jan 2009
    Posts
    214
    Thanks G/R
    1/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Cypher View Post
    Lol @ the "just sweep it under the rug" style exception handling.
    That's why I even have a rug in my hallway you insensitive clod.

  4. #4
    Gorzul's Avatar Member
    Reputation
    8
    Join Date
    May 2009
    Posts
    19
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    (WoW 3.1.3.9947)
    Have a closer look at Lua_UnitAura:
    Code:
    .text:004BA3E0 000                 push    ebp
    .text:004BA3E1 004                 mov     ebp, esp
    .text:004BA3E3 004                 cmp     dword ptr [ecx+0DB0h], 0FFFFFFFFh ; Compare Two Operands
    .text:004BA3EA 004                 mov     eax, [ebp+auraIndex]
    .text:004BA3ED 004                 jnz     short loc_4BA402 ; Jump if Not Zero (ZF=0)
    .text:004BA3EF 004                 mov     ecx, [ecx+0C38h]
    .text:004BA3F5 004                 lea     eax, [eax+eax*2] ; Load Effective Address
    .text:004BA3F8 004                 lea     eax, [ecx+eax*8] ; Load Effective Address
    .text:004BA3FB 004                 mov     eax, [eax+8]
    .text:004BA3FE 004                 pop     ebp
    .text:004BA3FF 000                 retn    4               ; Return Near from Procedure
    
    .text:004BA402 004                 lea     edx, [eax+eax*2] ; Load Effective Address
    .text:004BA405 004                 lea     eax, [ecx+edx*8+0C30h] ; Load Effective Address
    .text:004BA40C 004                 mov     eax, [eax+8]
    .text:004BA40F 004                 pop     ebp
    .text:004BA410 000                 retn    4               ; Return Near from Procedure
    Hex-Rays:
    Code:
    int __thiscall GetUnitAuraId(int this, int auraIndex)
    {
      int result; // eax@2
    
      if ( *(_DWORD *)(this + 0xDB0) == 0xFFFFFFFF )
        result = *(_DWORD *)(*(_DWORD *)(this + 0xC38) + 0x18 * auraIndex + 0x8);
      else
        result = *(_DWORD *)(this + 0xC38 + 0x18 * auraIndex);
      return result;
    }
    As you can see there two possible locations to read the aura id.

    edit:
    Your problem was already discussed:
    http://www.mmowned.com/forums/wow-me...yer-buffs.html
    Last edited by Gorzul; 07-16-2009 at 08:36 AM.

  5. #5
    Hawker's Avatar Active Member
    Reputation
    55
    Join Date
    Jan 2009
    Posts
    214
    Thanks G/R
    1/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    +rep for pointing that out. Can we lock this thread please?

  6. #6
    Apoc's Avatar Angry Penguin
    Reputation
    1388
    Join Date
    Jan 2008
    Posts
    2,750
    Thanks G/R
    0/13
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    AURA *__thiscall CGUnitC__GetUnitAura(WoWObject *this, unsigned int auraIndex)
    {
      unsigned int dwAuraCount; // edx@2
      AURA *result; // eax@6
    
      if ( this->dwAuraCount2 == -1 )                               // dwAuraCount2 is the overflow ptr. (>10 auras)
        dwAuraCount = this->dwAuraCount1;
      else
        dwAuraCount = this->dwAuraCount2;
      if ( auraIndex >= dwAuraCount )
      {
        result = 0;                                                 // No current auras to return.
      }
      else
      {
        if ( this->dwAuraCount2 == -1 )
          result = (AURA *)(*(_DWORD *)&this->gap_d55[0] + 24 * auraIndex);// Not entirely sure how they're doing this. Once I'm unlazy enough, I'll map out the actual offsets in the WoWObject struct.
        else
          result = (AURA *)&this->gap_d5[24 * auraIndex + 192];
      }
      return result;
    }
    Might be a bit clearer for those of you having a hard time.

  7. Thanks squiggy (1 members gave Thanks to Apoc for this useful post)
  8. #7
    jockel's Avatar Member
    Reputation
    4
    Join Date
    Mar 2009
    Posts
    54
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the snippets,
    I'm exactly using a replication of the "Hex-Rays" function Gorzul posted.

    It works awesome for my local player or npc's to detect buffs/debuffs.

    But as soon I'm going to target a friendly player to get the buffs from them, the function fails and will never return a valid buffid.

  9. #8
    jockel's Avatar Member
    Reputation
    4
    Join Date
    Mar 2009
    Posts
    54
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I did some researches and analyzed the GetAura function another time,
    but I'm not able to get it working to grab the auras a player has.

    I'm only able to get buffs from my local player or npcs.


    I tried it in process (C++)

    Code:
    typedef int (__thiscall * tGetAura)(void* uThis, int index);
    tGetAura oGetAura = reinterpret_cast<tGetAura>(0x00566D80);

    And out of process (C#)

    Code:
          uint GetAuraAt(uint i)
             {
                 if (ReadUInt(baseAddress + 0xDB0) == -1){
    
                     return ReadUInt(ReadUInt(baseAddress + 0xC38) + (0x18*i) + 8);
    
                 }
    
                 return ReadUInt(baseAddress + 0xC38+ (0x18*i));
             }

    The C# function SHOULD return the exact same the GetAura function in Wow does, I can't see any differences, so why does it not return auras for playerobjects (except my local player) ?

  10. #9
    Gorzul's Avatar Member
    Reputation
    8
    Join Date
    May 2009
    Posts
    19
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Your C# code should work for all units (including other players). Have you checked the base addresses of your player objects?

    edit:
    Ok, your problem is the uint.
    Code:
    uint GetAuraAt(uint i)
             {
                 if (ReadUInt(baseAddress + 0xDB0) == -1){
    
                     return ReadUInt(ReadUInt(baseAddress + 0xC38) + (0x18*i) + 8);
    
                 }
    
                 return ReadUInt(baseAddress + 0xC38+ (0x18*i));
             }
    Last edited by Gorzul; 07-18-2009 at 12:34 PM.

  11. #10
    vulcanaoc's Avatar Member
    Reputation
    31
    Join Date
    Jul 2008
    Posts
    125
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Gorzul View Post
    Code:
                 if (ReadUInt(baseAddress + 0xDB0) == -1){
    
                     return ReadUInt(ReadUInt(baseAddress + 0xC38) + (0x18*i) + 8);
    
                 }
    
                 return ReadUInt(baseAddress + 0xC38+ (0x18*i));
             }

    Comparing a 4 byte unsigned integer to an integer with a sign is not a very good idea.

    lawl

  12. #11
    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)
    Anyone know if these changed in 3.2.0? I'm having an awful time trying to determine this... Sometimes the memory location at 0xDB0 is -1, and sometimes 0xDB4 is -1

    Granted I am looking on a mac, but I highly doubt this would vary. Here is the binary if people want to be so kind as to check:
    http://dump.ifeedr.com/WoWBinaries/W...ft%203.2.0.zip

    I'm going to fire up IDA Pro and see if I can find the function listed above. (although I have a feeling i'll struggle heh)

  13. #12
    tdrake's Avatar Member
    Reputation
    1
    Join Date
    Aug 2008
    Posts
    23
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Aura count1/2 and aura table 1/2 both changed.

    Size and spellid stayed the same.

    Im sure its the same for mac as size and spellid havent changed in awhile as far as im aware.

  14. #13
    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)
    enum UnitBaseGetUnitAura
    {
    AURA_COUNT_1 = 0x0DC8, //CGUnit_C__GetUnitAura(int index)
    AURA_COUNT_2 = 0x0F3C, //Wtf is this one from? /*0xC34 3.1.3*/
    AURA_TABLE_1 = 0xC48, //CGUnit_C__GetUnitAura(int index)
    AURA_TABLE_2 = 0xC50, //CGUnit_C__GetUnitAura(int index)
    AURA_SIZE = 0x18, //Size of the Aura Struct, 6 * 4 bytes
    AURA_SPELL_ID = 0x8 //Offset in the struct for the Id, "Second Integer"
    } ;

    theese one is correct except for AURA_COUNT_2 dunno what function that's from ..
    Last edited by Nesox; 08-08-2009 at 12:10 PM.

  15. #14
    tdrake's Avatar Member
    Reputation
    1
    Join Date
    Aug 2008
    Posts
    23
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    AURA_COUNT_2 = 0xC4C

  16. #15
    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)
    Originally Posted by tdrake View Post
    AURA_COUNT_2 = 0xC4C
    what function is that from?

Page 1 of 2 12 LastLast

Similar Threads

  1. Need help finding dmg/stam/stat buffs for 80-85's
    By Bmtppk in forum World of Warcraft General
    Replies: 2
    Last Post: 12-01-2013, 05:26 AM
  2. [Selling] Demon hunter 210% gold find set non buff, no follower
    By la102 in forum Diablo 3 Buy Sell Trade
    Replies: 1
    Last Post: 08-11-2012, 04:46 PM
  3. [CODE] Find buffs / debuffs on a target
    By Therrm in forum WoW Memory Editing
    Replies: 6
    Last Post: 04-19-2009, 05:51 AM
  4. AFK Out of BG without deserter buff
    By Matt in forum World of Warcraft Exploits
    Replies: 0
    Last Post: 03-29-2006, 09:51 AM
  5. Getting into BG with that pesky deserters buff!
    By janzi9 in forum World of Warcraft Exploits
    Replies: 0
    Last Post: 03-06-2006, 11:35 PM
All times are GMT -5. The time now is 03:05 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