Code:
lua_gettop_addr = 0x00488A80
lua_gettable_addr = 0x00488D00
lua_getfield_addr = 0x00489440
lua_pcall_addr = 0x00489B00
lua_remove_addr = 0x00488B00
Code:
L = Lua_GetState()
reset_security()
stack_begin = lua_gettop(L)
lua_gettable(L, LUA_GLOBALSINDEX)
lua_getfield(L, -1, name)
if lua_typename(L, lua_type(L, -1)) != "function":
print "function %s not found (%s)" % (name, lua_typename(L, lua_type(L, -1)))
return
lua_remove(L, -2) # remove table from stack
.....
push fn args on stack (if any)
.....
lua_pcall(L, len(args), LUA_MULTRET, 0)
stack_end = lua_gettop(L)
.....
get fn results from stack (if any) and remove it from stack
.....
this code is from my Python -> Lua bridge. its works in 3.3.3a (except reset_security - still not fixed after changes in 3.3.2 -> 3.3.3)