A couple of code snippets.

Page 1 of 2 12 LastLast
Results 1 to 15 of 28
  1. #1
    Alpha Member Justei is offline
    MemberRank
    Oct 2007 Join Date
    /f241Location
    1,904Posts

    A couple of code snippets.

    So, lately I have found myself wondering why people don't attempt making new, better hackshields. In general the hackshields out there suck pretty badly.

    So, I'm going to make things easier for a couple of you now and release a couple of snippets that can help you out.

    PLEASE READ ALL THE TEXT BEFORE ASKING QUESTIONS

    I am taking the snippets from the source code of my latest KalOnline project (namely Elmo, a hackshield that's private for KalmaX 2006
    (link: KalmaX - 2006 Stuck In Time )).

    So, this code is compiled and works fine in Visual C++ 6.0.
    I used a proxy dll to run it and well, if you don't know how to do that then I recommend staying away from modding the client anyway lol.

    First snippet, most requested so far. How to change icon of kal window after injection:
    Code:
    hwndWindow = FindWindow(NULL, "KalOnline");
                SetWindowText(hwndWindow, "KalOnline - KalmaX 2006 [Protected by Elmo] - Coded by: Justei. Extra credits: MaX");
                
                if(ServerSelected == 0 && IconLoop < 500){
                    
                    HANDLE hIcon = LoadImage(NULL, "data/sesame/icon.ico", IMAGE_ICON, 32, 32, LR_LOADFROMFILE);
                    if(hIcon){
                    SendMessage(hwndWindow, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
                    }else{
                    // Insert a logging function or whatever here...
                    }
    
    
                    HANDLE hIconSm = LoadImage(NULL, "data/sesame/icon.ico", IMAGE_ICON, 16, 16, LR_LOADFROMFILE);
                    if(hIconSm){
                    SendMessage(hwndWindow, WM_SETICON, ICON_SMALL, (LPARAM)hIconSm);
                    }else{
                    // Insert a logging function or whatever here...
                    }
                    IconLoop++;
                }
    How to check for autobattle
    (not sure this works 100%, but the function is good to have in general to fetch info from .ini files).

    Code:
            char curdir[4096];
            char inifile[4096];
    
            GetCurrentDirectory(4000, curdir);
            sprintf(inifile, "%s\\system.ini", curdir);
            // check for autobattle, sigh...
            char autobattle[256];
            GetPrivateProfileString("CLIENTVERSION", "AUTO_BATTLE", "null", autobattle, 4000, inifile);
            if(strcmp(autobattle, "2") == 0){
                // KickPlayer.
            }
    Check if a file exists, so u can check if ppl put .dll files in the same folder:
    Code:
    bool FileExist(string FileName) {
      struct stat stFileInfo;
      bool blnReturn;
      int intStat;
    
      intStat = stat(FileName.c_str(),&stFileInfo);
      if(intStat == 0) {
        blnReturn = true;
      } else {
    
        blnReturn = false;
      }
      
      return(blnReturn);
    }


    Check what windows are open:

    Code:
    char WinText[200] = {NULL};
     
        if(!hwnd || !IsWindowVisible(hwnd))
            return 1;
     
        GetWindowTextA(hwnd,WinText,sizeof(WinText));
    
      // Example of how to use.
       if(strcmp(WinText, "Let's Engine 3.0 by Be_Sk8 - www.LetsPlayCheats.navega.uni.cc") == 0){
            // KickPlayer(); just kick player...
        }
    HOW TO MAKE YOUR PROXY DLL's TUTORIAL
    http://www.codeproject.com/KB/DLL/Cr...ProxyDLLs.aspx


    More functions I have in stock are(All work in realtime etc.):

    • Check what dll files are loaded into the client
    • Check what processes are running
    • Check what windows are open
    • Check if client is being hooked by another dll (Detoured packets.)
    • Check for speedhack.
    • MemCpyEx ofc.
    • Recv/Send packets without disturbing Kocp/Kosp.
    • GM bot check (Lets a gm check a player if he's a BOT etc).
    • Make sure player can't remove d4 doors etc.
    • Also a d3d hook.
    • And a lot more that I don't remember atm...

    I will however keep these parts to myself for now, just want to see people develop something and not just leech first, then I can help out if someone can't figure some part of a function out for themselves.
    This should get you started at least.

    Good Luck!
    Last edited by Justei; 21-03-11 at 11:34 AM.


  2. #2
    Please STAHP! ASN is offline
    MemberRank
    Dec 2010 Join Date
    934Posts

    Re: A couple of code snippets.

    WoW, impressive

    Quote Originally Posted by Justei View Post
    So, lately I have found myself wondering why people don't attempt making new, better hackshields. In general the hackshields out there suck pretty badly.
    Answer is simply ;p

    WHO?

    and about autobattle isnt it easier to delete it from engine?;p (but yea script is useful)
    Last edited by ASN; 14-03-11 at 12:48 PM.

  3. #3
    Account Upgraded | Title Enabled! Arturasult is offline
    MemberRank
    Feb 2007 Join Date
    AustraliaLocation
    375Posts

    Re: A couple of code snippets.

    looks great but couldnt people simple just replace your dll with there own?
    wouldnt you require some server side modifications also?
    Last edited by Arturasult; 14-03-11 at 01:31 PM.

  4. #4
    Please STAHP! ASN is offline
    MemberRank
    Dec 2010 Join Date
    934Posts

    Re: A couple of code snippets.

    Quote Originally Posted by Arturasult View Post
    looks great but couldnt people simple just replace your dll with there own?
    Good point :P Justei is he right?xd

  5. #5
    Alpha Member Justei is offline
    MemberRank
    Oct 2007 Join Date
    /f241Location
    1,904Posts

    Re: A couple of code snippets.

    Quote Originally Posted by Arturasult View Post
    looks great but couldnt people simple just replace your dll with there own?
    wouldnt you require some server side modifications also?
    Quote Originally Posted by takethis View Post
    Good point :P Justei is he right?xd
    Yes, and for that you need to hook the server to send a heartbeat. Which is why I didn't release the whole source (it contains a packet recv/send function). I want people to do something for themselves as well. These functions are just one step on the way to get people to start doing SOMETHING for themselves.

    However you CAN make the dll stick pretty well anyway. One example is using byte replacement or memory editing to make the client:
    change pk password when engine runs, so if u run client without your own dll it will load with wrong pk and configs wont load. OR set config to connect to wrong port, and then your DLL corrects that.
    Or crypt configs and make your dll decrypt, so if u load without your dll it wont work etc.

    And a lot of other ways.

    Combine that with a simple heartbeat from server client, and u wont be able to remove the hackshield without a big hassle.
    Last edited by Justei; 14-03-11 at 03:02 PM.

  6. #6
    boo General is offline
    MemberRank
    Sep 2006 Join Date
    at homeLocation
    2,269Posts

    Re: A couple of code snippets.

    I'm interested in creating client sided dll's, but I'm not familiar with programming... A setup and some base source files for the dll would help a lot, since I'm a total newb in that. I've got quite a lot experience with ASM and Delphi, just not with visual studio and C++

  7. #7
    Alpha Member Justei is offline
    MemberRank
    Oct 2007 Join Date
    /f241Location
    1,904Posts

    Re: A couple of code snippets.

    Quote Originally Posted by BjornVH View Post
    I'm interested in creating client sided dll's, but I'm not familiar with programming... A setup and some base source files for the dll would help a lot, since I'm a total newb in that. I've got quite a lot experience with ASM and Delphi, just not with visual studio and C++
    Okay, well I'll post a guide on how to make proxy dll's later today/tomorrow along with source. It's not hard at all to be honest. Although I recommend learning some C++ basics.

    ASM will help you LOADS in this so kudos on that.

  8. #8
    Alpha Member Zen is offline
    MemberRank
    Dec 2006 Join Date
    MelbourneLocation
    2,291Posts

    Re: A couple of code snippets.

    as much as I will probably be flamed for this, theres some good proxy DLL tutorials/sources at epvp if you have a look.

  9. #9
    Account Upgraded | Title Enabled! Arturasult is offline
    MemberRank
    Feb 2007 Join Date
    AustraliaLocation
    375Posts

    Re: A couple of code snippets.

    i've only dabbled a bit in C++, dont know much about it, only c#.

    i had a look at injecting in C# and found some nice tutorials on it (using some c++ to load the C#)

    maybe i will have a crack at this some time.

  10. #10
    Alpha Member Justei is offline
    MemberRank
    Oct 2007 Join Date
    /f241Location
    1,904Posts

    Re: A couple of code snippets.

    Quote Originally Posted by Zen View Post
    as much as I will probably be flamed for this, theres some good proxy DLL tutorials/sources at epvp if you have a look.
    Yeah, Indeed, but the best one there is actually just a copy off another tutorial from another site, so I'll just post that one in a sec.

    Quote Originally Posted by Arturasult View Post
    i've only dabbled a bit in C++, dont know much about it, only c#.

    i had a look at injecting in C# and found some nice tutorials on it (using some c++ to load the C#)

    maybe i will have a crack at this some time.
    I recommend it, its fun :)

  11. #11
    Alpha Member Zen is offline
    MemberRank
    Dec 2006 Join Date
    MelbourneLocation
    2,291Posts

    Re: A couple of code snippets.

    Will give it a try when I get home from university tonight.

    Will be using this tutorial to learn C++ (have been coding C# and PHP for years, never tried C++ at all, the syntax seems familiar but I think that starting from basics is the go for me)

    YouTube - antiRTFM's Channel

  12. #12
    Alpha Member Zen is offline
    MemberRank
    Dec 2006 Join Date
    MelbourneLocation
    2,291Posts

    Re: A couple of code snippets.

    Also Justei (this is half because its relevant and half so this thread doesn't get hidden under the 5 million 6month+ old threads some dickhead bumped)

    YouTube - The Simpsons - Elmo Knows Were You Live (720p HD)

  13. #13
    Alpha Member Justei is offline
    MemberRank
    Oct 2007 Join Date
    /f241Location
    1,904Posts

    Re: A couple of code snippets.

    lol, elmo<3 im gonna release more info when i get home tonight. Considering making a sticky with a collection of all code snippets, packet lists, etc. As well as containing guides on how to work with it.

  14. #14
    Alpha Member Zen is offline
    MemberRank
    Dec 2006 Join Date
    MelbourneLocation
    2,291Posts

    Re: A couple of code snippets.

    I know this is a really silly question, but where are the functions and variables you're referring to there actually coming from? (eg ServerSelected)

    I only started playing with C++ the other day, so far I'm loving it, so clean :D

  15. #15
    Alpha Member Justei is offline
    MemberRank
    Oct 2007 Join Date
    /f241Location
    1,904Posts

    Re: A couple of code snippets.

    Quote Originally Posted by Zen View Post
    I know this is a really silly question, but where are the functions and variables you're referring to there actually coming from? (eg ServerSelected)

    I only started playing with C++ the other day, so far I'm loving it, so clean :D
    Umm, yeah that 1 is actually a variable I set when the server is selected ( I check what packets come in and thats it, if you want I can add u on MSN and share some more source with ya, don't wanna release too much without people doing something themselves :) )

    And yeah, C++ is a lot of fun.



Page 1 of 2 12 LastLast

Advertisement