[2.4.3] Having trouble calling DoString from LUA menu

User Tag List

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

    [2.4.3] Having trouble calling DoString from LUA

    Warning: ASM noob here
    Title had typo: Meant to say calling DoString from ASM not LUA

    I know the offset for DoString is Wow.exe+306c80 (also 0x706c80 since tbc does not use ASLR)

    I found a function which calls DoString at 0x495ECA
    Here is what the function that calls DoString looks like
    [2.4.3] Having trouble calling DoString from LUA-ckvulmj-png

    Here is what DoString looks like in 2.4.3.
    [2.4.3] Having trouble calling DoString from LUA-syvh0ra-gif

    I hooked endscene and detoured to my codecave if a flag is on. I turn the flag on after I write to my codecave so it is only executed when my flag is on. I have this part working. The problem is I am having issues calling DoString from my codecave.

    This is what I had came up with to try to call DoString from my codecave, but it blows up. I was trying to mimic what the function at 0x495ECA was doing to call DoString.


    Code:
    String[] asm = new String[]
    {
        "push 0",
        "mov eax, ["+LuaExecuteScriptPtr+"]", //Pointer to null terminated C string with LUA script to be executed
        "push eax",
        "push eax",
        "call 0x706C80", //call LUA DoString
        "add esp,12",
        "retn",
    };
    Any hints would be greatly appreciated
    Last edited by pinny; 03-11-2017 at 11:07 AM.

    [2.4.3] Having trouble calling DoString from LUA
  2. #2
    squiggy's Avatar Active Member
    Reputation
    66
    Join Date
    Aug 2007
    Posts
    45
    Thanks G/R
    40/23
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    here, you want to push the pointer to the stack, not the first char. I think that should solve it.

    Code:
    //old "mov eax, ["+LuaExecuteScriptPtr+"]", //Pointer to null terminated C string with LUA script to be executed
    "mov eax, "+ LuaExecuteScriptPtr
    If your interested here's the function signature: int __cdecl FrameScript__Execute(int a1, int a2, int a3)
    Last edited by squiggy; 03-11-2017 at 11:38 AM.

  3. Thanks pinny, natt_ (2 members gave Thanks to squiggy for this useful post)
  4. #3
    pinny's Avatar Active Member
    Reputation
    29
    Join Date
    Jan 2010
    Posts
    211
    Thanks G/R
    7/2
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by squiggy View Post
    here, you want to push the pointer to the stack, not the first char. I think that should solve it.

    Code:
    //old "mov eax, ["+LuaExecuteScriptPtr+"]", //Pointer to null terminated C string with LUA script to be executed
    "mov eax, "+ LuaExecuteScriptPtr
    If your interested here's the function signature: int __cdecl FrameScript__Execute(int a1, int a2, int a3)
    Thank you so much squiggy I can't believe it was something so stupid!

  5. #4
    squiggy's Avatar Active Member
    Reputation
    66
    Join Date
    Aug 2007
    Posts
    45
    Thanks G/R
    40/23
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    an easy mistake to make, glad it got sorted

  6. Thanks Corthezz, natt_ (2 members gave Thanks to squiggy for this useful post)

Similar Threads

  1. Replies: 12
    Last Post: 02-28-2017, 11:00 AM
  2. [Bot] Injection code into wow. Do you have to call functions from the main thread?
    By Miivers in forum World of Warcraft Bots and Programs
    Replies: 2
    Last Post: 01-13-2014, 02:56 PM
  3. Replies: 2
    Last Post: 07-19-2012, 03:22 PM
  4. Trouble Calling SetFacing from VMT (I think)
    By BraveSoul in forum WoW Memory Editing
    Replies: 1
    Last Post: 03-24-2009, 08:47 AM
  5. Having trouble making an account have admin setting from DB
    By chernoble in forum World of Warcraft Emulator Servers
    Replies: 2
    Last Post: 10-16-2007, 09:34 AM
All times are GMT -5. The time now is 01:50 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