#include <iostream>
#include <Windows.h>
#include <iomanip>
//non hacking related stuff
struct KeyManager
{
bool Pressed;
bool Down;
bool Released;
bool Up;
bool ConsumePressed()
{
if(Pressed)
{
Pressed = false;
return true;
}
return false;
}
bool ConsumeReleased()
{
if(Released)
{
Released = false;
return true;
}
return false;
}
bool ConsumeDown()
{
if(Down)
{
Down = false;
return true;
}
return false;
}
bool ConsumeUp()
{
if(Up)
{
Up = false;
return true;
}
return false;
}
};
std::string string_format(const std::string fmt, ...)
{
int size = 512;
std::string str;
va_list ap;
while (1) {
str.resize(size);
va_start(ap, fmt);
int n = vsnprintf((char *)str.c_str(), size, fmt.c_str(), ap);
va_end(ap);
if (n > -1 && n < size) {
str.resize(n);
return str;
}
if (n > -1)
size = n + 1;
else
size *= 2;
}
return str;
}
KeyManager Keys[256];
void KeyManagerRun()
{
for(unsigned int i = 0; i < 256; ++i)
{
if(GetAsyncKeyState(i))
{
if(!Keys[i].Down)
{
Keys[i].Down = true;
Keys[i].Pressed = true;
Keys[i].Released = false;
Keys[i].Up = false;
}
else if(Keys[i].Pressed)
{
Keys[i].Pressed = false;
}
}
else
{
if(!Keys[i].Up)
{
Keys[i].Released = true;
Keys[i].Up = true;
Keys[i].Down = false;
Keys[i].Pressed = false;
}
else if(Keys[i].Released)
{
Keys[i].Released = false;
}
}
}
}
#define Keys(a) Keys[a]
void ClearScreen()
{
HANDLE hStdOut;
CONSOLE_SCREEN_BUFFER_INFO csbi;
DWORD count;
DWORD cellCount;
COORD homeCoords = { 0, 0 };
hStdOut = GetStdHandle( STD_OUTPUT_HANDLE );
if (hStdOut == INVALID_HANDLE_VALUE) return;
/* Get the number of cells in the current buffer */
if (!GetConsoleScreenBufferInfo( hStdOut, &csbi )) return;
cellCount = csbi.dwSize.X *csbi.dwSize.Y;
/* Fill the entire buffer with spaces */
if (!FillConsoleOutputCharacter(
hStdOut,
(TCHAR) ' ',
cellCount,
homeCoords,
&count
)) return;
/* Fill the entire buffer with the current colors and attributes */
if (!FillConsoleOutputAttribute(
hStdOut,
csbi.wAttributes,
cellCount,
homeCoords,
&count
)) return;
/* Move the cursor home */
SetConsoleCursorPosition( hStdOut, homeCoords );
}
//stuff to hack_me biatch!
int _gVar1 = 1;
int * _gVar2 = &_gVar1;
int * _gVar3 = NULL;
class HackMe
{
public:
HackMe()
{
Var1 = 1;
Var2 = 1;
}
int Var1;
void SetPrivate(int Integer)
{
Var2 = Integer;
}
int GetVar2()
{
return Var2;
}
private:
int Var2;
};
HackMe _gClass1;
HackMe *_gClass2;
//and there we go lol
int main()
{
int _lVar1 = 1;
_gVar3 = &_lVar1;
*_gVar3 = 1;
_gClass2 = new HackMe();
HackMe _lClass1;
HackMe * _lClass2 = new HackMe();
while(!Keys(VK_ESCAPE).Pressed)
{
KeyManagerRun();
ClearScreen();
std::cout << std::setw(16) << "GVAR1" << std::setw(16) << _gVar1 << std::endl;
std::cout << std::setw(16) << "GVAR2" << std::setw(16) << std::hex << _gVar2 << std::endl;
std::cout << std::setw(16) << "*GVAR2" << std::setw(16) << *_gVar2 << std::endl;
std::cout << std::setw(16) << "GVAR3" << std::setw(16) << std::hex << _gVar3 << std::endl;
std::cout << std::setw(16) << "*GVAR3" << std::setw(16) << *_gVar3 << std::endl;
std::cout << std::setw(16) << "LVAR1" << std::setw(16) << _lVar1 << std::endl;
std::cout << std::setw(16) << "_gClass1.Var1" << std::setw(16) << _gClass1.Var1 << std::endl;
std::cout << std::setw(16) << "_gClass1.Var2" << std::setw(16) << _gClass1.GetVar2() << std::endl;
std::cout << std::setw(16) << "_gClass2->Var1" << std::setw(16) << _gClass2->Var1 << std::endl;
std::cout << std::setw(16) << "_gClass2->Var2" << std::setw(16) << _gClass2->GetVar2() << std::endl;
std::cout << std::setw(16) << "_lClass1.Var1" << std::setw(16) << _lClass1.Var1 << std::endl;
std::cout << std::setw(16) << "_lClass1.Var2" << std::setw(16) << _lClass1.GetVar2() << std::endl;
std::cout << std::setw(16) << "_lClass2.Var1" << std::setw(16) << _lClass2->Var1 << std::endl;
std::cout << std::setw(16) << "_lClass2.Var2" << std::setw(16) << _lClass2->GetVar2() << std::endl;
if(Keys(VK_F1).Pressed)
++(_gVar1);
if(Keys(VK_F2).Pressed)
++(*_gVar2);
if(Keys(VK_F3).Pressed)
++(*_gVar3);
if(Keys(VK_F4).Pressed)
++(_lVar1);
if(Keys(VK_F5).Pressed)
++_gClass1.Var1;
if(Keys(VK_F6).Pressed)
_gClass1.SetPrivate(_gClass1.GetVar2()+1);
if(Keys(VK_F7).Pressed)
++(_gClass2->Var1);
if(Keys(VK_F8).Pressed)
_gClass2->SetPrivate(_gClass2->GetVar2()+1);
if(Keys(VK_F9).Pressed)
++_lClass1.Var1;
if(Keys(VK_F10).Pressed)
_lClass1.SetPrivate(_lClass1.GetVar2()+1);
if(Keys(VK_F11).Pressed)
++(_lClass2->Var1);
if(Keys(VK_F12).Pressed)
_lClass2->SetPrivate(_lClass2->GetVar2()+1);
Sleep(16);
}
return 0;
}