ObjectManager: why do we have to ensure that the last bit of an object's address is 0 menu

User Tag List

Page 2 of 2 FirstFirst 12
Results 16 to 26 of 26
  1. #16
    Apoc's Avatar Angry Penguin
    Reputation
    1387
    Join Date
    Jan 2008
    Posts
    2,750
    Thanks G/R
    0/12
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    v4 is the current object.

    Granted; the following is still a little screwy; it's more complete:

    Code:
    signed int __cdecl EnumVisibleObjects(int (__cdecl *pCallback)(WGUID, eWOWOBJECTTYPE), eWOWOBJECTTYPE filter)
    {
      WoWObject *firstObj; // eax@1
      SObjectManager *objMgr; // esi@1
      WoWObject *curObj; // ebx@3
      eWOWOBJECTTYPE filter1; // edi@5
    
      objMgr = *(SObjectManager **)(*MK_FP(__FS__, 44) + 4 * TlsIndex);
      firstObj = objMgr->ObjectList->FirstObject;
      if ( !((_BYTE)firstObj & 1) && firstObj )
        curObj = objMgr->ObjectList->FirstObject;
      else
        curObj = 0;
      filter1 = filter;
      while ( !((_BYTE)curObj & 1) && curObj )
      {
        if ( !((int (__cdecl *)(_DWORD, _DWORD, _DWORD))pCallback)(curObj->Guid.dwLow, curObj->Guid.dwHigh, filter1) )
          return 0;
        curObj = *(WoWObject **)((char *)&curObj->Entry + (unsigned int)objMgr->ObjectList->NextObject);
      }
      return 1;
    }

    ObjectManager: why do we have to ensure that the last bit of an object's address is 0
  2. Thanks lsjaf3297 (1 members gave Thanks to Apoc for this useful post)
  3. #17
    Ellesar1's Avatar Member
    Reputation
    20
    Join Date
    Feb 2009
    Posts
    78
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks. This explains the behaviour.

    +rep to both of you!


    Side question: what is the better coding style if you are in-process. Reading the objects manually or calling functions like "EnumVisibleObjects"?

  4. #18
    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 Ellesar1 View Post
    Thanks. This explains the behaviour.

    +rep to both of you!


    Side question: what is the better coding style if you are in-process. Reading the objects manually or calling functions like "EnumVisibleObjects"?
    Calling EnumVisibleObjects requires much less work!
    [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

  5. #19
    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, very helpfull.

    signed int __cdecl EnumVisibleObjects(int (__cdecl *pCallback)(WGUID, eWOWOBJECTTYPE), eWOWOBJECTTYPE filter)
    eWOWOBJECTTYPE is an integer, representing a certain object type, for example ... 7 = dynamic object, correct ?

  6. #20
    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, very helpfull.



    eWOWOBJECTTYPE is an integer, representing a certain object type, for example ... 7 = dynamic object, correct ?
    It's using the object type flags.
    http://www.mmowned.com/forums/wow-me...ructs-etc.html
    It's the enum called "WoWObjectTypeFlag" - you can combine the flags obviously.
    EDIT: Pass 0 to enumerate every object.
    [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

  7. #21
    Cypher's Avatar Kynox's Sister's Pimp
    Reputation
    1356
    Join Date
    Apr 2006
    Posts
    5,368
    Thanks G/R
    0/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    EnumVisibleObjects sucks. True story.

  8. #22
    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 Cypher View Post
    EnumVisibleObjects sucks. True story.
    You suck. True story.
    [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

  9. #23
    Cypher's Avatar Kynox's Sister's Pimp
    Reputation
    1356
    Join Date
    Apr 2006
    Posts
    5,368
    Thanks G/R
    0/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by MaiN View Post
    You suck. True story.
    You fail at life.

  10. #24
    bigtimt's Avatar Active Member
    Reputation
    41
    Join Date
    Mar 2008
    Posts
    100
    Thanks G/R
    2/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Ellesar1 View Post
    what do you understand with "walking backwards"? There is only a next - pointer, not a previous-pointer, as far as I know.

    And they have to be initialized to 0 since an invalid pointer can be everything random (also even number!)
    [ObjPtr+0x24] - 0x24 = PrevObjPtr

  11. #25
    lanman92's Avatar Active Member
    Reputation
    50
    Join Date
    Mar 2007
    Posts
    1,033
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    And the pointer to the last object from the object manager..?

  12. #26
    bigtimt's Avatar Active Member
    Reputation
    41
    Join Date
    Mar 2008
    Posts
    100
    Thanks G/R
    2/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by lanman92 View Post
    And the pointer to the last object from the object manager..?
    it doesn't matter, using this method when you pass the first object in the object list the PrevObjPtr will loop around to the last object in the object list.

Page 2 of 2 FirstFirst 12

Similar Threads

  1. How to Verify That the Last Name is Correct
    By Verye in forum WoW Scam Prevention
    Replies: 4
    Last Post: 07-27-2008, 02:01 AM
  2. Replies: 15
    Last Post: 07-22-2008, 07:38 AM
  3. Why Video Games Have A Rating System
    By m0rbidang3l in forum Screenshot & Video Showoff
    Replies: 4
    Last Post: 07-19-2008, 02:28 AM
  4. [Funny] Why warlocks REALLY have imps
    By Skizzilini in forum Screenshot & Video Showoff
    Replies: 0
    Last Post: 12-13-2007, 10:37 PM
  5. help| I'm using chrispee's repack, and i have a bug that i only do miss
    By shaked in forum World of Warcraft Emulator Servers
    Replies: 6
    Last Post: 11-02-2007, 01:43 PM
All times are GMT -5. The time now is 09:49 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search