QuestionSolvedHow to get lua state??

Posts 1–10 of 10 · Page 1 of 1
How to get lua state??
Guy'os I need your help, how to get client lua state and run code on it?
Code:
#include <Windows.h>
#include <ILuaInterface.h>

#define ver "LUASHARED003"

typedef void* (*CreateInterfaceFn)(const char *pName, int *pReturnCode);

typedef int(*load)(lua_State *, const char *);

typedef int(*pcall)(lua_State *, int, int, int);

BOOL WINAPI DllMain(
    HINSTANCE h,
    DWORD fdwReason,
    LPVOID lp)
{
    if (fdwReason == DLL_PROCESS_ATTACH) {


        HMODULE luash = GetModuleHandle(L"lua_shared.dll");

        CreateInterfaceFn sh_factory = (CreateInterfaceFn) GetProcAddress(luash, "CreateInterface");

        load Lua_Load = (load) GetProcAddress(luash, "luaL_loadstring");

        pcall Lua_Call = (pcall) GetProcAddress(luash, "lua_pcall");
        
    }

    return TRUE;
}
Quote Originally Posted by PolisNature)) View Post
Guy'os I need your help, how to get client lua state and run code on it?
Code:
#include <Windows.h>
#include <ILuaInterface.h>

#define ver "LUASHARED003"

typedef void* (*CreateInterfaceFn)(const char *pName, int *pReturnCode);

typedef int(*load)(lua_State *, const char *);

typedef int(*pcall)(lua_State *, int, int, int);

BOOL WINAPI DllMain(
    HINSTANCE h,
    DWORD fdwReason,
    LPVOID lp)
{
    if (fdwReason == DLL_PROCESS_ATTACH) {


        HMODULE luash = GetModuleHandle(L"lua_shared.dll");

        CreateInterfaceFn sh_factory = (CreateInterfaceFn) GetProcAddress(luash, "CreateInterface");

        load Lua_Load = (load) GetProcAddress(luash, "luaL_loadstring");

        pcall Lua_Call = (pcall) GetProcAddress(luash, "lua_pcall");
        
    }

    return TRUE;
}
Why are you grabbing your interface if you're going to use the "luaL_" functions?

I havn't used the Lua interface in forever but from what I remember you can hook CreateLuaInterface and grab your lua state there.
I typed another code in last so ... *And I thought interface needed to get lua state.
If you need help, drop me your steamid and I'll help you out, provided that you at least know how to write code in C++
Why you can't just reply an example?
STEAM_0:1:58468379
Quote Originally Posted by PolisNature)) View Post
Why you can't just reply an example?
Because I'm not going to spoon feed you
Quote Originally Posted by _haffy View Post
Because I'm not going to spoon feed you
haffy pls gib lolismasher src okay thank you
Quote Originally Posted by 0 - p100 real quick View Post
haffy pls gib lolismasher src okay thank you


Wow why are people asking for a garbage cheat
Been over a week since last update/bump, assuming solved.

/Closed.
Posts 1–10 of 10 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us