enum eUnitFields in C# menu

Shout-Out

User Tag List

Results 1 to 6 of 6
  1. #1
    naa's Avatar Contributor
    Reputation
    100
    Join Date
    Oct 2006
    Posts
    63
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    enum eUnitFields in C#

    Hey, i am trying to do some memory reading on the localPlayer:

    My Descriptor:

    Code:
            uint DescriptorOffset = 0x08;
            Descriptor = Memory.ReadUInt(ObjectPointer + DescriptorOffset);
    I got the right ObjectPointer as I can get the LocalPlayerName from the objectPointer with my getObjectName() function that uses ASM + the ObjectPointer.
    Now i am trying to read the HP with:
    Code:
            public int getHealth()
            {
                return Memory.ReadInt(Descriptor + (UNIT_FIELD_HEALTH * 4));
            }
    UNIT_FIELD_HEALTH = 0x44; <-- Got this from the Offset dumper made by Kynox

    According to this thread:
    http://www.mmowned.com/forums/wow-me...ints-mana.html

    The code in c++ should look like:
    Code:
    int HP = *(int *)(Descriptor + UNIT_FIELD_HEALTH * 4);
    And I assumed that I could convert it to C# with the code above but I do only get 0 returned.
    If i change the code to:
    Code:
            public int getHealth()
            {
                return Memory.ReadInt(Descriptor + 0x5c);
            }
    I get the right value but 0x5c is = UNIT_FIELD_POWER6 according to the offset dumper.
    Can anyone shred some light on what I have to do in order to use the offsets made by Kynox dumper in C#?

    Thank you.
    Best Regards
    Naa
    Last edited by naa; 01-28-2009 at 10:42 AM.

    enum eUnitFields in C#
  2. #2
    Gamer's Avatar Active Member
    Reputation
    239
    Join Date
    Jan 2007
    Posts
    198
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm not 100% if this is what you're asking but:

    From http://www.mmowned.com/forums/wow-me...formation.html

    UNIT_FIELD_HEALTH is 0x17.

    So in c#:

    Code:
            uint DescriptorOffset = 0x08;
            Descriptor = Memory.ReadUInt(ObjectPointer + DescriptorOffset);
            Memory.ReadInt(Descriptor + (0x17 * 4))

    Will give the object's HP.

  3. #3
    Bobnovak's Avatar Member
    Reputation
    3
    Join Date
    Jun 2008
    Posts
    10
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Naa, I posted a C# object loader a long time ago, it gets all kinds of information about objects and is good example code.

    http://www.mmowned.com/forums/wow-me...tml#post912235

    The memory locations are all very out of date (I posted this back in June or July) and will need to be updated, but the principle sound be the same.

  4. #4
    naa's Avatar Contributor
    Reputation
    100
    Join Date
    Oct 2006
    Posts
    63
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Gamer View Post
    I'm not 100% if this is what you're asking but:

    From http://www.mmowned.com/forums/wow-me...formation.html

    UNIT_FIELD_HEALTH is 0x17.

    So in c#:

    Code:
            uint DescriptorOffset = 0x08;
            Descriptor = Memory.ReadUInt(ObjectPointer + DescriptorOffset);
            Memory.ReadInt(Descriptor + (0x17 * 4))
    Will give the object's HP.
    Not really, what i am asking is how you use the offsets dumped by Kynox's dumper in C#. (I assume they can be used in c# and that they are the "right" offsets?)
    From the dumper:
    Code:
    /*----------------------------------
    WoW Offset Dumper 0.1 - IDC Script
    by kynox
    
    Credits:
    bobbysing, Patrick, Dominik, Azorbix
    -----------------------------------*/
    dwStartFunc: 0x00487860
    enum eObjectFields {
        OBJECT_FIELD_GUID=0x0,
        OBJECT_FIELD_TYPE=0x8,
        OBJECT_FIELD_ENTRY=0xC,
        OBJECT_FIELD_SCALE_X=0x10,
        OBJECT_FIELD_PADDING=0x14,
        TOTAL_OBJECT_FIELDS=0x5
    };
    
    enum eUnitFields {
        UNIT_FIELD_CHARM=0x0,
        UNIT_FIELD_SUMMON=0x8,
        UNIT_FIELD_CRITTER=0x10,
        UNIT_FIELD_CHARMEDBY=0x18,
        UNIT_FIELD_SUMMONEDBY=0x20,
        UNIT_FIELD_CREATEDBY=0x28,
        UNIT_FIELD_TARGET=0x30,
        UNIT_FIELD_CHANNEL_OBJECT=0x38,
        UNIT_FIELD_BYTES_0=0x40,
        UNIT_FIELD_HEALTH=0x44,
        UNIT_FIELD_POWER1=0x48,
        UNIT_FIELD_POWER2=0x4C,
        UNIT_FIELD_POWER3=0x50,
        UNIT_FIELD_POWER4=0x54,
        UNIT_FIELD_POWER5=0x58,
        UNIT_FIELD_POWER6=0x5C,
        UNIT_FIELD_POWER7=0x60,
        UNIT_FIELD_MAXHEALTH=0x64,
        UNIT_FIELD_MAXPOWER1=0x68,
        UNIT_FIELD_MAXPOWER2=0x6C,
        UNIT_FIELD_MAXPOWER3=0x70,
        UNIT_FIELD_MAXPOWER4=0x74,
        UNIT_FIELD_MAXPOWER5=0x78,
        UNIT_FIELD_MAXPOWER6=0x7C,
        UNIT_FIELD_MAXPOWER7=0x80,
        UNIT_FIELD_POWER_REGEN_FLAT_MODIFIER=0x84,
        UNIT_FIELD_POWER_REGEN_INTERRUPTED_FLAT_MODIFIER=0xA0,
        UNIT_FIELD_LEVEL=0xBC,
        UNIT_FIELD_FACTIONTEMPLATE=0xC0,
        UNIT_VIRTUAL_ITEM_SLOT_ID=0xC4,
        UNIT_FIELD_FLAGS=0xD0,
        UNIT_FIELD_FLAGS_2=0xD4,
        UNIT_FIELD_AURASTATE=0xD8,
        UNIT_FIELD_BASEATTACKTIME=0xDC,
        UNIT_FIELD_RANGEDATTACKTIME=0xE4,
        UNIT_FIELD_BOUNDINGRADIUS=0xE8,
        UNIT_FIELD_COMBATREACH=0xEC,
        UNIT_FIELD_DISPLAYID=0xF0,
        UNIT_FIELD_NATIVEDISPLAYID=0xF4,
        UNIT_FIELD_MOUNTDISPLAYID=0xF8,
        UNIT_FIELD_MINDAMAGE=0xFC,
        UNIT_FIELD_MAXDAMAGE=0x100,
        UNIT_FIELD_MINOFFHANDDAMAGE=0x104,
        UNIT_FIELD_MAXOFFHANDDAMAGE=0x108,
        UNIT_FIELD_BYTES_1=0x10C,
        UNIT_FIELD_PETNUMBER=0x110,
        UNIT_FIELD_PET_NAME_TIMESTAMP=0x114,
        UNIT_FIELD_PETEXPERIENCE=0x118,
        UNIT_FIELD_PETNEXTLEVELEXP=0x11C,
        UNIT_DYNAMIC_FLAGS=0x120,
        UNIT_CHANNEL_SPELL=0x124,
        UNIT_MOD_CAST_SPEED=0x128,
        UNIT_CREATED_BY_SPELL=0x12C,
        UNIT_NPC_FLAGS=0x130,
        UNIT_NPC_EMOTESTATE=0x134,
        UNIT_FIELD_STAT0=0x138,
        UNIT_FIELD_STAT1=0x13C,
        UNIT_FIELD_STAT2=0x140,
        UNIT_FIELD_STAT3=0x144,
        UNIT_FIELD_STAT4=0x148,
        UNIT_FIELD_POSSTAT0=0x14C,
        UNIT_FIELD_POSSTAT1=0x150,
        UNIT_FIELD_POSSTAT2=0x154,
        UNIT_FIELD_POSSTAT3=0x158,
        UNIT_FIELD_POSSTAT4=0x15C,
        UNIT_FIELD_NEGSTAT0=0x160,
        UNIT_FIELD_NEGSTAT1=0x164,
        UNIT_FIELD_NEGSTAT2=0x168,
        UNIT_FIELD_NEGSTAT3=0x16C,
        UNIT_FIELD_NEGSTAT4=0x170,
        UNIT_FIELD_RESISTANCES=0x174,
        UNIT_FIELD_RESISTANCEBUFFMODSPOSITIVE=0x190,
        UNIT_FIELD_RESISTANCEBUFFMODSNEGATIVE=0x1AC,
        UNIT_FIELD_BASE_MANA=0x1C8,
        UNIT_FIELD_BASE_HEALTH=0x1CC,
        UNIT_FIELD_BYTES_2=0x1D0,
        UNIT_FIELD_ATTACK_POWER=0x1D4,
        UNIT_FIELD_ATTACK_POWER_MODS=0x1D8,
        UNIT_FIELD_ATTACK_POWER_MULTIPLIER=0x1DC,
        UNIT_FIELD_RANGED_ATTACK_POWER=0x1E0,
        UNIT_FIELD_RANGED_ATTACK_POWER_MODS=0x1E4,
        UNIT_FIELD_RANGED_ATTACK_POWER_MULTIPLIER=0x1E8,
        UNIT_FIELD_MINRANGEDDAMAGE=0x1EC,
        UNIT_FIELD_MAXRANGEDDAMAGE=0x1F0,
        UNIT_FIELD_POWER_COST_MODIFIER=0x1F4,
        UNIT_FIELD_POWER_COST_MULTIPLIER=0x210,
        UNIT_FIELD_MAXHEALTHMODIFIER=0x22C,
        UNIT_FIELD_HOVERHEIGHT=0x230,
        UNIT_FIELD_PADDING=0x234,
        TOTAL_UNIT_FIELDS=0x59
    };
    According to this the health offset should be: UNIT_FIELD_HEALTH=0x44, so shouldn't i get the health if i do:

    Code:
            uint DescriptorOffset = 0x08;
            Descriptor = Memory.ReadUInt(ObjectPointer + DescriptorOffset);
            Memory.ReadInt(Descriptor + (0x44 * 4))
    I am rather new to reading memory so maybe I just don't understand the things dumped by Kynox's script. I assumed they were offests that I could use with the Descriptor but maby i am wrong.

    Originally Posted by Bobnovak View Post
    Hi Naa, I posted a C# object loader a long time ago, it gets all kinds of information about objects and is good example code.

    http://www.mmowned.com/forums/wow-me...tml#post912235

    The memory locations are all very out of date (I posted this back in June or July) and will need to be updated, but the principle sound be the same.
    Hey Bobnovak, not exactly what I was looking for but thank you, going to look into you code
    Last edited by naa; 01-28-2009 at 11:40 AM.

  5. #5
    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)
    Hi those those decriptors isnt for the m_pStoragePointer at 0x08 ure better of using the descriptors in the sticky that Gamer posted.
    ie. for health:
    Code:
    int curHp = ReadInt(ReadUInt(playerobject + 0x08) + 0x17 * 4);
    hope you get it working

  6. #6
    naa's Avatar Contributor
    Reputation
    100
    Join Date
    Oct 2006
    Posts
    63
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Got it working when I use the descriptors posted by Cyper in the 3.0.2 thread that gamer linked.

    Thank you all 3 +rep

Similar Threads

  1. [WoW] Constant Data (Enums, Structs, Etc)
    By Apoc in forum WoW Memory Editing
    Replies: 67
    Last Post: 10-30-2022, 07:10 AM
  2. Replies: 0
    Last Post: 10-06-2010, 04:14 PM
  3. .NET 4.0: Enum.HasFlag is not what you might expect...
    By XTZGZoReX in forum WoW Memory Editing
    Replies: 0
    Last Post: 06-11-2010, 07:43 AM
  4. C# enum
    By nopz in forum Programming
    Replies: 3
    Last Post: 09-20-2009, 01:34 PM
  5. 3.1.1 Enums And Other Things Freshly Extracted.
    By Ickybad in forum WoW EMU General Releases
    Replies: 5
    Last Post: 05-01-2009, 04:30 AM
All times are GMT -5. The time now is 04:32 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