LuaDoString menu

Shout-Out

User Tag List

Thread: LuaDoString

Results 1 to 7 of 7
  1. #1
    fvicaria's Avatar Active Member
    Reputation
    29
    Join Date
    Jan 2009
    Posts
    55
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    LuaDoString

    Hi guys,
    I know this has been discussed a lot but after looking old posts and comparing to my code I could find no obvious reason why this is not working:

    I tried to keep the code as simple as possible.


    When I run for example: LuaDoString("DoEmote(\"Dance\")")
    I get nothing. No crashes or dancing.

    Have I missed anything or is this supposed to work only via EndScene?


    Code:
            public void LuaDoString(string command)
            {
                // Offset:
                uint FrameScript__Execute = 0x43C010;
    
                // Allocate memory
                var args = Memory.AllocateMemory(Encoding.UTF8.GetBytes(command).Length + 1);
                var codecave = Memory.AllocateMemory(0x3332);
    
                // Write value:
                Memory.WriteBytes(args, Encoding.UTF8.GetBytes(command));
    
                try
                {
                    // Write the asm stuff for Lua_DoString
                    Memory.Asm.Clear();
                    Memory.Asm.AddLine("mov eax, " + args);
                    Memory.Asm.AddLine("push 0");
                    Memory.Asm.AddLine("push eax");
                    Memory.Asm.AddLine("push eax");
                    Memory.Asm.AddLine("mov eax, " + ((uint)Memory.MainModule.BaseAddress + FrameScript__Execute));
                    Memory.Asm.AddLine("call eax");
                    Memory.Asm.AddLine("add esp, 0xC");
                    Memory.Asm.AddLine("retn");
    
                    // Inject
                    Memory.Asm.InjectAndExecute(codecave);
                }
                catch (Exception ex)
                {
                    Debug.WriteLine(ex.StackTrace);
                }
                finally
                {
                    // Free memory allocated
                    Memory.FreeMemory(codecave);
                    Memory.FreeMemory(args);
                }
            }

    LuaDoString
  2. #2
    Master674's Avatar Elite User
    Reputation
    487
    Join Date
    May 2008
    Posts
    578
    Thanks G/R
    2/23
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Execute it in WoW's mainthread.

    You could write a function that Injects your code and remote executes it and then removes the detour instead of creating a new thread or whatever (I don't know what InjectAndExecute is).
    Last edited by Master674; 01-14-2012 at 06:13 AM.

  3. #3
    streppel's Avatar Active Member
    Reputation
    78
    Join Date
    Mar 2007
    Posts
    196
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    in wow you either have to hook endscene or update the local object manager(was sth like this, but not sure exactly as im not in wow) yourself for this to work.
    look in other threads here on ownedcore that handle dostring via createremotethread(this is what blackmagic does)

  4. #4
    fvicaria's Avatar Active Member
    Reputation
    29
    Join Date
    Jan 2009
    Posts
    55
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi guys,

    I see what you mean...
    But the method should work as is since I have another one that calls GetObjectName using exactly the same technique that works fine.

    I have two other ways to do this so no big deal but I am annoyed because it shows that there is something else to it that I can't see.

    Thanks!

  5. #5
    xalcon's Avatar Contributor ふたなり
    Authenticator enabled
    Reputation
    198
    Join Date
    Oct 2008
    Posts
    291
    Thanks G/R
    20/58
    Trade Feedback
    0 (0%)
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by fvicaria View Post
    But the method should work as is since I have another one that calls GetObjectName using exactly the same technique that works fine.
    Nope. The Lua_LoadString() function is a special one. The function can only be called inside the Main-Thread of Wow, where the rendering is done.
    Try this one, it is working realy well:
    http://www.ownedcore.com/forums/worl...lackmagic.html ([Sample Code] EndScene Hook with ASM and blackmagic)
    "Threads should always commit suicide - they should never be murdered" - DirectX SDK

  6. #6
    fvicaria's Avatar Active Member
    Reputation
    29
    Join Date
    Jan 2009
    Posts
    55
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey xalcon,
    I have been trying the implementation from RivalFr but I get exactly the same bahaviour.
    I cal LuaDoString with a simple Emote but nothing happens.

    Just like before.

    I am pretty sure all the offsets are correct.

    Has anything else change since?

    Thanks a lot.

  7. #7
    xalcon's Avatar Contributor ふたなり
    Authenticator enabled
    Reputation
    198
    Join Date
    Oct 2008
    Posts
    291
    Thanks G/R
    20/58
    Trade Feedback
    0 (0%)
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Well, you have copy'n'pasted the whole code into you project, edited the offsets and then ran it, do you?

    First of all: Don't copypasts stuff when you don't understand how it is working. When you are not able to understand some kind of stuff, you want to use, then you have to learn it.

    I think I know where you problem is... it is called the wow base address. But I might be wrong since I don't know your code.
    "Threads should always commit suicide - they should never be murdered" - DirectX SDK

Similar Threads

  1. LuaDoString detected by Warden?
    By yellow82 in forum WoW Memory Editing
    Replies: 5
    Last Post: 12-19-2014, 09:55 AM
  2. Curious of safety of my current EndScene/LUADoString
    By cvccbum in forum WoW Memory Editing
    Replies: 9
    Last Post: 07-06-2011, 04:21 PM
  3. Need help Select Questitem via Macro or Luadostring
    By hamburger12 in forum WoW Memory Editing
    Replies: 3
    Last Post: 03-10-2010, 05:04 PM
  4. How to find LuaDostring results?
    By Harland in forum WoW Memory Editing
    Replies: 1
    Last Post: 02-02-2009, 06:12 AM
All times are GMT -5. The time now is 08:48 AM. 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