DotA Unit Handles

This is a discussion on DotA Unit Handles within the Warcraft 3 Hacks, bots and tools board part of the Warcraft 3 forum category; Hi there, using a dll, which calls CreateUnitByName, I found out: for every player in DotA , there is an ...

Results 1 to 6 of 6
  1. #1
    Funs's Avatar
    Funs is offline Mentor
    Array
    Join Date
    Jan 2009
    Posts
    138
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    9
    Reputation
    185

    Lightbulb DotA Unit Handles

    Hi there,
    using a dll, which calls CreateUnitByName, I found out: for every player in DotA, there is an address in memory holding the unit handle of his hero.



    My dll is creating a unit and displaying its handle in a console window, so I can search with a memory scanner for this handle.

    I came up with the following adresses:
    Code:
    (read as DWORDs)
    
    Player 1: SomeDynamicBaseAddress + 0x0E44
    Player 2: SomeDynamicBaseAddress + 0x0E48
    Player 3: SomeDynamicBaseAddress + 0x0E4C
    Player 4: SomeDynamicBaseAddress + 0x0E50
    Player 5: SomeDynamicBaseAddress + 0x0E54
    Player 6: SomeDynamicBaseAddress + 0x0E5C
    Player 7: SomeDynamicBaseAddress + 0x0E60
    Player 8: SomeDynamicBaseAddress + 0x0E64
    Player 9: SomeDynamicBaseAddress + 0x0E68
    Player 10: SomeDynamicBaseAddress + 0x0E6C

    So here is my problem: These addresses are dynamic and I could not manage to find any pointers nor find an other solution to obtain these in my program! I hope someone can help me or lead me in the right direction...


    I uploaded my dll... Just put it into Wc3 folder, start a DotA game and press the "+"-key. A unit will be created and its handle is displayed in the console, so you can search for this value in CE and should find the same addresses.
    Link: Zippyshare.com
    -------------------------------------------------------> ( )
    me shoving an elephant up your sister´s backdoor

  2. #2
    DarkSupremo is offline Premium Member
    Array
    Join Date
    Feb 2008
    Posts
    790
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    13
    Reputation
    606
    I did that creating an hook to TriggerRegisterUnitEvent that will be called every time that someone pick an hero...
    one of the parameter that this function receive is an handle to the unit... with this you can use the jass to discover to what player this unit belong and if it`s an hero...

  3. The Following User Says Thank You to DarkSupremo For This Useful Post:


  4. #3
    nemo0305 is offline Addict
    Array
    Join Date
    Sep 2011
    Location
    VietNam
    Posts
    71
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    7
    Reputation
    3
    Hi DarkSupremo, can i ask you one thing. I want to use jass "IsUnitIdType" but pararmeter 2 is unit type but i don't know what is it !!! Can you show me !!? I've search it Jass World Editor but don't see anything just "HERO_ID_TYPE", i want to use "IsUnitIdType" because i what to check that unit handle is Hero.

  5. #4
    DarkSupremo is offline Premium Member
    Array
    Join Date
    Feb 2008
    Posts
    790
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    13
    Reputation
    606
    just put this code in the top of your source:

    Code:
    enum UNIT_TYPE
    {
        UNIT_TYPE_HERO,
        UNIT_TYPE_DEAD,
        UNIT_TYPE_STRUCTURE,
    
    
        UNIT_TYPE_FLYING,
        UNIT_TYPE_GROUND,
    
    
        UNIT_TYPE_ATTACKS_FLYING,
        UNIT_TYPE_ATTACKS_GROUND,
    
    
        UNIT_TYPE_MELEE_ATTACKER,
        UNIT_TYPE_RANGED_ATTACKER,
    
    
        UNIT_TYPE_GIANT,
        UNIT_TYPE_SUMMONED,
        UNIT_TYPE_STUNNED,
        UNIT_TYPE_PLAGUED,
        UNIT_TYPE_SNARED,
    
    
        UNIT_TYPE_UNDEAD,
        UNIT_TYPE_MECHANICAL,
        UNIT_TYPE_PEON,
        UNIT_TYPE_SAPPER,
        UNIT_TYPE_TOWNHALL,
        UNIT_TYPE_ANCIENT,
    
    
        UNIT_TYPE_TAUREN,
        UNIT_TYPE_POISONED,
        UNIT_TYPE_POLYMORPHED,
        UNIT_TYPE_SLEEPING,
        UNIT_TYPE_RESISTANT,
        UNIT_TYPE_ETHEREAL,
        UNIT_TYPE_MAGIC_IMMUNE
    };
    then just use it as parameter UNIT_TYPE_HERO

    but, you can also use in this way:

    Code:
    DWORD unittype =  GetUnitTypeId(unitId);
    bool isHero = IsHeroUnitId(unittype);
    Last edited by DarkSupremo; 05-29-2012 at 02:53 AM.

  6. The Following User Says Thank You to DarkSupremo For This Useful Post:


  7. #5
    nemo0305 is offline Addict
    Array
    Join Date
    Sep 2011
    Location
    VietNam
    Posts
    71
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    7
    Reputation
    3
    oh tks you so much for the enum of Unit_Type
    P/s: Can you help me to get the current slot of the player by unit handle and item handle ???
    Last edited by nemo0305; 05-29-2012 at 05:17 AM.

  8. #6
    Funs's Avatar
    Funs is offline Mentor
    Array
    Join Date
    Jan 2009
    Posts
    138
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    9
    Reputation
    185
    Quote Originally Posted by DarkSupremo View Post
    I did that creating an hook to TriggerRegisterUnitEvent that will be called every time that someone pick an hero...
    one of the parameter that this function receive is an handle to the unit... with this you can use the jass to discover to what player this unit belong and if it`s an hero...
    I know that, but my goal was to do it without hooking or patching anything...
    -------------------------------------------------------> ( )
    me shoving an elephant up your sister´s backdoor

Similar Threads

  1. Replies: 5
    Last Post: 10-08-2011, 05:41 PM
  2. I need to have my own unit quotes in my map
    By KavanaK in forum Warcraft 3 Custom Maps
    Replies: 0
    Last Post: 09-28-2011, 03:10 PM
  3. Zerg Unit Bug
    By Evilenigma in forum Starcraft 2 Hacks, bots and tools
    Replies: 7
    Last Post: 05-15-2011, 01:18 AM
  4. unit control without TH?
    By safd in forum Warcraft 3 forum
    Replies: 10
    Last Post: 07-18-2008, 05:29 PM
  5. Unit-Quotes!
    By Dexxter in forum Warcraft 3 forum
    Replies: 5
    Last Post: 02-12-2007, 02:01 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •