Welcome to the RaGEZONE - MMORPG development forums.

Anti Shotbot

This is a discussion on Anti Shotbot within the Gunz Releases forums, part of the Gunz Online category; Because I decided to not be an ass, I'll release the code against shotbots Code: HHOOK MouseHook; LRESULT CALLBACK MouseHookProc(int ...

Page 1 of 3 123 LastLast
Results 1 to 15 of 38
  1. #1
    Account Upgraded | Title Enabled!
    Rank
    Member +
    Join Date
    Jul 2007
    Location
    On the moon
    Posts
    870
    Liked
    283

    Anti Shotbot

    Because I decided to not be an ass, I'll release the code against shotbots

    Code:
    HHOOK MouseHook;
    
    LRESULT CALLBACK MouseHookProc(int nCode, WPARAM wParam, LPARAM lParam)
    {
    	if (nCode == HC_ACTION)
    	{
    		if(wParam == WM_RBUTTONDOWN || wParam == WM_LBUTTONDOWN)
    		{
    			MSLLHOOKSTRUCT *info=(MSLLHOOKSTRUCT*)lParam;     
    			if((info->flags & LLMHF_INJECTED) == LLMHF_INJECTED)
    			{
    				ExitProcess(-1);
    			}
    		}
    	}
    	return CallNextHookEx(MouseHook,nCode,wParam,lParam);
    }
    
    
    void AntiShotbotLogger()
    {
        HINSTANCE hInstance = GetModuleHandle(NULL);
    
        MouseHook = SetWindowsHookEx( WH_MOUSE_LL, MouseHookProc, hInstance, NULL );
        MSG message;
        while (GetMessage(&message,NULL,0,0)) {
            TranslateMessage( &message );
            DispatchMessage( &message );
        }
    
        UnhookWindowsHookEx(MouseHook);
        return;
    }
    Create a thread to antishotbot logger.
    Thanks wizkid for pointing out the function I had to use.
    Thanks google for information about WH_MOUSE_LL.

    For the source users:

    Create antishotbot.cpp:
    Code:
    #include "StdAfx.h"
    
    HHOOK MouseHook;
    
    LRESULT CALLBACK MouseHookProc(int nCode, WPARAM wParam, LPARAM lParam)
    {
    	if (nCode == HC_ACTION)
    	{
    		if(wParam == WM_RBUTTONDOWN || wParam == WM_LBUTTONDOWN)
    		{
    			MSLLHOOKSTRUCT *info=(MSLLHOOKSTRUCT*)lParam;     
    			if((info->flags & LLMHF_INJECTED) == LLMHF_INJECTED)
    			{
    				ExitProcess(-1);
    			}
    		}
    	}
    	return CallNextHookEx(MouseHook,nCode,wParam,lParam);
    }
    
    
    void AntiShotbotLogger()
    {
        HINSTANCE hInstance = GetModuleHandle(NULL);
    
        MouseHook = SetWindowsHookEx( WH_MOUSE_LL, MouseHookProc, hInstance, NULL );
        MSG message;
        while (GetMessage(&message,NULL,0,0)) {
            TranslateMessage( &message );
            DispatchMessage( &message );
        }
    
        UnhookWindowsHookEx(MouseHook);
        return;
    }
    Go to main.cpp in the gunz solution and add:
    Code:
    //Don't put this inside a function, Do it like somewhere at the top (Like line 96 or so)
            void AntiShotbotLogger();
    //Put this on line 197 under InitialLoading success
    	CreateThread(0, 0, (LPTHREAD_START_ROUTINE)AntiShotbotLogger, 0, 0, 0);

    For the DLL users:
    Code:
    #include <windows.h>
    
    HHOOK MouseHook;
    
    LRESULT CALLBACK MouseHookProc(int nCode, WPARAM wParam, LPARAM lParam)
    {
    	if (nCode == HC_ACTION)
    	{
    		if(wParam == WM_RBUTTONDOWN || wParam == WM_LBUTTONDOWN)
    		{
    			MSLLHOOKSTRUCT *info=(MSLLHOOKSTRUCT*)lParam;     
    			if((info->flags & LLMHF_INJECTED) == LLMHF_INJECTED)
    			{
    				ExitProcess(-1);
    			}
    		}
    	}
    	return CallNextHookEx(MouseHook,nCode,wParam,lParam);
    }
    
    
    void AntiShotbotLogger()
    {
        HINSTANCE hInstance = GetModuleHandle(NULL);
    
        MouseHook = SetWindowsHookEx( WH_MOUSE_LL, MouseHookProc, hInstance, NULL );
        MSG message;
        while (GetMessage(&message,NULL,0,0)) {
            TranslateMessage( &message );
            DispatchMessage( &message );
        }
    
        UnhookWindowsHookEx(MouseHook);
        return;
    }
    
    extern "C"
    {
    	__declspec(dllexport) BOOL __stdcall DllMain(HINSTANCE hInst,DWORD reason,LPVOID lpv)
    	{
    		if (reason == DLL_PROCESS_ATTACH)
    		{
    			CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)&AntiShotbotLogger,NULL,0,NULL);
    		}
    	return true;
    	}
    }
    Last edited by Gunblade; 15-07-12 at 03:24 PM.

  2. #2
    Kushi Yo Yo
    Rank
    Member +
    Join Date
    Feb 2011
    Posts
    545
    Liked
    285

    Re: Anti Shotbot

    lets give it a try :) see what what will happen XD

  3. #3
    Member
    Rank
    Member
    Join Date
    Sep 2011
    Posts
    93
    Liked
    4

    Re: Anti Shotbot

    Nice source!

  4. #4
    Gunz Online
    Rank
    Member +
    Join Date
    Jul 2009
    Location
    Georgia
    Posts
    557
    Liked
    304

    Re: Anti Shotbot

    Lines please, and files i need to put it...

  5. #5
    Account Upgraded | Title Enabled!
    Rank
    Member +
    Join Date
    Jul 2007
    Location
    On the moon
    Posts
    870
    Liked
    283

    Re: Anti Shotbot

    You can create a new file for it and put: CreateThread(0, 0, (LPTHREAD_START_ROUTINE)AntiShotbotLogger, 0, 0, 0); somewhere in main.cpp from the GunZ solution

  6. #6
    Gunz Online
    Rank
    Member +
    Join Date
    Jul 2009
    Location
    Georgia
    Posts
    557
    Liked
    304

    Re: Anti Shotbot

    Quote Originally Posted by Gunblade View Post
    You can create a new file for it and put: CreateThread(0, 0, (LPTHREAD_START_ROUTINE)AntiShotbotLogger, 0, 0, 0); somewhere in main.cpp from the GunZ solution
    You can't release the place i need to put it in the main.cpp?

  7. #7
    Account Upgraded | Title Enabled!
    Rank
    Member +
    Join Date
    Jul 2007
    Location
    On the moon
    Posts
    870
    Liked
    283

    Re: Anti Shotbot

    Try to add it under line 197 ( the initial loading succes line )

  8. #8
    Kushi Yo Yo
    Rank
    Member +
    Join Date
    Feb 2011
    Posts
    545
    Liked
    285

    Re: Anti Shotbot

    c:\Users\shalev\Desktop\Source\Source_Code\Stable\Gunz\main.cpp(220): error C2601: 'AntiShotbotLogger' : local function definitions are illegal
    c:\Users\shalev\Desktop\Source\Source_Code\Stable\Gunz\main.cpp(203): error C2601: 'MouseHookProc' : local function definitions are illegal
    shalev

    can you add the full lines so i can easly add it? o.o?

  9. #9
    Account Upgraded | Title Enabled!
    Rank
    Member +
    Join Date
    Jul 2007
    Location
    On the moon
    Posts
    870
    Liked
    283

    Re: Anti Shotbot

    Quote Originally Posted by bulli10 View Post
    c:\Users\shalev\Desktop\Source\Source_Code\Stable\Gunz\main.cpp(220): error C2601: 'AntiShotbotLogger' : local function definitions are illegal
    c:\Users\shalev\Desktop\Source\Source_Code\Stable\Gunz\main.cpp(203): error C2601: 'MouseHookProc' : local function definitions are illegal
    shalev

    can you add the full lines so i can easly add it? o.o?
    Like I said, Put the code I posted above in a new file called antishotbot.cpp and ONLY put the viod AntiShotbotLogger() and CreateThread in main.cpp

    Edit: Updated the main post to make it more user friendly.

  10. #10
    Gunz Online
    Rank
    Member +
    Join Date
    Jul 2009
    Location
    Georgia
    Posts
    557
    Liked
    304

    Re: Anti Shotbot

    It's working awesome i checked it... wow man...
    I got crash when i am run the aimfix and aim on someone.
    LOVE YOU!!!

  11. #11
    Kushi Yo Yo
    Rank
    Member +
    Join Date
    Feb 2011
    Posts
    545
    Liked
    285

    Re: Anti Shotbot

    Work Good Job Gunblade :)

  12. #12
    Umpa Lumpa
    Rank
    Member +
    Join Date
    Jan 2010
    Location
    Italy
    Posts
    326
    Liked
    17

    Re: Anti Shotbot

    LOL works good! Like button i'm coming.

  13. #13
    Addicted to Bacon
    Rank
    Member +
    Join Date
    Sep 2007
    Posts
    1,098
    Liked
    488

    Re: Anti Shotbot

    I'll give the bypass when I get home from work.

  14. #14
    Account Upgraded | Title Enabled!
    Rank
    Member +
    Join Date
    Jul 2007
    Location
    On the moon
    Posts
    870
    Liked
    283

    Re: Anti Shotbot

    Quote Originally Posted by ThePhailure772 View Post
    I'll give the bypass when I get home from work.
    Bypass? How o.O

  15. #15
    Gunz Online
    Rank
    Member +
    Join Date
    Jul 2009
    Location
    Georgia
    Posts
    557
    Liked
    304

    Re: Anti Shotbot

    Quote Originally Posted by ThePhailure772 View Post
    I'll give the bypass when I get home from work.
    Damn...

 

 
Page 1 of 3 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •