Solved Assault Cube Internal Hack - Why the code is not working

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

Elitiok

Silenced
Jul 13, 2020
79
713
0
Game Name
Assault Cube
Anticheat
N/A
How long you been coding/hacking?
I Started Programming when I was 13 or 14 Now I am 16 Learning Reverse Engineering and GameHacking
Coding Language
C++
Hello Folks, I am currently doing an Internal Hack for Assault Cube My Plans Are

- Unlimited Values (health, ammo, grenades) (done)
- No Recoil (done)
- Trigger bot (done)
- Fly Hack (did not do it yet)

So I decided first test my the stuff I did

I am using reclass generated classes

The Hack :
#include <iostream>
#include <Windows.h>
#include "valH.h"
#include "mem.h"

typedef ent* (__cdecl* getCrossHairEnt)();

getCrossHairEnt GetCrossHairEnt = nullptr;

using namespace mem;

DWORD WINAPI HackThread(HMODULE hModule)
{
    // Allocate Console
    AllocConsole();
    FILE* f{};
    freopen("CONOUTS$", "w", stdout);

    // Get a Module Handle

    std::cout << "Press [F1] - For Unlimited Ammo" << std::endl;
    std::cout << "Press [F2] - For Unlimited Health" << std::endl;
    std::cout << "Press [F3] - For Unlimited Grenades" << std::endl;
    std::cout << "Press [F4] - For TriggerBot" << std::endl;
    std::cout << "Press [F5] - For No Recoil" << std::endl;

    val.modBase = (uintptr_t)GetModuleHandle("ac_client.exe");

    ent* localPlayerPtr{ nullptr };

    localPlayerPtr = *(ent**)(val.modBase + 0x10F4F4);

    // Hack Loop

    while (!GetAsyncKeyState(VK_F10))
    {
        if (GetAsyncKeyState(VK_F1))
        {
            val.ammo = !val.ammo;

            if (val.ammo)
            {
                localPlayerPtr->currentWeapon->ammoClip->ammo = 9999;
            }
        }

        if (GetAsyncKeyState(VK_F2))
        {
            val.health = !val.health;

            if (val.health)
            {
                localPlayerPtr->health = 9999;
            }
        }

        if (GetAsyncKeyState(VK_F3))
        {
            val.grenades = !val.grenades;

            if (val.grenades)
            {
                localPlayerPtr->grenades = 9999;
            }
        }

        if (GetAsyncKeyState(VK_F4))
        {
            val.trigger = !val.trigger;

            if (val.trigger)
            {
                ent* crossHairEnt = GetCrossHairEnt();

                if (crossHairEnt)
                {
                    if (localPlayerPtr->team != crossHairEnt->team)
                    {
                        localPlayerPtr->bAttack = 1;
                    }

                    else {
                        localPlayerPtr->bAttack = 0;
                    }
                }
            }
        }

        if (GetAsyncKeyState(VK_F5))
        {
            val.recoil = !val.recoil;

            if (val.recoil)
            {
                mem::Nop((BYTE*)(val.modBase + 0x63786), 10);
            }
            else {
                mem::Patch((BYTE*)(val.modBase + 0x63786), (BYTE*)"\x50\x8D\x4C\x24\x1C\x51\x8B\xCE\xFF\xD2", 10);
            }
        }
    }

    fclose(f);
    FreeConsole();
    FreeLibraryAndExitThread(hModule, 0);
    return 0;  
}

BOOL APIENTRY DllMain( HMODULE hModule,
                       DWORD  ul_reason_for_call,
                       LPVOID lpReserved
                     )
{
    switch (ul_reason_for_call)
    {
    case DLL_PROCESS_ATTACH:
        CloseHandle(CreateThread(nullptr, 0, (LPTHREAD_START_ROUTINE)HackThread, hModule, 0, nullptr));
    case DLL_PROCESS_DETACH:
        break;
    }
    return TRUE;
}
It is also showing this error

Capture.PNG
 

Rake

Cesspool Admin
Administrator
Jan 21, 2014
12,101
78,998
2,374
The assertion you are getting is from trying to close an invalid file handle as you never initialize it.

Which you can see here:
C++:
FILE* f{};
freopen("CONOUTS$", "w", stdout);
that's probably it

from the tutorial:

C++:
//Setup

AllocConsole();
FILE* f;
freopen_s(&f, "CONOUT$", "w", stdout);

//clean up
fclose(f);
FreeConsole();
FreeLibraryAndExitThread(hModule, 0);
You should also check if it's null too

C++:
if (f)
{
    fclose(f);
}
 

Ahegao

Possibly a weeb
Dank Tier Donator
Full Member
Nobleman
Jul 9, 2020
108
3,353
1
Not to be a jerk but you compiled for debug and are given the reasons why it dont work alongside with the line and file which is having issues.

isatty.cpp line 17

 
  • Like
Reactions: Elitiok

Rake

Cesspool Admin
Administrator
Jan 21, 2014
12,101
78,998
2,374
Place breakpoints on the first line of all constructors, on the first line of DllMain and the first line of your hackthread. Then follow the instructions in the video @Ahegao posted to debug your internal hack.

It should give you a more specific error on a specific line. report that information to us

If it does not, you need to post your entire source code including the reclass generated classes. Best way to do this is to use SolZipper SolZipper - Easily Zip Visual Studio Projects for Uploading and upload the zip
 
  • Like
Reactions: Elitiok and Ahegao

Elitiok

Silenced
Jul 13, 2020
79
713
0
Not to be a jerk but you compiled for debug and are given the reasons why it dont work alongside with the line and file which is having issues.

isatty.cpp line 17

that's probably it

from the tutorial:

C++:
//Setup

AllocConsole();
FILE* f;
freopen_s(&f, "CONOUT$", "w", stdout);

//clean up
fclose(f);
FreeConsole();
FreeLibraryAndExitThread(hModule, 0);
You should also check if it's null too

C++:
if (f)
{
    fclose(f);
}
It Worked <3 It Turned out that I wrote it CONSOUTS$ instead of CONOUT$ All little charachter made me fell stupid xD xD But When I Hit F4 to enable triggerbot it shuts down why??
 

Petko123

Biggest paster
Dank Tier VIP
Trump Tier Donator
Feb 19, 2018
104
8,768
5
Does it crash in between the games/when your at the menu or it crashes inside the game with bots?
You should always check if the pointer to localPlayer is not null

trigger:
 if (GetAsyncKeyState(VK_F4))
        {
            val.trigger = !val.trigger;

            if (val.trigger)
            {
                ent* crossHairEnt = GetCrossHairEnt();

                if (crossHairEnt && localPlayerPtr)
                {
                    if (localPlayerPtr->team != crossHairEnt->team)
                    {
                        localPlayerPtr->bAttack = 1;
                    }

                    else {
                        localPlayerPtr->bAttack = 0;
                    }
                }
            }
        }
 
  • Like
Reactions: Rake and Elitiok

Elitiok

Silenced
Jul 13, 2020
79
713
0
Does it crash in between the games/when your at the menu or it crashes inside the game with bots?
You should always check if the pointer to localPlayer is not null

trigger:
 if (GetAsyncKeyState(VK_F4))
        {
            val.trigger = !val.trigger;

            if (val.trigger)
            {
                ent* crossHairEnt = GetCrossHairEnt();

                if (crossHairEnt && localPlayerPtr)
                {
                    if (localPlayerPtr->team != crossHairEnt->team)
                    {
                        localPlayerPtr->bAttack = 1;
                    }

                    else {
                        localPlayerPtr->bAttack = 0;
                    }
                }
            }
        }
No It crashes when i play with bots I hit all the keys and they works once i hit f4 it crashes I am now watching how to debug you hack video
 

Elitiok

Silenced
Jul 13, 2020
79
713
0
Place breakpoints on the first line of all constructors, on the first line of DllMain and the first line of your hackthread. Then follow the instructions in the video @Ahegao posted to debug your internal hack.

It should give you a more specific error on a specific line. report that information to us

If it does not, you need to post your entire source code including the reclass generated classes. Best way to do this is to use SolZipper SolZipper - Easily Zip Visual Studio Projects for Uploading and upload the zip
when I Attached to process and tryied to debug I placed some breakpoints on lines that maybe the problem in them it should me that
Capture.PNG
 

Rake

Cesspool Admin
Administrator
Jan 21, 2014
12,101
78,998
2,374
#1 The How to Debug tutorial comes before the triggerbot tutorial for a reason. Do the GHB correctly.


when I Attached to process and tryied to debug I placed some breakpoints on lines that maybe the problem in them it should me that View attachment 10569
#2
1595175425410.png


You are not using default injector settings, causing your problem. Reset to deafult settings.

If you reset the injector and it still doesn't inject correctly, then remove breakpoints from inside DllMain which may cause loader lock. You also can't inject twice, that can also cause a similar problem.
 

Elitiok

Silenced
Jul 13, 2020
79
713
0
#1 The How to Debug tutorial comes before the triggerbot tutorial for a reason. Do the GHB correctly.




#2
View attachment 10573

You are not using default injector settings, causing your problem. Reset to deafult settings.

If you reset the injector and it still doesn't inject correctly, then remove breakpoints from inside DllMain which may cause loader lock. You also can't inject twice, that can also cause a similar problem.
I Watched the video and I Used the default Injector Setting but also nothing happened :( I Know I Bored u For a simple issue but I am serious about game hacking I want to know why every bit is happening
 

Elitiok

Silenced
Jul 13, 2020
79
713
0
What does this mean? We can't help you based on "nothing happened"
I mean that I did all the things u gave me and watched the video and applied it but also it still not working also It became more wired when I hit f1 at the first time it worked second it also crashes idk what is the problem
 

Rake

Cesspool Admin
Administrator
Jan 21, 2014
12,101
78,998
2,374
This is the exact reason we have a paywall, you children are incapable of using your brains correctly
 

Elitiok

Silenced
Jul 13, 2020
79
713
0
This is the exact reason we have a paywall, you children are incapable of using your brains correctly
I hope I be better wish me :) I have just doing this for about 4 weeks I finished the first and second guide in a short time because before that I had experience with malware analysis and reverse engineering and basic win sys programming
 

Elitiok

Silenced
Jul 13, 2020
79
713
0
the entire working project is already available for download right here: Video Tutorial - Assault Cube TriggerBot Tutorial - Reversing, ReClass & More

why do you need my help? Just compare yours against mine and you can find the issue in 3 seconds

View attachment 10581
oh oh
the entire working project is already available for download right here: Video Tutorial - Assault Cube TriggerBot Tutorial - Reversing, ReClass & More

why do you need my help? Just compare yours against mine and you can find the issue in 3 seconds

View attachment 10581
Thanks for Telling me what is the mistake sorry for wasting your time I hope I learn from my mistakes :)
 

Rake

Cesspool Admin
Administrator
Jan 21, 2014
12,101
78,998
2,374
you are missing this code:
GetCrossHairEnt = (getCrossHairEnt)(val.modBase + 0x607c0);
 
  • Like
Reactions: Elitiok
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