is it possible to inject ingame not allowed lua code ?
Forum rules
This is a sub-forum for things specific to MicroMacro.
This is not the place to ask questions about the RoM bot, which uses MicroMacro. There is a difference.
This is a sub-forum for things specific to MicroMacro.
This is not the place to ask questions about the RoM bot, which uses MicroMacro. There is a difference.
is it possible to inject ingame not allowed lua code ?
Hi,
i hope i've read it correct - it's not possible/allowed to use the "require" function inside the lua VM in runes of magic.
But i need this, cause i want include a luapackage into my addon which give me access to non-lua-written-libraries.
Most likely i cant inject forbidden code, but who knows ....
thanx in advance
Micke
i hope i've read it correct - it's not possible/allowed to use the "require" function inside the lua VM in runes of magic.
But i need this, cause i want include a luapackage into my addon which give me access to non-lua-written-libraries.
Most likely i cant inject forbidden code, but who knows ....
thanx in advance
Micke
- Administrator
- Site Admin
- Posts: 5307
- Joined: Sat Jan 05, 2008 4:21 pm
Re: is it possible to inject ingame not allowed lua code ?
You could hook the luaL_openlibs() and luaL_register() Lua functions. Your openlibs would be something like this:
Code: Select all
static int myLuaFunction(lua_State *lstate)
{
return 0;
}
LUAL_OPENLIBS hook_luaL_openlibs(lua_State *lstate)
{
int success = real_luaL_openlibs(lstate); -- Install standard libraries
static const lua_reg regMap[] = {
{"myLuaFunction", myLuaFunction},
{NULL, NULL}
};
real_luaL_register(lstate, "myLibraryName", regMap); -- Install custom library
-- You can now call myLuaFunction() from within the Lua VM
return success;
}
Re: is it possible to inject ingame not allowed lua code ?
puuh, wow, big thnx .... didn't knew that i can catch a foreign VM and use her as if i have initiated her, can't i ?
understand, but if it is so easy, i wonder why so many guys writing their addons in LUA, instead of reduce the lua code to a minimum and handle the logic in a less primitive language.
ok ok ....
thanx a lot admin
( even if i know i will spent some hours with your example, finishing with 2 new questions )
understand, but if it is so easy, i wonder why so many guys writing their addons in LUA, instead of reduce the lua code to a minimum and handle the logic in a less primitive language.
ok ok ....
thanx a lot admin
( even if i know i will spent some hours with your example, finishing with 2 new questions )
- Administrator
- Site Admin
- Posts: 5307
- Joined: Sat Jan 05, 2008 4:21 pm
Re: is it possible to inject ingame not allowed lua code ?
You've got it backwards. Lua is a high-level scripting language while C is a (relatively) low-level programming language. It's almost like comparing apples and oranges.understand, but if it is so easy, i wonder why so many guys writing their addons in LUA, instead of reduce the lua code to a minimum and handle the logic in a less primitive language.
One (Lua) is quick and simple, while the other (C) is dirty, hackish, and requires a lot of knowledge and experience because it works by exploiting how a portable executable works.
Re: is it possible to inject ingame not allowed lua code ?
using the attribute primitive i won't affront someone,
i miss the advantages of the object oriented aspect.
anyway ...
do u have pls some keywords to find posts how to catch the Lua VM hosted in ROM ?
I would complete your example with
#include "lua.h"
#include "lauxlib.h"
#include "lualib.h"
lua_State *lstate = luaL_newstate();
But how do i know what class/type/lib ROM is using for that ?
thnx in advance
Micke
i miss the advantages of the object oriented aspect.
anyway ...
do u have pls some keywords to find posts how to catch the Lua VM hosted in ROM ?
I would complete your example with
#include "lua.h"
#include "lauxlib.h"
#include "lualib.h"
lua_State *lstate = luaL_newstate();
But how do i know what class/type/lib ROM is using for that ?
thnx in advance
Micke
- Administrator
- Site Admin
- Posts: 5307
- Joined: Sat Jan 05, 2008 4:21 pm
Re: is it possible to inject ingame not allowed lua code ?
You don't need to worry about that. You're looking at function hooking.
Include the attached files in your project. Read the readme. You'll use DetourFunc() to hook the two functions I stated earlier (and those are the only ones you need for now).
Here's an example of it:
http://forum.gamedeception.net/threads/ ... bix-detour.
Include the attached files in your project. Read the readme. You'll use DetourFunc() to hook the two functions I stated earlier (and those are the only ones you need for now).
Here's an example of it:
http://forum.gamedeception.net/threads/ ... bix-detour.
Re: is it possible to inject ingame not allowed lua code ?
oha, thnx admin, very helpful, really.
pls excuse when i dont answered immidiately, but its a very new topic for me and i first have to spent some time with your references - that as a small feedback that i've read all.
pls excuse when i dont answered immidiately, but its a very new topic for me and i first have to spent some time with your references - that as a small feedback that i've read all.
Re: is it possible to inject ingame not allowed lua code ?
found someones first steps
http://www.gamedeception.net/threads/16 ... s-(ex-Lua)
http://www.gamedeception.net/threads/16 ... s-(ex-Lua)
Who is online
Users browsing this forum: No registered users and 0 guests