Jump to content
Welcome, Guest
Existing user? Sign In

Sign In



Sign Up
The MatriX
  • Welcome To Ghbsys
  • CS GO Streaming Version is released. Have fun streaming while cheating!
  • Have a Payment Issue? Send us a Support ticket.
  • Make a thread if you need support or join our discord for live support.
  • Have Suggestions? Make a thread and you'll earn Ghbsys Points for implemented suggestions.
  • Join our discord to stay well connected! Don't forget to integrate your discord to the site
  • Welcome to [GHB] - GAmEhAcKbAsTaRdS Forum

    Welcome to [GHB] - GAmEhAcKbAsTaRdS Forum, like most online communities you must register to view or post in our community, but don't worry this is a simple free process that requires minimal information for you to signup. Be apart of [GHB] - GAmEhAcKbAsTaRdS Forum by signing in or creating an account.
    • Start new topics and reply to others
    • Subscribe to topics and forums to get email updates
    • Get your own profile page and make new friends
    • Send personal messages to other members.

    C++ Error


    imaowna
     Share

    Recommended Posts

    #include "stdafx.h"
    #include <windows.h> //This is for CreateThread and Sleep
    #pragma warning(disable: 4312) //Disable annoying warnings
    
    
    void HackLoop(); //Prototype of our thread
    
    BOOL __stdcall DllMain(void *, unsigned long reason, void *)
    {
    switch(reason)
    {
    	case DLL_PROCESS_ATTACH: //Our DLL was attached to WarRock
    		//We'll create a thread hence the process does not stuck
    		CreateThread(0, 0, (LPTHREAD_START_ROUTINE)HackLoop, 0, 0, 0);
    		break;
    }
    
    return TRUE;
    }
    
    
    template <class T>
    class CHack
    {
    public:
    void SetAddress(DWORD addy) 
    {
    	address = addy;
    	if(!IsBadReadPtr((void*)address, 4))
    	{
    		VirtualProtect((void*)address, sizeof(T), 0x40, &oldProtect);
    		memcpy(&backup, (void*)addy, sizeof(T));
    		VirtualProtect((void*)address, sizeof(T), oldProtect, 0);
    	}
    }
    void SetData(T Data)
    {
    	if(!IsBadReadPtr((void*)address, 4))
    	{
    		VirtualProtect((void*)address, sizeof(T), 0x40, &oldProtect);
    		memcpy((void*)address, &Data, sizeof(T));
    		VirtualProtect((void*)address, sizeof(T), oldProtect, 0);
    	}
    }
    void Restore()
    {
    	if(!IsBadReadPtr((void*)address, 4))
    	{
    		VirtualProtect((void*)address, sizeof(T), 0x40, &oldProtect);
    		memcpy((void*)address, &backup, sizeof(T));
    		VirtualProtect((void*)address, sizeof(T), oldProtect, 0);
    	}
    }
    private:
    T data;
    T backup;
    DWORD address;
    DWORD oldProtect;
    }; 
    
    class CHackPtr
    {
    public:
    void SetAddress(DWORD addy) 
    {
    	paddress = (DWORD*)addy;
    }
    void SetByte(DWORD offset, char value)
    {
    	if(*paddress)
    	{
    		RelativeAddress = *paddress + offset;
    		memcpy((void*)RelativeAddress, &value, sizeof(char));
    	}
    }
    void SetShort(DWORD offset, short value)
    {
    	if(*paddress)
    	{
    		RelativeAddress = *paddress + offset;
    		memcpy((void*)RelativeAddress, &value, sizeof(short));
    	}
    }
    void SetInt(DWORD offset, int value)
    {
    	if(*paddress)
    	{
    		RelativeAddress = *paddress + offset;
    		memcpy((void*)RelativeAddress, &value, sizeof(int));
    	}
    }
    void SetFloat(DWORD offset, float value)
    {
    	if(*paddress)
    	{
    		RelativeAddress = *paddress + offset;
    		memcpy((void*)RelativeAddress, &value, sizeof(float));
    	}
    }
    
    char GetByte(DWORD offset)
    {
    	char buf;
    	if(*paddress)
    	{
    		RelativeAddress = *paddress + offset;
    		memcpy(&buf, (void*)RelativeAddress, sizeof(char));
    		return buf;
    	}
    	return 0;
    }
    short GetShort(DWORD offset)
    {
    	short buf;
    	if(*paddress)
    	{
    		RelativeAddress = *paddress + offset;
    		memcpy(&buf, (void*)RelativeAddress, sizeof(short));
    		return buf;
    	}
    	return 0;
    }
    int GetInt(DWORD offset)
    {
    	int buf;
    	if(*paddress)
    	{
    		RelativeAddress = *paddress + offset;
    		memcpy(&buf, (void*)RelativeAddress, sizeof(int));
    		return buf;
    	}
    	return 0;
    }
    float GetFloat(DWORD offset)
    {
    	float buf;
    	if(*paddress)
    	{
    		RelativeAddress = *paddress + offset;
    		memcpy(&buf, (void*)RelativeAddress, sizeof(float));
    		return buf;
    	}
    	return 0;
    }
    
    private:
    DWORD* paddress;
    DWORD RelativeAddress;
    };
    
    CHack <BYTE>NoWater;
    CHack <int>NoBounds1;
    CHack <int>NoBounds2;
    CHack <float>Speedhack;
    CHack <float>NoSpread;
    CHackPtr PlayerPointer;
    CHackPtr ServerPointer;
    
    void HackLoop()
    {
    static bool bInit = false;
    if(!bInit)
    {
    	//Set all our addresses there - this gets executed ONCE
    	NoWater.SetAddress(0x009A385C);   
    	NoBounds1.SetAddress(0x00AA7AD8); 
    	NoBounds2.SetAddress(0x00AA7ADC); 
    	Speedhack.SetAddress(0x0093B718); 
    	NoSpread.SetAddress(0x00A823E0); 
    	ServerPointer.SetAddress(0x00B3E608);
    	PlayerPointer.SetAddress(0x00C3F168);
    
    	bInit = true;
    }
    
    while(true)
    {
    	NoWater.SetData(0);
    	NoBounds1.SetData(0);
    	NoBounds2.SetData(0);
    	NoSpread.SetData(0);
    	Speedhack.SetData(500.0f);
    
    	ServerPointer.SetByte(0x380, 3); //Premium
    
    	PlayerPointer.SetFloat(0x000,   100); //Stamina
    	PlayerPointer.SetFloat(0x264, -2000); //NFD
    
    	PlayerPointer.SetFloat(0x1C, 0); //Norecoil 1
    	PlayerPointer.SetFloat(0x20, 0); //Norecoil 2
    	PlayerPointer.SetFloat(0x24, 0); //Norecoil 3
    
    	if(GetAsyncKeyState(VK_SPACE))
    	{
    		//float CurrentHeight = PlayerPointer.GetFloat(0x128);
    		//CurrentHeight += 400; //We want to go higher
    		PlayerPointer.SetFloat(0x128, 1500);
    	}
    
    	Sleep(20);
    }
    }

     

     

     

     

    anytime i try to build this i get 2 errors

     

    dllmain.obj : error LNK2005: _DllMain@12 already defined in CPP.obj

     

    Documents\Visual Studio 2008\Projects\CPP\Debug\CPP.dll : fatal error LNK1169: one or more multiply defined symbols found

     

    Plz help me

    Link to comment
    Share on other sites

    Guest
    This topic is now closed to further replies.
     Share

    • Recently Browsing   0 members

      • No registered users viewing this page.
    ×
    ×
    • Create New...