it seems i can't get the lua dostring return,why? menu

Shout-Out

User Tag List

Results 1 to 12 of 12
  1. #1
    ranassa's Avatar Member
    Reputation
    1
    Join Date
    Oct 2010
    Posts
    37
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    it seems i can't get the lua dostring return,why?

    i used iHook do luastring successfully,but i can't get the lua return like this

    Lua_DoString(@"(function()
    local d1, d2, d3
    if (GlueDialog:IsShown()) then
    d1 = GlueDialog.which
    d2 = GlueDialogText:GetText()
    if (GlueDialogHTML:IsShown()) then
    d3 = 'html'
    end
    else
    if (TOSFrame:IsShown()) then
    d1 = string.lower(TOSFrame.noticeType)
    local scrollbar = _G[TOSFrame.noticeType .. 'ScrollFrameScrollBar'];
    if (scrollbar:IsShown()) then
    local min, max = scrollbar:GetMinMaxValues()
    scrollbar:SetValue(max)
    end
    end
    end
    return CURRENT_GLUE_SCREEN, CURRENT_GLUE_PENDING, d1, d2, d3, IsConnectedToServer()
    end)()");

    CurrentGlueScreen = Lua_GetLocalizedText(0);
    string PendingScreen = Lua_GetLocalizedText(1);
    CurrentGlueDialog = Lua_GetLocalizedText(2);
    string DialogText = Lua_GetLocalizedText(3);
    string d3 = Lua_GetLocalizedText(4);
    string Connected = Lua_GetLocalizedText(5);

    can any1 tell why?

    ---------- Post added at 06:23 AM ---------- Previous post was at 06:22 AM ----------

    Hook.DoString("d2 = GlueDialogText:GetText()");
    Console.WriteLine("Value: " + Hook.GetLocalizedText("d2"));

    it's my code with iHook,but client crashed

    it seems i can't get the lua dostring return,why?
  2. #2
    JuJuBoSc's Avatar Banned for scamming CoreCoins Purchaser
    Reputation
    1019
    Join Date
    May 2007
    Posts
    922
    Thanks G/R
    1/3
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    As you are out of game, i'm 99% that iHook pass null pointer, so it crash, instead of use iHook, write your own and u should be able to call lua_GetLocalizedText when not in game.

  3. #3
    ranassa's Avatar Member
    Reputation
    1
    Join Date
    Oct 2010
    Posts
    37
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thank you jujubosc,i have made it with blackmagic,hooking and unhooking successfully,also
    DoLuaString works well,but GetLocalizedText failure(got nothing),here is my code below,
    can you help me?


    public static string GetLocalizedText(string Command)
    {
    // Allocate memory for command
    uint Lua_GetLocalizedText_Space = wowMagic.AllocateMemory(Encoding.UTF8.GetBytes(Command).Length + 1);

    // offset:
    FrameScript__GetLocalizedText = wowBaseAddr + FrameScript__GetLocalizedText;
    ClntObjMgrGetActivePlayerObj = wowBaseAddr + ClntObjMgrGetActivePlayerObj;

    // Write command in the allocated memory
    wowMagic.WriteBytes(Lua_GetLocalizedText_Space, Encoding.UTF8.GetBytes(Command));

    String[] asm = new String[]
    {
    "call " + (uint)ClntObjMgrGetActivePlayerObj,
    "mov ecx, eax",
    "push -1",
    "mov edx, " + Lua_GetLocalizedText_Space + "",
    "push edx",
    "call " + (uint)FrameScript__GetLocalizedText,
    "retn",
    };
    // Inject the shit
    string sResult = Encoding.ASCII.GetString(InjectAndExecute(asm));

    // Free memory allocated for command
    wowMagic.FreeMemory(Lua_GetLocalizedText_Space);

    // Uninstall the hook
    return sResult;
    }

  4. #4
    JuJuBoSc's Avatar Banned for scamming CoreCoins Purchaser
    Reputation
    1019
    Join Date
    May 2007
    Posts
    922
    Thanks G/R
    1/3
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    "call " + (uint)ClntObjMgrGetActivePlayerObj, <- this will return 0 if u are not in game, that's why.

    My guess is you should call FrameScript_GetText directly.

  5. #5
    ranassa's Avatar Member
    Reputation
    1
    Join Date
    Oct 2010
    Posts
    37
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    but i get nothing even when i am ingame(it's string.empty,not null),i will try FrameScript__GetLocalizedText on both asm call,thank you again JuJuBoSc;


    and another problem with my code is that i can't Do_LuaString without character logging in the game.i can play DoEmote("Dance") ingame,but when i try to DefaultServerLogin in the login frame,client crashes.not the lua,offset issue,since it works well for me when i use iHook,here is my code below.

    public static void LuaDoString(string command)
    {
    FrameScript_ExecuteBuffer = wowBaseAddr + FrameScript_ExecuteBuffer;

    // Allocate memory and write somethins
    uint codeCave = wowMagic.AllocateMemory(command.Length + 0x100);
    wowMagic.WriteASCIIString(codeCave, command);

    // Write the asm stuff for Lua_DoString
    String[] asm = new String[]
    {
    "mov eax, " + codeCave,
    "push 0",
    "push eax",

    "push eax",
    "mov eax, " + FrameScript_ExecuteBuffer, // Lua_DoString

    "call eax",
    "add esp, 0xC",
    "retn",
    };

    InjectAndExecute(asm); // Inject
    wowMagic.FreeMemory(codeCave); // Free memory allocated
    }

  6. #6
    ranassa's Avatar Member
    Reputation
    1
    Join Date
    Oct 2010
    Posts
    37
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    how i can rep somebody?

  7. #7
    Serpious's Avatar Contributor CoreCoins Purchaser
    Reputation
    134
    Join Date
    Jul 2011
    Posts
    364
    Thanks G/R
    0/1
    Trade Feedback
    4 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by ranassa View Post
    how i can rep somebody?
    Press the "rep" button?

  8. #8
    ranassa's Avatar Member
    Reputation
    1
    Join Date
    Oct 2010
    Posts
    37
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    rep given.ohhhhhhhhhhhhhhhhhhhhhhhhh

  9. #9
    JuJuBoSc's Avatar Banned for scamming CoreCoins Purchaser
    Reputation
    1019
    Join Date
    May 2007
    Posts
    922
    Thanks G/R
    1/3
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Strange, I remember someone already posted on that crash with defaultserverlogin ...

  10. #10
    _Mike's Avatar Contributor
    Reputation
    310
    Join Date
    Apr 2008
    Posts
    531
    Thanks G/R
    0/2
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is lua thread-safe? (Assuming InjectAndExecute() is a wrapper for CreateRemoteThread().. If it runs from the main thread then just ignore this post)

  11. #11
    ranassa's Avatar Member
    Reputation
    1
    Join Date
    Oct 2010
    Posts
    37
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thank you mike,thank you JuJuBoSc,it's regret i can't rep you twice.

    i have fix it after stealed some code from other sample,defaultserverlogin and GetLocalizedText both works well now.
    but how i get the LuaDoString return when i am not login my character?

    like this:
    Lua_DoString(@"(function()
    local d1, d2, d3
    if (GlueDialog:IsShown()) then
    d1 = GlueDialog.which
    d2 = GlueDialogText:GetText()
    if (GlueDialogHTML:IsShown()) then
    d3 = 'html'
    end
    else
    if (TOSFrame:IsShown()) then
    d1 = string.lower(TOSFrame.noticeType)
    local scrollbar = _G[TOSFrame.noticeType .. 'ScrollFrameScrollBar'];
    if (scrollbar:IsShown()) then
    local min, max = scrollbar:GetMinMaxValues()
    scrollbar:SetValue(max)
    end
    end
    end
    return CURRENT_GLUE_SCREEN, CURRENT_GLUE_PENDING, d1, d2, d3, IsConnectedToServer()
    end)()");

    CurrentGlueScreen = Lua_GetLocalizedText(0);
    string PendingScreen = Lua_GetLocalizedText(1);
    CurrentGlueDialog = Lua_GetLocalizedText(2);
    string DialogText = Lua_GetLocalizedText(3);
    string d3 = Lua_GetLocalizedText(4);
    string Connected = Lua_GetLocalizedText(5);

    how i get CURRENT_GLUE_SCREEN, CURRENT_GLUE_PENDING, d1, d2, d3, IsConnectedToServer()?
    when i tried to do this(in the login frame i typed a wrong account,it show a GlueDialog):

    LuaDoString("d2=GlueDialogText:GetText()")
    string test = GetLocalizedText("d2");

    client crashed

  12. #12
    debiangrub3's Avatar Private
    Reputation
    1
    Join Date
    Aug 2011
    Posts
    5
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if you are not ingame.


    you must to do this:

    1.hook d3d9.
    2.use Lua Stack And C++ to Access .(lua access c++ and c++ access lua). In the wow,you only learn c++ access lua.

    there is Keywords maybe help you to search:
    lua_gettop,lua_settop,lua_open,luaL_loadbuffer,*lua_Reader,lua_pcall,Lua_ToLStri ng

    thanks.

Similar Threads

  1. [Question] How can I get the spectral realm spells working?
    By dude891 in forum World of Warcraft Emulator Servers
    Replies: 1
    Last Post: 05-24-2008, 01:18 AM
  2. Can anyone get the codes used to create this keylogger
    By Guzey in forum World of Warcraft General
    Replies: 3
    Last Post: 02-16-2008, 11:58 PM
  3. How can i get the pw to this account
    By Swordfish999 in forum World of Warcraft General
    Replies: 7
    Last Post: 02-13-2008, 03:37 PM
  4. Where can i get the latest NCDB logon database ?
    By Wheeze201 in forum World of Warcraft Emulator Servers
    Replies: 7
    Last Post: 01-04-2008, 11:40 AM
All times are GMT -5. The time now is 06:29 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