• How do I view the clientside Lua scripts sent by servers?
    11 replies, posted
I'm curious to see how some Lua scripts were written, more specifically the clientside scripts for Gmod Tower. The Lua scripts aren't in the content pack they have. I know their gamemode is private, but obviously I would still have the clientside portion. Where does it store the scripts it downloads?
[QUOTE=flarn2006;40113726]I'm curious to see how some Lua scripts were written, more specifically the clientside scripts for Gmod Tower. The Lua scripts aren't in the content pack they have. I know their gamemode is private, but obviously I would still have the clientside portion. Where does it store the scripts it downloads?[/QUOTE] Why am I being rated Dumb and Funny?
[QUOTE=flarn2006;40137887]Why am I being rated Dumb and Funny?[/QUOTE] Now its just dumb
You can get the files but they're compressed and unreadable, I don't think anyones figured out how to get them back to their readable state yet If you want to know how somethings done (and aren't, of course, just trying to steal from them), then ask the author or someone else.
[QUOTE=Drakehawke;40138397]You can get the files but they're compressed and unreadable, I don't think anyones figured out how to get them back to their readable state yet If you want to know how somethings done (and aren't, of course, just trying to steal from them), then ask the author or someone else.[/QUOTE] Hook ILuaInterface::RunString. Gets every lua file run on your client.
The files in cache/lua are just LZMA compressed with a slightly different header. You can use the Bootil LZMA functions to decompress them. The actual file names aren't saved here (they're sent over a stringtable IIRC) so this might not be of much use. [code] #include "Bootil/Bootil.h" using namespace Bootil; int main(int argc, char** argv) { BString folder = "C:/YourSteamApps/garrysmod/cache/lua"; String::List fileList; File::GetFilesInFolder(folder, fileList, false); BOOTIL_FOREACH_CONST(f, fileList, String::List) { AutoBuffer inBuf; File::Read(folder + "/" + *f, inBuf); // Extract using LZMA (first 4 bytes are junk) AutoBuffer outBuf; Compression::LZMA::Extract(inBuf.GetBase(4), inBuf.GetSize()-4, outBuf); // Write to file.luad File::Write(folder + "/" + *f + 'd', outBuf); } return 0; } [/code]
Thanks, but how do I hook ILuaInterface::RunString? Do I need to make a DLL for that? Why couldn't there just be an option to save them uncompressed?
I compiled a linux binary from McSimp's code [I](after a few minor improvements, also had to compile Bootil as a static library)[/I] that works! I was able to uncompress some of the GMod Tower Lua as a test, currently feelin' like the kid from wargames. (-snip- I just realized how idiotic it would be to release this) - [U][I]Linux[/I][/U] [B]USAGE:[/B] ./rocky <[I]your gmod lua cache folder[/I]>
Think you could compile it for windows?
[QUOTE=zerothefallen;42958761]Think you could compile it for windows?[/QUOTE] Yes, but I don't want everybody running around stealing clientside scripts. [editline]23rd November 2013[/editline] Does anyone know how to view the stringtable in which the file names are sent?
[QUOTE=rbreslow;42958571]I compiled a linux binary from McSimp's code [I](after a few minor improvements, also had to compile Bootil as a static library)[/I] that works! I was able to uncompress some of the GMod Tower Lua as a test, currently feelin' like the kid from wargames. -snip - [U][I]Linux[/I][/U] [B]USAGE:[/B] ./rocky <[I]your gmod lua cache folder[/I]>[/QUOTE] Are you fucking out of your mind? Delete this link. This will fuck gmod if it's released publicly in a compiled form. (Anyone who wants this already has it, but you just opened it up for skids)
[QUOTE=LennyPenny;42959119]Are you fucking out of your mind? Delete this link. This will fuck gmod if it's released publicly in a compiled form. (Anyone who wants this already has it, but you just opened it up for skids)[/QUOTE] You're right actually, fuck. Deleting now.
Sorry, you need to Log In to post a reply to this thread.