Solved need help on an assualt cube trainer hack

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

blizz&hacks

Newbie
Oct 3, 2016
3
284
0
hi well i was making a assualt cube hack with a tutorial by :fleep: to make a trainer in the series "how to hack any game" or something along those lines, when i finished it these 2 errors came up when running the the console: "error C2679: binary '<<' : no operator found which takes a right-hand operand of type 'std::string' (or there is no acceptable conversion)" & "c:\program files (x86)\microsoft visual studio 10.0\vc\include\ostream(679): could be 'std::basic_ostream<_Elem,_Traits> &std::eek:perator <<<char,std::char_traits<char>>(std::basic_ostream<_Elem,_Traits> &,const char *)' [found using argument-dependent lookup] ".

this is my code for it:

#include <iostream>
#include <Windows.h>
#include <ctime>



void WriteToMemory(HANDLE hProcHandle);
DWORD FindDmaAddy(int PointerLevel, HANDLE hProcHandle, DWORD Offsets[], DWORD BaseAddress);

std::string GameName = "AssaultCube";
LPCSTR LGameWindow = "AssaultCube";
std::string GameStatus;

bool IsGameAvail;
bool UpdateOnNextRun;

//ammo var
bool AmmoStatus;
BYTE AmmoValue[] = {0xA3,0x1C,0x0,0x0};
DWORD AmmoBaseAddress = {0x004DF73C};
DWORD AmmoOffsets[] = {0x378, 0x14, 0x0};


//health var
bool HealthStatus;
BYTE HealthValue[] ={0x39,0x5,0x0,0x0};
DWORD HealthBaseAddress = {0x004DF73C};
DWORD HealthOffsets[] = {0xF4};

int main()
{

HWND hGameWindow = NULL;
int timeSinceLastUpdate = clock();
int GameAvailTMR = clock();
int OnePressTMR;
DWORD dwProcId = NULL;
HANDLE hProcHandle = NULL;
UpdateOnNextRun = true;
std::string sAmmoStatus;
std::string sHealthStatus;
sAmmoStatus = "OFF";
sHealthStatus = "OFF";
OnePressTMR = clock();
while(!GetAsyncKeyState(VK_INSERT))
{
if(clock() - GameAvailTMR > 100)
{
GameAvailTMR = clock();

IsGameAvail = false;

hGameWindow = FindWindow( NULL, LGameWindow);
if(hGameWindow)
{
GetWindowThreadProcessId( hGameWindow, &dwProcId );

if( dwProcId != 0 )
{

hProcHandle = OpenProcess( PROCESS_ALL_ACCESS, FALSE, dwProcId );
if( hProcHandle == INVALID_HANDLE_VALUE || hProcHandle == NULL )
{
GameStatus = "Failed to open process for valid handle";
}
else
{
GameStatus = "AssaultCube Ready to hack";
IsGameAvail = true;
}
}
else GameStatus = "Failed to obtain process id";
}
else GameStatus = "AssaultCube NOT FOUND";


if(UpdateOnNextRun || clock() - timeSinceLastUpdate > 5000)
{
system("cls");
std::cout << "----------------------------------------------------" << std::endl;
std::cout << " AssaultCube memory hacker" << std::endl;
std::cout << "----------------------------------------------------" << std::endl << std::endl;
std::cout << "GAME STATUS:"<< GameStatus <<" " << std::endl << std::endl;
std::cout << "[F1] Unlimited ammo -> "<< sAmmoStatus <<" <-" << std::endl<< std::endl;
std::cout << "[F2] Unlimited Health and armor ->" << sHealthStatus << "<-" << std::endl<< std::endl;
std::cout << "[INSERT] Exit" << std::endl;
UpdateOnNextRun = false;
timeSinceLastUpdate = clock();
}

if(IsGameAvail)
{
WriteToMemory(hProcHandle);
}
}

if(clock() - OnePressTMR > 400)
{
if(IsGameAvail)
{

if(GetAsyncKeyState(VK_F1))
{
OnePressTMR = clock();

AmmoStatus = !AmmoStatus;
UpdateOnNextRun = true;

if(AmmoStatus)sAmmoStatus = "ON";
else sAmmoStatus = "OFF";
}
else if(GetAsyncKeyState(VK_F2))
{
OnePressTMR = clock();
HealthStatus = !HealthStatus;
UpdateOnNextRun = true;

if(HealthStatus)sHealthStatus = "ON";
else sHealthStatus = "OFF";
}
}
}
}

CloseHandle( hProcHandle );
CloseHandle(hGameWindow);


return ERROR_SUCCESS;
}

DWORD FindDmaAddy(int PointerLevel, HANDLE hProcHandle, DWORD Offsets[], DWORD BaseAddress)
{

DWORD pointer = BaseAddress;

DWORD pTemp;

DWORD pointerAddr;
for(int i = 0; i < PointerLevel; i ++)
{
if(i == 0)
{
ReadProcessMemory(hProcHandle, (LPCVOID)pointer, &pTemp, 4, NULL);
}

pointerAddr = pTemp + Offsets;


ReadProcessMemory(hProcHandle, (LPCVOID)pointerAddr, &pTemp, 4, NULL);
}
return pointerAddr;
}

void WriteToMemory(HANDLE hProcHandle)
{
if(AmmoStatus)
{
DWORD AmmoAddressToWrite = FindDmaAddy(3, hProcHandle, AmmoOffsets, AmmoBaseAddress);
WriteProcessMemory( hProcHandle, (BYTE*)AmmoAddressToWrite, &AmmoValue, sizeof(AmmoValue), NULL);
}

if(HealthStatus)
{

DWORD HealthAddressToWrite = FindDmaAddy(1, hProcHandle, HealthOffsets, HealthBaseAddress);
WriteProcessMemory( hProcHandle, (BYTE*)HealthAddressToWrite, &HealthValue, sizeof(HealthValue), NULL);
}
}

plz help me cuz im stuck.
 

Broihon

edgy 12 y/o
Escobar Tier VIP
Fleep Tier Donator
Dec 22, 2013
1,746
40,528
316
First of all, compile in release mode. Always.
And what are you trying to do? Compile it or run it in the debugger instance?
Either way this error (mostly) occurs when the file (in this case Trainer.exe) is already running.

Do this guide it's god mode
How to Hack Any Game pt 2 Rake
 
Last edited by a moderator:

Broihon

edgy 12 y/o
Escobar Tier VIP
Fleep Tier Donator
Dec 22, 2013
1,746
40,528
316
Wild guess: Set project settings to multibyte.
Another tip: Wrap cpp tags around your code then it looks dank like this:
C++:
int main()
{
      return 1337;
}
And you might have to include <string>
 

blizz&hacks

Newbie
Oct 3, 2016
3
284
0
omfg not another error cannot open file 'C:\Users\*name*\Documents\Visual Studio 2010\hackingprograms\Trainer\Debug\Trainer.exe' access is denied
 
Last edited:
Attention! Before you post:

Read the How to Ask Questions Guide
99% of questions are answered in the Beginner's Guide, do it before asking a question.

No Hack Requests. Post in the correct section.  Search the forum first. Read the rules.

How to make a good post:

  • Fill out the form correctly
  • Tell us the game name & coding language
  • Post everything we need to know to help you
  • Ask specific questions, be descriptive
  • Post errors, line numbers & screenshots
  • Post code snippets using code tags
  • If it's a large project, zip it up and attach it

If you do not comply, your post may be deleted.  We want to help, please make a good post and we will do our best to help you.

Community Mods