hijack lua_State ... need some advice menu

User Tag List

Results 1 to 4 of 4
  1. #1
    R3peat's Avatar Site Donator while(true) CoreCoins Purchaser
    Reputation
    190
    Join Date
    Aug 2012
    Posts
    424
    Thanks G/R
    0/132
    Trade Feedback
    68 (99%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    hijack lua_State ... need some advice

    i grab game's original lua_State* from gettop or dostring it doesnt matter cause they are the same

    but once i grabbed it and when i wanna use game's original state in lua api calls like "lua_pushstring"

    it throws me access violation exceptions

    "Unhandled exception at 0x00007FF8DF3F4EE5 (my.dll) in BlackDesert64.exe: 0xC0000005: Access violation reading location 0x0000000000000018."

    which is inside luaS_new in this case but its not just inside that api call its in all api calls when i use games state

    when i create a new state and use it everything works fine

    mby someone out there knows something about. alrdy googled a lot but found nothing

    hijack lua_State ... need some advice
  2. #2
    Jadd's Avatar 🐸 Premium Seller
    Reputation
    1511
    Join Date
    May 2008
    Posts
    2,432
    Thanks G/R
    81/333
    Trade Feedback
    1 (100%)
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Sounds like you're unbalancing the stack. If you're pushing a variable without popping it (lua_settop) you're going to crash of course.

    Post your full code for the lua call.

  3. #3
    R3peat's Avatar Site Donator while(true) CoreCoins Purchaser
    Reputation
    190
    Join Date
    Aug 2012
    Posts
    424
    Thanks G/R
    0/132
    Trade Feedback
    68 (99%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I use LuaIntf to try to bind a c++ func to the hijacked lua context. Straight in the LuaBind(L*) init it happens

    Will post more detailed code later don't have access to it right now

  4. #4
    R3peat's Avatar Site Donator while(true) CoreCoins Purchaser
    Reputation
    190
    Join Date
    Aug 2012
    Posts
    424
    Thanks G/R
    0/132
    Trade Feedback
    68 (99%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    LuaIntf::LuaBinding(grabbed L* goes here).beginModule("someModule")
    when i wanna call this

    exception is thrown in this function of LuaIntf straight after "lua_pushglobaltable(L);"

    /**
    * Get global table (_G).
    */
    static LuaRef globals(lua_State* L)
    {
    lua_pushglobaltable(L);
    return popFromStack(L);
    }

Similar Threads

  1. Replies: 8
    Last Post: 02-11-2017, 05:14 PM
  2. My signature - need some advice :D
    By rickit in forum World of Warcraft General
    Replies: 2
    Last Post: 08-14-2007, 11:18 PM
  3. Need some advice :)
    By Snyper in forum World of Warcraft General
    Replies: 0
    Last Post: 08-13-2007, 04:03 AM
  4. need some advice =]
    By Tubz in forum Community Chat
    Replies: 1
    Last Post: 07-15-2007, 03:27 PM
  5. Need some advice in regards to item creation for WoWEmu
    By Gothian in forum World of Warcraft General
    Replies: 1
    Last Post: 08-27-2006, 06:52 AM
All times are GMT -5. The time now is 05:09 AM. 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