Source Code Assault Cube Internal Trainer

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

FloppyWhale

Jr.Coder
Full Member
Nobleman
Jan 12, 2015
65
308
0
Hi guys! Out of boredom, I've decided to make a new trainer for Assault Cube since my other ones were quite bland. I would've put stuff such as teleporting & no recoil but I haz no clues on how to find them :eek:, anyhow, I hope you guys enjoy!

Main.cpp
C++:
/*
Credits goto:
Rake for the wglSwapBuffer hook & weapon class. <3
Nazalas for the output to console function. <3
*/

#include "AyyLmao.h"

using namespace std;

DWORD WINAPI doThis(LPVOID lpArgs)
{
	cout << "Welcome to FloppyWhale's Assault Cube Trainer!" << endl;
	cout << "##############################################" << endl;
	cout << "Hacks are activated automatically!" << endl;
	cout << "Press [F1] to spam console. (Look Top-Left)" << endl;
	cout << "##############################################" << endl;
	cout << "NOTE : Credits are commented in source!" << endl;

	for (;; Sleep(100))
	{
		pLocal->health = 999;
		pLocal->armour = 999;
		*pLocal->weapon->ammo = 999;
		*pLocal->weapon->ammo2 = 999;

		if (GetAsyncKeyState(VK_F1))
		{
			((void(__cdecl*)(const char* string))0x46B060)("\f1Hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue.");
			((void(__cdecl*)(const char* string))0x46B060)("\f2Hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue.");
			((void(__cdecl*)(const char* string))0x46B060)("\f3Hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue.");
			((void(__cdecl*)(const char* string))0x46B060)("\f4Hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue hue.");
		}
	}
}

BOOL WINAPI DllMain(HMODULE hModule, DWORD reason, LPVOID lpReserved)
{
	switch (reason)
	{
	case DLL_PROCESS_ATTACH:
		AllocConsole();
		AttachConsole(GetProcessId(GetCurrentProcess));
		freopen("CONIN$", "r", stdin);
		freopen("CONOUT$", "w", stdout);
		freopen("CONOUT$", "w", stderr);
		hookSwapBuffers();
		CreateThread(0, 0, &doThis, 0, 0, 0);
	}
	return TRUE;
}
AyyLmao.h
C++:
#pragma once

#include <Windows.h>
#include <iostream>
#pragma comment(lib, "lib\\detours.lib")
#include "include\detours.h"

class myPlayer;
class weapon;

class myPlayer
{
public:
	char pad_0x0000[0xF8]; //0x0000
	__int32 health; //0x00F8 
	__int32 armour; //0x00FC 
	char pad_0x0100[0x274]; //0x0100
	weapon* weapon; //0x0374 
	char pad_0x0378[0xC8]; //0x0378
};

class weapon
{
public:
	char pad_0x0000[0x4]; //0x0000
	__int32 ID; //0x0004
	myPlayer * owner; //0x0008
	DWORD * guninfo; //0x000C
	int * ammo2; //0x0010
	int * ammo; //0x0014
	int * gunWait;
	int shots;
	int breload;
};

myPlayer * pLocal = (myPlayer*)*(DWORD*)0x50F4F4;





typedef BOOL(__stdcall * twglSwapBuffers) (_In_ HDC hDc);
twglSwapBuffers owglSwapBuffers;

BOOL __stdcall hwglSwapBuffers(_In_ HDC hDc)
{
	((void(__thiscall*)(const char* string))0x408E80)("\f3You? :D"); //If you're wondering why this isn't at the bottom, if it's at the bottom, it'd appear at the top.
	((void(__thiscall*)(const char* string))0x408E80)("\f1How");
	((void(__thiscall*)(const char* string))0x408E80)("\f2Are");
	
	return owglSwapBuffers(hDc);
}

void hookSwapBuffers()
{
	HMODULE hMod = GetModuleHandle(L"opengl32.dll");
	if (hMod)
	{
		owglSwapBuffers = (twglSwapBuffers)(DWORD)GetProcAddress(hMod, "wglSwapBuffers");
		DetourTransactionBegin();
		DetourUpdateThread(GetCurrentThread());
		DetourAttach(&(PVOID&)owglSwapBuffers, hwglSwapBuffers);
		DetourTransactionCommit();
	}
}
I also appreciate any ideas/suggestions. I'm always looking to improve my work!
 
Last edited:

Nazalas

Coder
Dank Tier VIP
Dank Tier Donator
May 20, 2015
99
3,963
3
If you are going to use the in game console so much, I would either write a function that just takes the string and does the output or typedef it so that you can just contoutf((char*)"Hello"); This wont really effect performance or anything but it would make the code a little cleaner.
 

Rake

Cesspool Admin
Administrator
Jan 21, 2014
12,140
78,998
2,394
Thanks for sharing! But definately call it by address using a typedef
 

FloppyWhale

Jr.Coder
Full Member
Nobleman
Jan 12, 2015
65
308
0
If you are going to use the in game console so much, I would either write a function that just takes the string and does the output or typedef it so that you can just contoutf((char*)"Hello"); This wont really effect performance or anything but it would make the code a little cleaner.
I think the console looks fancy. :eek: I will keep this in mind though!

Rake;41549 said:
Thanks for sharing! But definately call it by address using a typedef
I haz no idea what you mean by calling it by address using a typedef. Sorry, but thanks!
 

Nazalas

Coder
Dank Tier VIP
Dank Tier Donator
May 20, 2015
99
3,963
3
I haz no idea what you mean by calling it by address using a typedef. Sorry, but thanks!
If you typedef if like this
C++:
typedef void(__cdecl * _contoutf)(const char* string, ...);
_contoutf contoutf = (_contoutf)0x408E80;
Then you can simply call conoutf anytime you want to output something
C++:
contoutf((char*)"\f2Are");
 
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