1. Post #1
    Gold Member

    April 2011
    132 Posts
    Hello, I am new to making Binary Modules.
    I have followed this tutorial: http://www.facepunch.com/threads/949978/

    When I went to compiling it failed and that tutorial has all of its pictures missing. Would anyone here mind creating a new tutorial or possibly adding me on steam and helping me set up for creating modules, maybe even help me create a simple first one? Anyway I hope to hear from someone, my steam is on my profile.
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Dumb Dumb x 6Disagree Disagree x 1 (list)

  2. Post #2
    Reply With Quote Edit / Delete Reply Windows 7 Germany Show Events Winner Winner x 1 (list)

  3. Post #3
    Gold Member

    April 2011
    132 Posts
    Is there any way to paste my lua code into a dll?
    I do not know a lot about C++

    Say I want to put this code into a dll
    Code:
    -- Player SteamID and UniqueID Fetcher:
    function PrintSteamInfo()
        for _, v in ipairs( player.GetAll() ) do
            print( v:Nick().."'s SteamID is: "..v:SteamID().. " and UniqueID is: "..v:UniqueID() )
        end
    end
    concommand.Add("hawk_print_info", PrintSteamInfo)
    How would I do that and still be able to use that console command?
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Dumb Dumb x 4 (list)

  4. Post #4
    JustSoFaded's Avatar
    December 2011
    432 Posts
    int EntryPoint( lua_State *L )
    {
    	ILuaInterface* sLua = Lua();
    
    	const char* code = "concommand.Add('hawt_print_info', function() for _, v in ipairs( player.GetAll() ) do print(v:Nick()..'s SteamID is '..v:SteamID()..' and UniqueID is: '..v:UniqueID()); end end)";
    
    	sLua->Msg("Loading lua...\n");
    		sLua->RunString("", "", code, true, true);
    	sLua->Msg("Executed lua!\n");
    }
    
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Funny Funny x 2 (list)

  5. Post #5
    Gold Member

    April 2011
    132 Posts
    int EntryPoint( lua_State *L )
    {
    	ILuaInterface* sLua = Lua();
    
    	const char* code = "concommand.Add('hawt_print_info', function() for _, v in ipairs( player.GetAll() ) do print(v:Nick()..'s SteamID is '..v:SteamID()..' and UniqueID is: '..v:UniqueID()); end end)";
    
    	sLua->Msg("Loading lua...\n");
    		sLua->RunString("", "", code, true, true);
    	sLua->Msg("Executed lua!\n");
    }
    
    So where do I put that in this?
    Code:
    // Skip rarely used Windows API functions
    #define WIN32_LEAN_AND_MEAN
     
    // Headers
    #include <GMLuaModule.h>
     
    // Module definition
    GMOD_MODULE( Init, Shutdown );
     
    // Globals
    ILuaInterface* g_Lua;
     
    // Initialization
    int Init( lua_State *L )
    {
    	g_Lua = Lua();
     
    	return 0;
    }
     
     
    // Shutdown
    int Shutdown( lua_State *L )
    {
    	return 0;
    }
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Dumb Dumb x 1 (list)

  6. Post #6
    Pimpin' Member
    Stebbzor's Avatar
    September 2008
    629 Posts
    So where do I put that in this?
    Code:
    // Skip rarely used Windows API functions
    #define WIN32_LEAN_AND_MEAN
     
    // Headers
    #include <GMLuaModule.h>
     
    // Module definition
    GMOD_MODULE( Init, Shutdown );
     
    // Globals
    ILuaInterface* g_Lua;
     
    // Initialization
    int Init( lua_State *L )
    {
        g_Lua = Lua();
    
        return 0;
    }
     
     
    // Shutdown
    int Shutdown( lua_State *L )
    {
        return 0;
    }
    Code:
    // Skip rarely used Windows API functions
    #define WIN32_LEAN_AND_MEAN
     
    // Headers
    #include <GMLuaModule.h>
     
    // Module definition
    GMOD_MODULE( Init, Shutdown );
     
    // Globals
    ILuaInterface* g_Lua;
     
    // Initialization
    int Init( lua_State *L )
    {
        g_Lua = Lua();
        const char* code = "concommand.Add('hawt_print_info', function() for _, v in ipairs( player.GetAll() ) do print(v:Nick()..'s SteamID is '..v:SteamID()..' and UniqueID is: '..v:UniqueID()); end end)";
     
        g_Lua->Msg("Loading lua...\n");
            g_Lua->RunString("", "", code, true, true);
        g_Lua->Msg("Executed lua!\n");
        return 0;
    }
     
     
    // Shutdown
    int Shutdown( lua_State *L )
    {
        return 0;
    }

  7. Post #7
    Gold Member

    April 2011
    132 Posts
    So do I just put the dll file then in the addons folder or where do I place it?

  8. Post #8
    JustSoFaded's Avatar
    December 2011
    432 Posts
    includes/modules/

  9. Post #9
    Gold Member

    April 2011
    132 Posts
    includes/modules/
    I placed the dll there and the command did not work when I typed it into console.
    Does it auto run from that folder or do I need a lua script saying to run that dll?

  10. Post #10
    JustSoFaded's Avatar
    December 2011
    432 Posts
    you need to create a lua file in autorun/client. In that file call the require() function. This will load your module.

  11. Post #11
    Gold Member

    April 2011
    132 Posts
    so this should be it

    tutorial.lua
    Code:
    require("gm_tutorial")
    or

    Code:
    require("gm_tutorial.dll")
    or
    Code:
    require("tutorial")
    or
    Code:
    require("tutorial.dll")

  12. Post #12
    Ruzza's Avatar
    December 2011
    1,137 Posts
    3rd one
    Reply With Quote Edit / Delete Reply Australia Show Events Agree Agree x 2 (list)

  13. Post #13
    Gold Member

    April 2011
    132 Posts
    3rd one
    even if my dll is name gm_tutorial.dll
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Agree Agree x 1 (list)

  14. Post #14
    Ruzza's Avatar
    December 2011
    1,137 Posts
    even if my dll is name gm_tutorial.dll
    Ignore gmcl_, gmsv_, gm_, .dll.

    You just need to require the name of the file.

    So, gm_tutorial.dll would be require( "tutorial" )

  15. Post #15
    Gold Member

    April 2011
    132 Posts
    I tried adding more functions but I only know how to put in one, how can I put all this into the dll?

    Code:
    print("HawkMans Custom Scripts now running!")
    print("Scripts Include:")
    print("IP Logger - Saves to garrysmod\garrysmod\data\logsPlayerLog.txt")
    print("Admin Teller")
    print("Player SteamID and Unique ID Fetcher")
    
    function PrintSteamInfo()
        for _, v in ipairs( player.GetAll() ) do
            print( v:Nick().."'s SteamID is: "..v:SteamID().. " and UniqueID is: "..v:UniqueID() )
        end
    end
    concommand.Add("hawk_print_info", PrintSteamInfo)
    
    function PlayerLog(name, ip)
    	if !file.Exists("logs/PlayerLog.txt") then
    		file.Write("logs/PlayerLog.txt", "[Connecting Player] : " .. name .. ", with the IP '" .. ip .. "'.\n")
    	else
    		filex.Append("logs/PlayerLog.txt", "[Connecting Player] : " .. name .. ", with the IP '" .. ip .. "'.\n")
    	end
    	chat.AddText("[Connecting Player] : " .. name .. ", with the IP '" .. ip .. "'.")
    	print("[Connecting Player] : " .. name .. ", with the IP '" .. ip .. "'.")
    end
    hook.Add("PlayerConnect", "ConsoleLog", PlayerLog)

  16. Post #16
    JustSoFaded's Avatar
    December 2011
    432 Posts
    We aren't helping yuou make a cheat. If you are too dumb to RunString lua, then bro you need to take a step back.
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Agree Agree x 2 (list)

  17. Post #17
    Gold Member

    April 2011
    132 Posts
    We aren't helping yuou make a cheat. If you are too dumb to RunString lua, then bro you need to take a step back.
    I just got stuck when it come to using ' instead of ".
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Funny Funny x 4 (list)

  18. Post #18
    JustSoFaded's Avatar
    December 2011
    432 Posts
    So then basically you have less programming knowledge then we originally thought.
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Zing Zing x 5Funny Funny x 2 (list)

  19. Post #19
    Gold Member

    April 2011
    132 Posts
    So then basically you have less programming knowledge then we originally thought.
    1st week of lua, 2nd day of C++

    I've been programming in VB for 4 years but that's a different language.
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Funny Funny x 4Informative Informative x 1 (list)

  20. Post #20
    Gold Member
    psycix's Avatar
    November 2010
    198 Posts
    How long have you been cheating?

    And what do you need a player's IP address for?
    Reply With Quote Edit / Delete Reply Windows 7 Netherlands Show Events Zing Zing x 2 (list)

  21. Post #21
    Gold Banana
    Banana Lord.'s Avatar
    May 2010
    6,120 Posts
    And what do you need a player's IP address for?
    "so i can cumpar the playr who say dey admin n c if dey r"

    basically to DDoS them
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Agree Agree x 2 (list)

  22. Post #22
    Bawbag's Avatar
    December 2011
    530 Posts
    Saying you have 4 years experience in VB is like saying you have 4 years experience of cumming in a dumpster.
    Reply With Quote Edit / Delete Reply Windows 7 United Kingdom Show Events Zing Zing x 3Funny Funny x 1Dumb Dumb x 1 (list)

  23. Post #23
    shadowndacorner's Avatar
    May 2011
    192 Posts
    Saying you have 4 years experience in VB is like saying you have 4 years experience of cumming in a dumpster.
    We all do things we regret...
    Reply With Quote Edit / Delete Reply Mac United States Show Events Funny Funny x 2 (list)

  24. Post #24
    Pycские Идиот
    LauScript's Avatar
    June 2010
    2,439 Posts
    How about instead of trying to run lua in cpp you just make a Lua script? What are you even doing? lol...

    You're not some "pro hack creator", don't try to make a hack it makes you look foolish.

  25. Post #25
    Gold Member

    April 2011
    132 Posts
    How about instead of trying to run lua in cpp you just make a Lua script? What are you even doing? lol...

    You're not some "pro hack creator", don't try to make a hack it makes you look foolish.
    I think I have tried explaining in about 7 threads I am not trying to make a hack. I just wanted to make a dll because I already know how to make a lua script, a dll would be the next thing to put lua code. Putting it in a dll would also make it harder for people to get your lua code from. And I wanted to test making a HID & Login system that would drop the dll at runtime into the modules folder and add a lua file in autorun to start it up so people licensed could use it. Not to make a hack but just out of boredom and for proof of concept.
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Dumb Dumb x 4 (list)

  26. Post #26
    Gold Member
    dingusnin's Avatar
    February 2010
    1,666 Posts
    Why dont you just host your code somwhere and get the dll to download and run it, Instead of recompilling a dll everytime you make a change?

  27. Post #27

    December 2011
    350 Posts
    Because this guy is an idiot he thinks he will be able to just copy and paste the code he has found into Visual studios and it will compile all has has done is learn a few buzz words to trick people into making it look like he knows what he is doing
    Reply With Quote Edit / Delete Reply United Kingdom Show Events Funny Funny x 1 (list)

  28. Post #28
    Gold Member

    April 2011
    132 Posts
    Because this guy is an idiot he thinks he will be able to just copy and paste the code he has found into Visual studios and it will compile all has has done is learn a few buzz words to trick people into making it look like he knows what he is doing
    Lmfao, lol w/e


    Why dont you just host your code somwhere and get the dll to download and run it, Instead of recompilling a dll everytime you make a change?
    I actually did not know you can do this, would you mind telling me how to make the C++ grab the code and then drop it as a resource to the lua/autorun/client folder? Only problem is that a lot of programs can monitor network activity to see where it is downloading from, but I can start with that first maybe to prove to Dame that I actually can code it :P

    Only thing is I know pretty much nothing about C++ and DLL coding.

    Also the thing is if I did this I could also do it without a dll and just make a vb program to drop it there, but it would be nice if you still told me how to do this because it is nice to have options.
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Dumb Dumb x 3 (list)

  29. Post #29
    JustSoFaded's Avatar
    December 2011
    432 Posts
    Why dont you just host your code somwhere and get the dll to download and run it, Instead of recompilling a dll everytime you make a change?
    yeah, because these guy obviously will know how to use sockets to grab text.

    Man, just take a step back. You are in your second week of lua, learn how to code lua before you try c++. It's obvious c++ is a little out of your range right now.

    Edited:

    I actually did not know you can do this, would you mind telling me how to make the C++ grab the code and then drop it as a resource to the lua/autorun/client folder
    This is the dumbest thing I have ever seen, just download it and RunString it, why would you even bother putting it in the client folder to make the game run it? And no, noone here will teach you how to use c++ to download it and runstring it, you would never be able to compile it.

    Only problem is that a lot of programs can monitor network activity to see where it is downloading from, but I can start with that first maybe to prove to Dame that I actually can code it :P
    Who cares about people packet sniffing your program? They will just open your DLL in a hex editor and search the strings for the ip/domain you are connecting to to grab the information. And I wouldn't get your hopes up, you would not be able to code this even with help my man.

    Only thing is I know pretty much nothing about C++ and DLL coding.
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Zing Zing x 2Winner Winner x 1 (list)

  30. Post #30
    Gold Member

    April 2011
    132 Posts
    yeah, because these guy obviously will know how to use sockets to grab text.
    This is the dumbest thing I have ever seen, just download it and RunString it, why would you even bother putting it in the client folder to make the game run it? And no, noone here will teach you how to use c++ to download it and runstring it, you would never be able to compile it.
    If this is the dumbest thing you have ever seen then that's quite upsetting, you must have really high standards.
    Anyway I dont know what you mean by "runstring" it but I was going to make it drop a lua file with the code in it into the client folder on GMod startup before the lua folder is read.

    Who cares about people packet sniffing your program? They will just open your DLL in a hex editor and search the strings for the ip/domain you are connecting to to grab the information. And I wouldn't get your hopes up, you would not be able to code this even with help my man.
    They can search for strings all they fucking want, that's where encryption and obfuscation comes in. Of course there is no way to make something uncrackable but there is a way to make it more difficult.
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Dumb Dumb x 2 (list)

  31. Post #31
    Buttes
    Jcw87's Avatar
    May 2005
    450 Posts
    They can search for strings all they fucking want, that's where encryption and obfuscation comes in. Of course there is no way to make something uncrackable but there is a way to make it more difficult.
    I can beat your encryption by detouring RunString and dumping out your decrypted code (it's really easy too). Attemping to hide Lua code by sticking it in a dll is a pointless effort.

    In addition, I see no reason to help you, as you obviously want to harvest player IPs, and the only reason I can think of for that is that you want to DDoS people.
    Reply With Quote Edit / Delete Reply Windows XP United States Show Events Agree Agree x 3 (list)

  32. Post #32
    JustSoFaded's Avatar
    December 2011
    432 Posts
    They can search for strings all they fucking want, that's where encryption and obfuscation comes in. Of course there is no way to make something uncrackable but there is a way to make it more difficult.
    What are you going to obfuscate that will stop them from just finding a string? Encrypting the strings is your only effort, which is where what Jcw said came into play.

    Edited:

    I can beat your encryption by detouring RunString and dumping out your decrypted code (it's really easy too). Attemping to hide Lua code by sticking it in a dll is a pointless effort.
    I wouldn't quite say it's a pointless effort, with a good authorization system, and an understanding of how luas internals work you could pre-compile your code and execute your precompiled code in the gamestate without really having to worry about someone dumping your lua.

    Even if they did dump your lua, with it precompiled it's not like anyone can really do anything with it, besides cracking your module and making it load the pre-compiled lua from their own server.

  33. Post #33
    Gold Member
    dingusnin's Avatar
    February 2010
    1,666 Posts
    You don't need sockets to download code, just use http.get() and run the content?
    Reply With Quote Edit / Delete Reply France Show Events Funny Funny x 3 (list)

  34. Post #34
    JustSoFaded's Avatar
    December 2011
    432 Posts
    You don't need sockets to download code, just use http.get() and run the content?
    That's so bad.
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Dumb Dumb x 5 (list)

  35. Post #35
    Gold Member

    April 2011
    132 Posts
    Notice how I said because then my friends can't find it. I never said you couldnt decrypt anything but a lot of my friends can't.
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Dumb Dumb x 4 (list)

  36. Post #36
    My Blog
    Spencer Sharkey's Avatar
    July 2009
    1,934 Posts
    You don't need sockets to download code, just use http.get() and run the content?
    AKA openAura's "state of the art DRM"

  37. Post #37
    Bawbag's Avatar
    December 2011
    530 Posts
    Notice how I said because then my friends can't find it. I never said you couldnt decrypt anything but a lot of my friends can't.
    You don't need to decrypt shit. You're just compiling a string into dll; your friends could find it by opening the dll in a text editor...
    Reply With Quote Edit / Delete Reply Windows 7 United Kingdom Show Events Agree Agree x 2Disagree Disagree x 1 (list)

  38. Post #38
    Gold Member

    April 2011
    132 Posts
    You don't need to decrypt shit. You're just compiling a string into dll; your friends could find it by opening the dll in a text editor...
    You would need to decrypt the string if I was making the dll download code from a certain online txt file while I would have the url encrypted a few times in a few different encrypt ions. So what the fuck are you talking about? Do you read base64, rc4, blowfish, and other custom encryption methods fluently like English? Maybe you should understand what is being talked about in this whole thread, don't read one post and make yourself look like a dipshit.
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Dumb Dumb x 4 (list)

  39. Post #39
    JustSoFaded's Avatar
    December 2011
    432 Posts
    Why do I have trouble believing you wrote your own encryption method, or you could even compile & use one if you did for that matter.
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Agree Agree x 4Dumb Dumb x 1 (list)

  40. Post #40
    Gold Banana
    Banana Lord.'s Avatar
    May 2010
    6,120 Posts
    You were going to put the script into the DLL, strings aren't encoded in a DLL. base64 is as simple as going to a free base64 decoder, and anyway they could just capture the packets and grab your hack.

    and who are you to judge people on what they know about programming? You've spent an entire thread trying to have us make your SethHack replacement.
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Funny Funny x 2Disagree Disagree x 1 (list)