[WoW] [5.4.7] lua_State x86 menu

Shout-Out

User Tag List

Results 1 to 7 of 7
  1. #1
    OMLinux's Avatar Private
    Reputation
    1
    Join Date
    Dec 2013
    Posts
    9
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [WoW] [5.4.7] lua_State x86

    Hi folks!

    How I can get lua_State ptr? How many lua_States in WoW? Is each addition and console have each own lua_State? Someone pointed that lua_API can be called not only from main thread.

    P.S. I have an idea of hooking lua_open/lua_close for tracking all states (looks like not safe enough). But what about thread local storage, is lua_State ptr there?

    Best regards and ty

    [WoW] [5.4.7] lua_State x86
  2. #2
    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)
    As far as I know there is only one lua_state in wow and lua by itself is not thread safe, see lua-users wiki: Threads Tutorial.
    It wouldnt make sense when each addon has its own lua state, since you can access variables and functions from other addons just fine (as long as they are defined in _G, ofc :P)

    I cant help you on the topic of how get a state ptr at runtime without hooking a registered function, though :/ But why would you want to do this anyway?
    "Threads should always commit suicide - they should never be murdered" - DirectX SDK

  3. #3
    OMLinux's Avatar Private
    Reputation
    1
    Join Date
    Dec 2013
    Posts
    9
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by xalcon View Post
    As far as I know there is only one lua_state in wow and lua by itself is not thread safe, see lua-users wiki: Threads Tutorial.
    It wouldnt make sense when each addon has its own lua state, since you can access variables and functions from other addons just fine (as long as they are defined in _G, ofc :P)

    I cant help you on the topic of how get a state ptr at runtime without hooking a registered function, though :/ But why would you want to do this anyway?
    Calling lua registered C-callbacks directly from native code (for example from EndScene) allows avoiding add-on registration.

  4. #4
    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, I call the callbacks using FrameScript::ExecuteBuffer, so I dont need the lua_state. You could just reverse that function since it has to retrieve the lua_state anyhow.... or call ExecuteBuffer yourself :P
    "Threads should always commit suicide - they should never be murdered" - DirectX SDK

  5. #5
    Nonowmana's Avatar Contributor
    Reputation
    125
    Join Date
    Apr 2009
    Posts
    259
    Thanks G/R
    0/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    lua_State = 0xBA5C98 (rebased)

    According to FrameScript__GetContext
    Anthraxbot & SPQR Creator / Administrator

  6. #6
    OMLinux's Avatar Private
    Reputation
    1
    Join Date
    Dec 2013
    Posts
    9
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Nonowmana View Post
    lua_State = 0xBA5C98 (rebased)

    According to FrameScript__GetContext
    Thanks you
    +Rep

  7. #7
    ioctl's Avatar Active Member
    Reputation
    23
    Join Date
    Jan 2013
    Posts
    35
    Thanks G/R
    2/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I usually find it by looking through the disassembly for pushes of -10002 (LUA_GLOBALS), ffffd8ee in hex, and looking for constants in the preceding few lines.

    Code:
      44f1f0: 8b 35 98 5c fa 00     mov    0xfa5c98,%esi    <----- Here it is.
      44f1f6: ff 75 10              pushl  0x10(%ebp)
      44f1f9: 56                    push   %esi
      44f1fa: e8 43 7a 08 00        call   0x4d6c42
      44f1ff: 68 ee d8 ff ff        push   $0xffffd8ee

Similar Threads

  1. [WoW][5.0.4.16016] x86 Info Dump Thread
    By noctural in forum WoW Memory Editing
    Replies: 134
    Last Post: 05-06-2014, 01:40 AM
  2. [WoW][5.1.0.16357] x86 Info Dump Thread
    By TOM_RUS in forum WoW Memory Editing
    Replies: 46
    Last Post: 11-27-2013, 04:34 AM
  3. [WoW][5.1.0.16309] x86 Info Dump Thread
    By TOM_RUS in forum WoW Memory Editing
    Replies: 70
    Last Post: 02-02-2013, 09:13 AM
  4. [WoW][5.0.5.16048] x86 Info Dump Thread
    By eracer in forum WoW Memory Editing
    Replies: 81
    Last Post: 11-23-2012, 04:04 AM
  5. [WoW][5.0.5.16135] x86 Info Dump Thread
    By eracer in forum WoW Memory Editing
    Replies: 7
    Last Post: 10-11-2012, 10:58 PM
All times are GMT -5. The time now is 09:33 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