EnumVisibleObjects problem menu

User Tag List

Page 1 of 8 12345 ... LastLast
Results 1 to 15 of 113
  1. #1
    skra's Avatar Member
    Reputation
    1
    Join Date
    Apr 2009
    Posts
    33
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    EnumVisibleObjects problem

    hi,
    i'm currently hooking endscene and trying to use the enum visible objects function. for the moment i'm doing the same as apoc suggested in his guide for making a better objectmanager, hoever everytime the enumvis. funktion is called wow crashes. here is the crashlog
    Code:
    World of WarCraft (build 11403)
    
    
    This application has encountered a critical error:
    
    ERROR #132 (0x85100084) Fatal Exception
    
    Exception:	0xC0000005 (ACCESS_VIOLATION) at 0023:0047B95F
    
    The instruction at "0x0047B95F" referenced memory at "0x000000AC".
    The memory could not be "read".
    
    
    WoWBuild: 11403
    
    ----------------------------------------
        Memory Dump
    ----------------------------------------
    
    Code: 16 bytes starting at (EIP = 0047B95F)
    
    0047B95F: 8B 40 04 A8  01 57 75 04  85 C0 75 04  33 DB EB 02  [email protected]...
    
    
    Stack: 1024 bytes starting at (ESP = 1255FA4C)
    
    * = addr                                         **                       *   
    1255FA40: 19 00 00 00  00 00 00 00  60 BD 76 15  60 BD 76 15  ........`.v.`.v.
    1255FA50: E4 FB 55 12  D4 FA 55 12  EB 42 29 04  52 12 62 04  ..U...U..B).R.b.
    1255FA60: 00 00 00 00  94 DF 6C 1B  E8 59 18 6B  FF FF FF FF  ......l..Y.k....
    1255FA70: 00 00 00 00  5C FA 55 12  EB 42 29 04  0C 80 BD 22  ....\.U..B)...."
    1255FA80: 2C 80 BD 22  00 00 00 00  D4 FA 55 12  00 00 00 00  ,.."......U.....
    1255FA90: 44 02 B3 22  60 BD 76 15  00 00 00 80  B4 FA 55 12  D.."`.v.......U.
    1255FAA0: 74 FD 26 6B  40 B9 47 00  00 00 00 00  52 12 62 04  t.&[email protected].
    1255FAB0: 00 00 00 00  00 00 00 00  00 00 00 00  52 12 62 04  ............R.b.
    1255FAC0: 00 00 00 00  52 12 62 04  E4 FB 55 12  18 FB 55 12  ....R.b...U...U.
    1255FAD0: 30 FB 55 12  54 FB 55 12  E9 45 29 04  00 00 00 00  0.U.T.U..E).....
    1255FAE0: 00 80 BD 22  2C 80 BD 22  00 80 BD 22  88 E5 FD 00  ...",.."..."....
    1255FAF0: A8 03 B3 22  10 0C B3 22  00 00 00 00  00 00 00 00  ..."..."........
    1255FB00: 00 00 00 00  00 00 00 00  14 00 B3 22  00 00 00 00  ..........."....
    1255FB10: 00 00 00 00  00 00 00 00  01 00 00 00  00 00 00 00  ................
    1255FB20: 14 00 B3 22  00 00 00 00  01 00 00 00  00 00 00 00  ..."............
    1255FB30: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  ................
    1255FB40: 00 00 00 00  00 00 80 7F  E4 FB 55 12  48 57 75 15  ..........U.HWu.
    1255FB50: 00 9C 2F 01  6C FB 55 12  92 3D 29 04  60 BD 76 15  ../.l.U..=).`.v.
    1255FB60: 00 00 00 00  00 00 C0 FF  00 00 00 00  B4 FB 55 12  ..............U.
    1255FB70: BA 3C 29 04  C4 FB 55 12  17 A0 63 09  28 FB 55 12  .<)...U...c.(.U.
    1255FB80: B8 FB 55 12  D0 8C 6B 6B  FF FF FF FF  08 7D 28 6B  ..U...kk.....}(k
    1255FB90: 42 1B 58 77  37 86 48 6B  5F A0 63 09  00 9C 2F 01  B.Xw7.Hk_.c.../.
    1255FBA0: 48 57 75 15  00 00 00 00  01 00 00 00  00 00 00 00  HWu.............
    1255FBB0: 00 C8 43 13  DC FB 55 12  37 10 62 04  48 09 62 04  ..C...U.7.b.H.b.
    1255FBC0: 60 BD 76 15  C4 FF 55 12  02 27 36 6B  FF FF FF FF  `.v...U..'6k....
    1255FBD0: 10 FD 55 12  8C 02 25 01  48 57 75 15  10 FC 55 12  ..U...%.HWu...U.
    1255FBE0: 27 01 A2 66  00 C8 43 13  00 9C 2F 01  10 6A A6 66  '..f..C.../..j.f
    1255FBF0: 08 4B 75 15  48 57 75 15  00 00 00 00  38 FC 55 12  .Ku.HWu.....8.U.
    1255FC00: 08 4B 75 15  48 57 75 15  00 00 00 00  00 00 00 00  .Ku.HWu.........
    1255FC10: 4C FC 55 12  5B 0F A2 66  48 57 75 15  00 9C 2F 01  L.U.[..fHWu.../.
    1255FC20: 48 57 75 15  3C 6A A2 66  A0 FC 55 12  00 00 00 00  HWu.<j.f..U.....
    1255FC30: B8 D0 72 15  48 57 75 15  00 00 00 00  00 00 00 00  ..r.HWu.........
    1255FC40: F6 00 00 00  7B 01 00 00  B8 D0 72 15  64 FC 55 12  ....{.....r.d.U.
    1255FC50: DD 6A A2 66  08 4B 75 15  1C 23 30 01  8C FC 55 12  .j.f.Ku..#0...U.
    1255FC60: 00 00 00 00  2C FD 55 12  D1 B1 A6 66  08 4B 75 15  ....,.U....f.Ku.
    1255FC70: 1C 23 30 01  8C FC 55 12  00 00 00 00  00 10 00 00  .#0...U.........
    1255FC80: C8 E9 75 15  68 37 6D 15  08 4B 75 15  00 00 00 00  ..u.h7m..Ku.....
    1255FC90: 00 00 00 00  00 00 00 00  00 00 76 43  00 80 BD 43  ..........vC...C
    1255FCA0: 00 00 00 00  00 00 00 00  A0 DD 73 15  00 00 25 01  ..........s...%.
    1255FCB0: 00 00 00 00  02 00 00 00  00 00 00 00  00 01 00 00  ................
    1255FCC0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  ................
    1255FCD0: 00 00 00 00  00 01 00 00  EC FC 55 12  04 EE 75 15  ..........U...u.
    1255FCE0: 00 83 6D 15  00 00 00 00  01 00 00 00  14 FD 55 12  ..m...........U.
    1255FCF0: 41 BE A0 66  00 00 00 00  C8 E9 75 15  00 E9 75 15  A..f......u...u.
    1255FD00: 00 00 00 00  00 00 00 00  00 00 00 00  00 EE 75 15  ..............u.
    1255FD10: 00 00 00 00  00 00 00 00  18 D1 72 15  02 00 00 00  ..........r.....
    1255FD20: 00 00 00 00  00 10 00 00  00 00 00 00  84 FD 55 12  ..............U.
    1255FD30: 73 D3 A0 66  B8 D0 72 15  1C 23 30 01  68 FD 55 12  s..f..r..#0.h.U.
    1255FD40: 00 00 00 00  C8 E9 75 15  00 00 00 00  50 B8 76 15  ......u.....P.v.
    1255FD50: 80 31 FF 00  1C 23 30 01  00 00 00 00  00 00 00 00  .1...#0.........
    1255FD60: 00 00 76 43  00 80 BD 43  00 00 00 00  00 00 00 00  ..vC...C........
    1255FD70: 00 00 00 00  00 00 76 43  00 80 BD 43  96 2F 7B 09  ......vC...C./{.
    1255FD80: C8 E9 75 15  20 FE 55 12  EB D3 A0 66  C8 E9 75 15  ..u. .U....f..u.
    1255FD90: 80 31 FF 13  74 FE 55 12  C8 E9 75 15  00 00 00 00  .1..t.U...u.....
    1255FDA0: D0 22 30 01  00 FD 55 12  60 FE 55 12  30 FE 55 12  ."0...U.`.U.0.U.
    1255FDB0: 4E BD A6 66  00 D1 72 15  00 00 00 00  1C 23 30 01  N..f..r......#0.
    1255FDC0: D0 D1 72 15  74 FE 55 12  C8 E9 75 15  00 00 00 00  ..r.t.U...u.....
    1255FDD0: 00 00 00 00  00 00 00 00  D4 D0 72 15  C8 E9 75 15  ..........r...u.
    1255FDE0: 00 00 00 00  00 00 00 00  00 00 00 00  00 FE 55 12  ..............U.
    1255FDF0: 6E 2F A0 66  00 D0 72 15  00 00 00 00  00 00 00 00  n/.f..r.........
    1255FE00: 00 00 00 00  00 9C A0 66  00 00 00 00  00 00 00 00  .......f........
    1255FE10: 2C FE 55 12  1A 3B A0 66  B4 D0 72 15  FA 2C 7B 09  ,.U..;.f..r..,{.
    1255FE20: 8C FE 55 12  6F 94 A0 66  80 31 FF 13  D4 D0 72 15  ..U.o..f.1....r.
    1255FE30: 74 FE 55 12  01 00 00 00  00 00 00 00  D0 D1 72 15  t.U...........r.
    1255FE40: 00 22 C5 77  60 FE 55 12  00 00 00 00  F0 AC 2F 01  .".w`.U......./.
    my EnumObjDelegate looks like this:
    Code:
            [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
            private delegate int EnumObjectsCallbackDelegate(int lowGuid, int highGuid, uint filter);
    because afaik the guid is passed via 2 ints (but that seems to be wrong or it wouldn't crash) what leads me to my next question. is
    Code:
                 ulong hGuid = (ulong)highGuid;
                ulong temp_hguid = hGuid << 32;
                ulong lGuid = (ulong)lowGuid;
                ulong guid = temp_hguid | lGuid;
                IntPtr objPtr = InternalGetObjectByGuid(guid);
    the right aproach to put the guid back together?

    EnumVisibleObjects problem
  2. #2
    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)
    Code:
            #region Nested type: EnumObjectsCallback
    
            [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
            private delegate int EnumObjectsCallback(ulong guid, int filter);
    
            #endregion
    
            #region Nested type: EnumVisibleObjectsDelegate
    
            [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
            private delegate int EnumVisibleObjectsDelegate(IntPtr callback, int filter);
    
            #endregion

  3. #3
    skra's Avatar Member
    Reputation
    1
    Join Date
    Apr 2009
    Posts
    33
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well that is what i did before, but it didn't work either. it produces the same error. so i guess the error comes from somewhere else, but i can' figure out from where. if i vomment out the "EnumObj(CallbackPointer, 0)" call it runs without crashing, and it can't be anithing in the callbackhandler because i'm not doing anithing in there yet. i'm just returning 1
    Last edited by skra; 02-25-2010 at 06:09 AM.

  4. #4
    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)
    I'd check your addresses then. Make sure they're correct.

  5. #5
    skra's Avatar Member
    Reputation
    1
    Join Date
    Apr 2009
    Posts
    33
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i checked them again just now and they seem to be correct =/
    i'm using
    Code:
            EnumVisibleObjects = 0x0047B940, 
            ClntObjMgrGetActivePlayer = 0x0047A5C0,
            ClntObjMgrObjectPtr = 0x0047BBC0

  6. #6
    adaephon's Avatar Active Member
    Reputation
    76
    Join Date
    May 2009
    Posts
    167
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Are you sure you're calling the right functions? From your post it sounds like you are calling EnumVisibleObjects (0x0047B940) with the delegate taking a GUID and filter. This isn't correct - EnumVisibleObjects takes a pointer to a callback function and a filter - internally it then calls your callback function, which takes a GUID and a filter.

  7. #7
    skra's Avatar Member
    Reputation
    1
    Join Date
    Apr 2009
    Posts
    33
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by adaephon View Post
    Are you sure you're calling the right functions? From your post it sounds like you are calling EnumVisibleObjects (0x0047B940) with the delegate taking a GUID and filter. This isn't correct - EnumVisibleObjects takes a pointer to a callback function and a filter - internally it then calls your callback function, which takes a GUID and a filter.
    yes i am sure
    Code:
    initialisation
                Callback = EnumObjectsCallbackHandler;
                CallbackPtr = Marshal.GetFunctionPointerForDelegate(Callback);
    in pulse
                EnumObjs(CallbackPtr, 0);
    
                 private static int EnumObjectsCallbackHandler(ulong guid, int filter)
            {return 1;}
    does anyone have an idea what could be wrong?
    Last edited by skra; 02-25-2010 at 01:24 PM.

  8. #8
    YetiHunter's Avatar Member
    Reputation
    6
    Join Date
    Aug 2006
    Posts
    57
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've got the same problem at the moment. Does someone have a solution for this?
    Last edited by YetiHunter; 02-26-2010 at 05:49 AM.

  9. #9
    TOM_RUS's Avatar Legendary
    Reputation
    914
    Join Date
    May 2008
    Posts
    699
    Thanks G/R
    0/52
    Trade Feedback
    0 (0%)
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Apoc View Post
    Code:
            #region Nested type: EnumObjectsCallback
    
            [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
            private delegate int EnumObjectsCallback(ulong guid, int filter);
    
            #endregion
    
            #region Nested type: EnumVisibleObjectsDelegate
    
            [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
            private delegate int EnumVisibleObjectsDelegate(IntPtr callback, int filter);
    
            #endregion
    Your filter isn't filter actually. It's pointer, which than passed to callback for use...

  10. #10
    skra's Avatar Member
    Reputation
    1
    Join Date
    Apr 2009
    Posts
    33
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    umm so you mean it should be something like this
    Code:
    EnumObjs(CallbackPtr, (int*)0);
    
    [UnnamedFunctionPointer(CallingConvention.Cdecl)]
    private delegate int EnumVisObjDelegate(IntPtr callback, int* filter);

  11. #11
    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)
    Are you ingame when you call it?
    Else exactly that access violation will occur.
    Hey, it compiles! Ship it!

  12. #12
    skra's Avatar Member
    Reputation
    1
    Join Date
    Apr 2009
    Posts
    33
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes of cause i'm ingame^^ and my endscene hook is working aswell ( at least i think so because my pulse method is allways called =P )

  13. #13
    Robske's Avatar Contributor
    Reputation
    305
    Join Date
    May 2007
    Posts
    1,062
    Thanks G/R
    3/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by flo8464 View Post
    Are you ingame when you call it?
    Else exactly that access violation will occur.
    Wrong

    EnumVisibleObjects will not throw any exceptions when not 'in-game'. It will do what it's supposed to do, enumerate all visible objects. (0)
    "Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - Martin Golding
    "I cried a little earlier when I had to poop" - Sku

  14. #14
    ostapus's Avatar Active Member
    Reputation
    58
    Join Date
    Nov 2008
    Posts
    176
    Thanks G/R
    2/8
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    here is what i am using, function definition wise.

    static int _FastEnumObjectsCallback(WGUID guid, DWORD dwParams)
    {
    }


    typedef void (*pEnumVisibleObjects) (CallBack *callBack, UINT type) ;
    pEnumVisibleObjects EnumVisibleObjects ;
    GetPointer(EnumVisibleObjects, pEnumVisibleObjects, fptrEnumVisibleObjects) ;
    EnumVisibleObjects(_FastEnumObjectsCallback, (DWORD) &params) ;

  15. #15
    swayenvoy's Avatar Member
    Reputation
    1
    Join Date
    Jul 2008
    Posts
    19
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think i had the same problem, here are my definitions:

    Code:
            /// <summary>
            /// This function allows you to enumerate over WoW's list of objects, an also
            /// base that enumeration around a filter.
            /// </summary>
            /// <param name="callback">
            /// A callback to be used to let WoW know when to stop,
            /// or continue to call your callback with objects.
            /// </param>
            /// <param name="filter">
            /// A filter of WoWObjectType. Basically to narrow down the search to specific
            /// types of objects.
            /// </param>
            [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
            private delegate int EnumVisibleObjectsDelegate(IntPtr callback, int filter);
            /// <summary>
            /// Acts as the callback from WoW. This function will be called for each object
            /// during the enumeration. A GUID will be passed back that you can then use in the
            /// ClntObjMgrGetObjectPtr function to get the actual pointer.
            /// </summary>
            /// <param name="guid">A GUID to use.</param>
            /// <param name="filter">A filter for the object type.</param>
            /// <returns>
            /// Returns 0 when the enumeration should be stopped or
            /// 1 when the enumeration should continue.
            /// </returns>
            /// <remarks>
            /// If no objects are left to enumerate, the function will no longer be called.
            /// </remarks>
            [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
            private delegate int EnumObjectsCallbackDelegate(WGUID guid, int filter);
            private readonly EnumObjectsCallbackDelegate _Callback;
            private readonly IntPtr _CallbackPtr;
    
            _Callback = EnumObjectsCallbackHandler;
            _CallbackPtr = Marshal.GetFunctionPointerForDelegate(_Callback);
    
           private int EnumObjectsCallbackHandler(WGUID guid, int filter) {...}
          
           EnumObjects(_CallbackPtr, 0);
    
           [StructLayout(LayoutKind.Sequential)]
        public struct WGUID
        {
            public int lowGuid;
            public int highGuid;
    
            public static implicit operator ulong(WGUID obj)
            {
                List<byte> tmp = new List<byte>();
                tmp.AddRange(BitConverter.GetBytes(obj.lowGuid));
                tmp.AddRange(BitConverter.GetBytes(obj.highGuid));
                return BitConverter.ToUInt64(tmp.ToArray(), 0);
            }
        }
    Maybe it's not the freakiest way of doing this but for me it worked.

    WARNING: Not tested with the latest patch.

Page 1 of 8 12345 ... LastLast

Similar Threads

  1. Problem with CE.
    By Eldretch in forum World of Warcraft General
    Replies: 1
    Last Post: 08-08-2006, 06:49 PM
  2. realm list problem
    By robtuner in forum World of Warcraft General
    Replies: 2
    Last Post: 07-21-2006, 09:08 AM
  3. I have problem with BHW 3.0
    By sunrize1 in forum World of Warcraft General
    Replies: 1
    Last Post: 07-17-2006, 08:49 AM
  4. wow emu problem
    By bezike in forum World of Warcraft General
    Replies: 0
    Last Post: 07-09-2006, 04:45 PM
  5. Site problems
    By Shanaar in forum Community Chat
    Replies: 10
    Last Post: 05-14-2006, 01:15 AM
All times are GMT -5. The time now is 07:56 AM. 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