Solved Error w/ Infinite Ammo in AssaultCube

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

Lidle

Newbie
Full Member
Dec 6, 2015
10
83
0
This is the hack tutorial that I followed on GuidedHacking's YouTube page. It is almost identical code, with some minor changes and additions of mine. For some reason I am having such an issue with getting unlimited ammo from this. I have the offsets and the base address. When I run my program, the No Recoil and Unlimited Health work just fine but when I activate Unlimited Ammo for some reason it crashes the game giving me this pop-up window error.



These are my addresses and offsets of various memory locations in AssaultCube
C++:
//AMMO VARS
bool AmmoStatus;
BYTE AmmoValue[] = { 0x39, 0X5, 0X0, 0X0 };
DWORD AmmoBaseAddress = { 0x0050F4F4 };
DWORD AmmoOffsets[] = {0x384, 0x14, 0x0};

//NO RECOIL
bool RecoilStatus;
BYTE RecoilValue[] = { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90};
DWORD RecoilBaseAddress = { 0x463786 };
//DWORD RecoilOffsets[] = {};

//HEALTH VARS
bool HealthStatus;
BYTE HealthValue[] = { 0x39, 0X5, 0X0, 0X0 };
DWORD HealthBaseAddress = { 0x0050F4F4 };
DWORD HealthOffsets[] = { 0xF8 };
These are two functions that I use for reading and writing to memory
C++:
DWORD FindDmaAddy(int PointerLevel, HANDLE hProcHandle, DWORD Offsets[], DWORD BaseAddress)
{
	DWORD pointer = BaseAddress;
	DWORD pTemp;

	DWORD pointerAddr;
	for (int c = 0; c < PointerLevel; c++)
	{
		if (c == 0)
		{
			ReadProcessMemory(hProcHandle, (LPCVOID)pointer, &pTemp, sizeof(pTemp), NULL);
		}
		pointerAddr = pTemp + Offsets[c];
		ReadProcessMemory(hProcHandle, (LPCVOID)pointer, &pTemp, sizeof(pTemp), NULL);
	}

	return pointerAddr;	
}

void WriteToMemory(HANDLE hProcHandle)
{
	DWORD AddressToWrite;

	if (AmmoStatus)
	{
		AddressToWrite = FindDmaAddy(3, hProcHandle, AmmoOffsets, AmmoBaseAddress);
		WriteProcessMemory(hProcHandle, (BYTE*)AddressToWrite, &AmmoValue, sizeof(AmmoValue), NULL);
	}

	if (RecoilStatus)
	{
		WriteProcessMemory(hProcHandle, (LPVOID)(0x463786), &RecoilValue, sizeof(RecoilValue), NULL);
	}

	if (HealthStatus)
	{
		AddressToWrite = FindDmaAddy(1, hProcHandle, HealthOffsets, HealthBaseAddress);
		WriteProcessMemory(hProcHandle, (BYTE*)AddressToWrite, &HealthValue, sizeof(HealthValue), NULL);
	}
}
 
Last edited:

mambda

headass
Escobar Tier VIP
Trump Tier Donator
Jun 25, 2014
2,294
37,938
269
C0000005 == Access violation, writing to parts of memory that you don't have read/write permissions to ( or null memory. )

Your find DMA Addy ( fyi DMA means something else so thats kinda weird to use, ik its a fleep thing but the more you know and all that ) isn't working properly.

C++:
pointerAddr = pTemp + Offsets[c];
        ReadProcessMemory(hProcHandle, (LPCVOID)pointer, &pTemp, sizeof(pTemp), NULL);
You add the offset to pTemp and store that value in pointerAddr, not changing the value in pTemp. AKA there is no change in what you're reading. So all you're actually doing is reading the exact same place in memory.

Replace the second rpm pointer value with pointerAddr.

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,745
40,528
316
Hmm, looks correct (I didn't check the offsets/addresses). The only thing I can think of is that this line:
C++:
WriteProcessMemory(hProcHandle, (BYTE*)AddressToWrite, &AmmoValue, sizeof(AmmoValue), NULL);
should be this:
C++:
WriteProcessMemory(hProcHandle, (BYTE*)AddressToWrite, AmmoValue, sizeof(AmmoValue), NULL);
Not sure if that explains the crash though.


And better use C++ tags.
 

Lidle

Newbie
Full Member
Dec 6, 2015
10
83
0
C0000005 == Access violation, writing to parts of memory that you don't have read/write permissions to ( or null memory. )

Your find DMA Addy ( fyi DMA means something else so thats kinda weird to use, ik its a fleep thing but the more you know and all that ) isn't working properly.

C++:
pointerAddr = pTemp + Offsets[c];
		ReadProcessMemory(hProcHandle, (LPCVOID)pointer, &pTemp, sizeof(pTemp), NULL);
You add the offset to pTemp and store that value in pointerAddr, not changing the value in pTemp. AKA there is no change in what you're reading. So all you're actually doing is reading the exact same place in memory.

Replace the second rpm pointer value with pointerAddr.
Aha! Thank you so much!!

Also, is that DMAAddy a must need in hacks that have more than one offset? New to hacking so I'm full of a lot of questions unfortunately
 

Lidle

Newbie
Full Member
Dec 6, 2015
10
83
0
Вroihon;38840 said:
Hmm, looks correct (I didn't check the offsets/addresses). The only thing I can think of is that this line:
C++:
WriteProcessMemory(hProcHandle, (BYTE*)AddressToWrite, &AmmoValue, sizeof(AmmoValue), NULL);
should be this:
C++:
WriteProcessMemory(hProcHandle, (BYTE*)AddressToWrite, AmmoValue, sizeof(AmmoValue), NULL);
Not sure if that explains the crash though.


And better use C++ tags.
Also, what do you mean by C++ tags?
 

mambda

headass
Escobar Tier VIP
Trump Tier Donator
Jun 25, 2014
2,294
37,938
269
[CPP ( close this bracket) and [/CPP (also close this bracket)

Yeah, you'll need to add offsets in games. So yeah, the function is probably helpful, i've always preferred to do it manually or make classes.
 

TBA

Newbie
Full Member
Oct 1, 2012
23
307
1
Did you get it figured out bc i had the same problem you had but i later just redid the whole thing and i Realize I typed something incorrect yet i wasnt gettin an error for it
 

Lidle

Newbie
Full Member
Dec 6, 2015
10
83
0
Did you get it figured out bc i had the same problem you had but i later just redid the whole thing and i Realize I typed something incorrect yet i wasnt gettin an error for it
Yes I did figure it out
 
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