Interacting with object menu

Shout-Out

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 15 of 30
  1. #1
    miceiken's Avatar Contributor Authenticator enabled
    Reputation
    209
    Join Date
    Dec 2007
    Posts
    401
    Thanks G/R
    7/9
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Interacting with object

    So I've come to the point where I need to interact with units, so I got a hold of the interact asm function and freshed it up, however it does crash at:
    Code:
    Core.WBM.Asm.InjectAndExecute(codecave);
    with the simple and explaning error:
    Code:
    Injection failed for some reason.
    The Interact() function:
    Code:
    public void Interact()
            {
                Core.WBM.Asm.Clear();
                Core.WBM.Asm.AddLine("fs mov eax, [0x2C]");
                Core.WBM.Asm.AddLine("mov eax, [eax]");
                Core.WBM.Asm.AddLine("add eax, 0x10");
                Core.WBM.Asm.AddLine("mov dword [eax], {0}", new object[] { CurMgr });
                Core.WBM.Asm.AddLine("mov ecx, {0}", new object[] { BaseAddress });
                Core.WBM.Asm.AddLine("call {0}", new object[] { VMTPtr(VMT_Interact) });
    
                UIntPtr smsg = Imports.GetProcAddress(LoadLibrary("User32.dll"), "SendMessageA");
    
                Core.WBM.Asm.AddLine("push {0}", Core.WBM.ProcessId);
                Core.WBM.Asm.AddLine("push {0}", Core.WBM.ProcessId);
                Core.WBM.Asm.AddLine("push {0}", 0xBEEF);
                Core.WBM.Asm.AddLine("push {0}", (IntPtr)Core.hWnd);
                 
                Core.WBM.Asm.AddLine("mov eax, {0}", smsg);
                Core.WBM.Asm.AddLine("call eax");
    
                Core.WBM.Asm.AddLine("retn");
    
                uint codecave = Core.WBM.AllocateMemory();
                Core.WBM.Asm.InjectAndExecute(codecave);
                Core.WBM.FreeMemory(codecave);
            }
    
            uint VMTPtr(uint offset)
            {
                return Core.WBM.ReadUInt(Core.WBM.ReadUInt(BaseAddress) + offset);
            }
    and where I call it:
    Code:
                    if (curObj.Type == 3)       // NPC
                    {
                        NPCObject NPCO = new NPCObject(curObj.BaseAddress);
                        NPCObjectList.Add(curObj.GUID, NPCO);
                        NPCDump.WriteLine("[Name: " + NPCO.Name + "] [GUID: " + NPCO.GUID + "] [Health: " + NPCO.Health.ToString() + "/" + NPCO.MaxHealth.ToString() + " (" + NPCO.HealthPercent.ToString() + "%)] [Position: " + NPCO.Location.ToString() + "]");
                        if (NPCO.Location.DistanceToSelf <= 15)
                        {
                            NPCO.Interact();
                        }
                    }

    Interacting with object
  2. #2
    ramey's Avatar Member
    Reputation
    45
    Join Date
    Jan 2008
    Posts
    320
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm so glad I don't have to do ugly code caving

  3. #3
    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)
    Well you have a lot of stuff in the codecave that isn't needed (in my opinion, which does not mean anything ^^)
    Im doing it this way and it works fine:
    Code:
                wow.Asm.Clear();
                wow.Asm.AddLine("fs mov eax, [0x2C]");
                wow.Asm.AddLine("mov eax, [eax]");
                wow.Asm.AddLine("add eax, 0x10");
                wow.Asm.AddLine("mov dword [eax], {0}", ObjectManager.objectManagerBase);
                wow.Asm.AddLine("mov ecx, {0}", obj.BaseAddress);
                wow.Asm.AddLine("call {0}", VMT38);
                wow.Asm.AddLine("retn");

  4. #4
    miceiken's Avatar Contributor Authenticator enabled
    Reputation
    209
    Join Date
    Dec 2007
    Posts
    401
    Thanks G/R
    7/9
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That's it?
    I take objectManagerBase is the same as curMgr
    and what is VMT38 defined as?

  5. #5
    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)
    What is curMgr holding?

    VMT38:
    Code:
    uint VMT38 = wow.ReadUInt((wow.ReadUInt(obj.BaseAddress)) + (38 * 4));

  6. #6
    miceiken's Avatar Contributor Authenticator enabled
    Reputation
    209
    Join Date
    Dec 2007
    Posts
    401
    Thanks G/R
    7/9
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Okay, thanks.
    about curMgr, I was wondering if objectManagerBase as used in your code is the same as curMgr:
    Code:
    Core.WBM.ReadUInt(Core.WBM.ReadUInt(clientConnectionOffset) + objectManagerOffset);

  7. #7
    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)
    yes it's the same

  8. #8
    miceiken's Avatar Contributor Authenticator enabled
    Reputation
    209
    Join Date
    Dec 2007
    Posts
    401
    Thanks G/R
    7/9
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Okay, thanks for the help, I do now have this (entire Asm injection)
    Code:
            public void Interact()
            {
                Core.WBM.Asm.Clear();
                Core.WBM.Asm.AddLine("fs mov eax, [0x2C]");
                Core.WBM.Asm.AddLine("mov eax, [eax]");
                Core.WBM.Asm.AddLine("add eax, 0x10");
                Core.WBM.Asm.AddLine("mov dword [eax], {0}", CurMgr);
                Core.WBM.Asm.AddLine("mov ecx, {0}", BaseAddress);
                Core.WBM.Asm.AddLine("call {0}", VMTPtr(VMT_Interact));
                Core.WBM.Asm.AddLine("retn");
    
                uint codecave = Core.WBM.AllocateMemory();
                Core.WBM.Asm.InjectAndExecute(codecave);
                Core.WBM.FreeMemory(codecave);
            }
    It does crash with the same error however, am I missing a debug privilige or a instance to the mainthread? I am pretty blank at this stuff.

  9. #9
    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)
    try doing the
    Code:
    uint codecave = Core.WBM.AllocateMemory();
    before the asm stuff

  10. #10
    miceiken's Avatar Contributor Authenticator enabled
    Reputation
    209
    Join Date
    Dec 2007
    Posts
    401
    Thanks G/R
    7/9
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Tried that now, yet it fails.
    Code:
            public void Interact()
            {
                uint codecave = Core.WBM.AllocateMemory();
                Core.WBM.Asm.Clear();
    
                Core.WBM.Asm.AddLine("fs mov eax, [0x2C]");
                Core.WBM.Asm.AddLine("mov eax, [eax]");
                Core.WBM.Asm.AddLine("add eax, 0x10");
                Core.WBM.Asm.AddLine("mov dword [eax], {0}", CurMgr);
                Core.WBM.Asm.AddLine("mov ecx, {0}", BaseAddress);
                Core.WBM.Asm.AddLine("call {0}", VMTPtr(VMT_Interact));
                Core.WBM.Asm.AddLine("retn");
    
                Core.WBM.Asm.InjectAndExecute(codecave);
                Core.WBM.FreeMemory(codecave);
            }
    
            uint VMTPtr(uint offset)
            {
                return Core.WBM.ReadUInt(Core.WBM.ReadUInt(BaseAddress) + offset);
            }

  11. #11
    miceiken's Avatar Contributor Authenticator enabled
    Reputation
    209
    Join Date
    Dec 2007
    Posts
    401
    Thanks G/R
    7/9
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Am I missing some pieces? kynox mentioned that I am missing size allocation.

  12. #12
    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)
    try moving the objects baseaddress into eac not ecx

    edit:
    works for me without allocationsize as well

  13. #13
    miceiken's Avatar Contributor Authenticator enabled
    Reputation
    209
    Join Date
    Dec 2007
    Posts
    401
    Thanks G/R
    7/9
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Didn't work either...
    I haven't set a debug privilige nor injected to a thread, might this be it?

  14. #14
    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)
    into eac not ecx
    sorry i was mistaken there.

    is yout program "attached" to wow?
    else your curMgr would hold a nullpointer reference i think.

  15. #15
    miceiken's Avatar Contributor Authenticator enabled
    Reputation
    209
    Join Date
    Dec 2007
    Posts
    401
    Thanks G/R
    7/9
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, why of course it is

Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 4
    Last Post: 11-13-2016, 03:18 AM
  2. [Help Request] Interact with Object (CTM)
    By Mr.Zunz in forum WoW Memory Editing
    Replies: 7
    Last Post: 09-03-2009, 08:06 PM
  3. Interact with AutoIt ...
    By Dalord Urgod in forum WoW Memory Editing
    Replies: 12
    Last Post: 04-15-2009, 11:05 PM
  4. interacting with diffrent things as zombie
    By whorkitty in forum World of Warcraft Exploration
    Replies: 10
    Last Post: 10-26-2008, 09:23 AM
  5. How to make horde interact with Alliance?
    By zlo in forum World of Warcraft Emulator Servers
    Replies: 4
    Last Post: 08-05-2008, 08:29 AM
All times are GMT -5. The time now is 09:31 PM. 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