EnumVisibleObjects problem menu

User Tag List

Page 8 of 8 FirstFirst ... 45678
Results 106 to 113 of 113
  1. #106
    draco1219's Avatar Sergeant
    Reputation
    -6
    Join Date
    Jan 2011
    Posts
    45
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by lanman92 View Post
    If you're in process, why not make it static? It's not like you can have multiple instances of the game's object manager.
    You are definitely right, I just don't understand why it calls it once then crashes with absolutely no error message or error dump.

    I'll re-design my classes to be all static, but I don't understand why if all my delegates and methods are static it calls it once then closes the client.

    EnumVisibleObjects problem
  2. #107
    amadmonk's Avatar Active Member
    Reputation
    124
    Join Date
    Apr 2008
    Posts
    772
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    When you're exiting and entering the runtime (like you would be with an EndScene hook), statics can get very, very interesting if you have multiple AppDomains. I don't know if that's how your code is architected (although it's pretty common), but I figured I'd save you some time.

    If you DO use more than one AppDomain, just be aware that you really can't rely upon statics to be initialized unless you use msclr::call_in_appdomain. I've been bitten by this bug a few times.
    Don't believe everything you think.

  3. #108
    draco1219's Avatar Sergeant
    Reputation
    -6
    Join Date
    Jan 2011
    Posts
    45
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by amadmonk View Post
    When you're exiting and entering the runtime (like you would be with an EndScene hook), statics can get very, very interesting if you have multiple AppDomains. I don't know if that's how your code is architected (although it's pretty common), but I figured I'd save you some time.

    If you DO use more than one AppDomain, just be aware that you really can't rely upon statics to be initialized unless you use msclr::call_in_appdomain. I've been bitten by this bug a few times.
    Thanks for your response amadmonk

    I only create one AppDomain in my domain manager prior to loading up and instantiating my bot.

    Just for the heck of it I downloaded cleanCore to see how they do it and their delegates and calling structure is almost identical to mine. I marked my EndScene and EnumVisibleObjectsCallback methods static and I still have the same problem.

    The only difference I found is that my classes themselves are not static. I can't see how this would be an issue (since the methods themselves are static) but I am going to rework it a little bit to make the entire class static.

    I'll look into msclr::call_in_appdomain some more as I have never heard of it before.

    Have a good weekend!

  4. #109
    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 draco1219 View Post
    Thanks for your response amadmonk

    I only create one AppDomain in my domain manager prior to loading up and instantiating my bot.

    Just for the heck of it I downloaded cleanCore to see how they do it and their delegates and calling structure is almost identical to mine. I marked my EndScene and EnumVisibleObjectsCallback methods static and I still have the same problem.

    The only difference I found is that my classes themselves are not static. I can't see how this would be an issue (since the methods themselves are static) but I am going to rework it a little bit to make the entire class static.

    I'll look into msclr::call_in_appdomain some more as I have never heard of it before.

    Have a good weekend!
    Static classes is syntactic sugar by the C# compiler. It won't change anything.
    Maybe your delegate signature/calling convention is wrong?
    [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. #110
    draco1219's Avatar Sergeant
    Reputation
    -6
    Join Date
    Jan 2011
    Posts
    45
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by MaiN View Post
    Static classes is syntactic sugar by the C# compiler. It won't change anything.
    Maybe your delegate signature/calling convention is wrong?
    I agree, I made the entire library static since it made sense... but even after doing that it still has the issue.

    As far as I can tell cleanCore is doing it the same way, the only difference now is that I am using an offset directly instead of finding the pattern.. maybe the offset is wrong?


    Here's a little code, maybe something stands out to you. The EndScene is hooked properly and gets called and freezes the client when I put a breakpoint on it so I know it's being called from the main thread.

    Thanks again!

    Code:
            [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
            private delegate uint EnumVisibleObjectsDelegate(IntPtr callback, int filter);
            private static EnumVisibleObjectsDelegate WoWFunction_enumVisibleObjects;
    
            [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
            private delegate int EnumVisibleObjectsCallBackDelegate(ulong guid, uint filter);
            private static EnumVisibleObjectsCallBackDelegate _ourEnumVisibleObjectsCallBack;
            private static IntPtr _ourEnumVisibleObjectsCallBackPtr;
    
    
                // Initialize Object Manager Functions.
                uint enumVisibleObjectsOffset = 0x4962F0;
                WoWFunction_enumVisibleObjects = Memory.RegisterDelegate<EnumVisibleObjectsDelegate>((uint)Memory.MainModule.BaseAddress + enumVisibleObjectsOffset);
                _ourEnumVisibleObjectsCallBack = EnumVisibleObjectsCallBack;
                _ourEnumVisibleObjectsCallBackPtr = Marshal.GetFunctionPointerForDelegate(_ourEnumVisibleObjectsCallBack);
    
    
            private static int EndSceneHook(IntPtr device)
            {
                lock (_frameLock)
                {
                     WoWFunction_enumVisibleObjects(_ourEnumVisibleObjectsCallBackPtr, 0);
                }
    
                return (int)_endSceneHook.CallOriginal(device);
            }
    
            private static int EnumVisibleObjectsCallBack(ulong guid, uint filter)
            {  
                return 1;
            }

  6. #111
    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)
    That offset is wrong for both 13329 and 13596.
    [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. #112
    jjaa's Avatar Contributor
    Reputation
    245
    Join Date
    Dec 2006
    Posts
    562
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You do realize that offset is based at 0x400000 and not 0 right? unless you have ASLR disabled that will be a problem.

  8. #113
    draco1219's Avatar Sergeant
    Reputation
    -6
    Join Date
    Jan 2011
    Posts
    45
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by jjaa View Post
    You do realize that offset is based at 0x400000 and not 0 right? unless you have ASLR disabled that will be a problem.
    Thanks that worked!!
    Last edited by draco1219; 02-12-2011 at 03:44 PM.

Page 8 of 8 FirstFirst ... 45678

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 09:43 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