So, currently I've been reverse engineering an application, that allows Lua coding. Because for some special purposes, I need to call Lua directly by C/C++ coding. However, as this application is compiled obviously, I can't simply write a function that calls it. I would need the signature of the original functions (incl. the mask) and then write the function prototype, with calling convention, return type, etc. and later compile it as DLL, then inject it.All this was done already. I've got the signature by IDAPro using the SigMaker plugin, made the base functions for scanning for the pattern and the masks. So, that's how for example the Lua Print Functions looks like:DEC_FUNC(__cdecl, DWORD, print, int a1); Looking into the Lua source, a1 is lua_State *L. How would I now call this function and for example print hello world in Lua? Excuse me for my incompetence in such things like that, but I've been stuck to this for a couple of days now.For comparison you may look here to the code part from lbaselib.c (in the Lua source):static int luaB_print (lua_State *L) {int n = lua_gettop(L);  // number of argumentsint i;lua_getglobal(L, tostring);for (i=1; i<=n; i++) {const char *s;lua_pushvalue(L, -1);  // function to be calledlua_pushvalue(L, i);   // value to printlua_call(L, 1, 1);s = lua_tostring(L, -1);  // get resultif (s == NULL)  return luaL_error(L, LUA_QL(tostring)  must return a string to                        LUA_QL(print));if (i>1) fputs(\t, stdout);fputs(s, stdout);lua_pop(L, 1);  // pop result}fputs(\n, stdout);return 0;}    Thanks in advance. If some more information is needed, I may provide it of course.
Calling Lua by C/C++ in compiled applications
dll;c++