Solved Can Any Buddy Help Me With This Code ?????

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

programmer

Jr.Coder
Full Member
Nobleman
Jul 15, 2012
46
422
2
void WriteToMemory(DWORD addressToWrite, char* valueToWrite, int byteNum)
{
//used to change our file access type, stores the old
//access type and restores it after memory is written
unsigned long OldProtection;
//give that address read and write permissions and store the old permissions at oldProtection
VirtualProtect((LPVOID)(addressToWrite), byteNum, PAGE_EXECUTE_READWRITE, &OldProtection);

//write the memory into the program and overwrite previous value
memcpy( (LPVOID)addressToWrite, valueToWrite, byteNum);

//reset the permissions of the address back to oldProtection after writting memory
VirtualProtect((LPVOID)(addressToWrite), byteNum, OldProtection, NULL);
}


DWORD FindDmaAddy(int PointerLevel, DWORD Offsets[], DWORD BaseAddress)
{
//DEFINES OUR ADDRESS to write to
//if statements are crucial to make sure that the address is valid to write
//otherwise we crash. Address will not be valid when things like map changes or game loads are happening
DWORD Ptr = *(DWORD*)(BaseAddress); //Base Address
if(Ptr == 0) return NULL;//prevent crash

//this is done to allow us to have pointers up to many levels e.g.10
for(int i = 0; i < PointerLevel; i ++)
{
//if it = PointerLevel-1 then it reached the last element of the array
//therefore check if that address plus the offset is valid and leave the loop
if(i == PointerLevel-1)
{
//!!make sure the last address doesnt have the asterisk on DWORD otherwise incoming crash
Ptr = (DWORD)(Ptr+Offsets); //Add the final offset to the pointer
if(Ptr == 0) return NULL;//prevent crash
//we here return early because when it hits the last element
//we want to leave the loop, specially adapted for offsets of 1
return Ptr;
}
else
{
//if its just a normal offset then add it to the address
Ptr = *(DWORD*)(Ptr+Offsets); //Add the offsets
if(Ptr == 0) return NULL;//prevent crash
}
}
return Ptr;
}

char *StringToCharArr(std::string strToConvert)
{
char *charRet = new char[strToConvert.length()+1];
std::strcpy(charRet, strToConvert.c_str());
return charRet;
}


void Hacks::ApplyAmmo()
{
std::string Nops[] =
{
"\x90",
"\x90\x90",
"\x90\x90\x90",
"\x90\x90\x90\x90"
};


bool AmmoStatus;
char AmmoOpCode[] = "\x90\x90\x90\x90\x90\x90\x90";
char AmmoDefaultOpCode[] = "\x89\x84\x8F\x34\x03\x00\x00";
DWORD AmmoAddress = 0x5BF5D9;

if(hack[AMMO].on)
{
WriteToMemory(AmmoAddress, AmmoOpCode, 4);
}
else WriteToMemory(AmmoAddress, AmmoDefaultOpCode, 4);
}
 

programmer

Jr.Coder
Full Member
Nobleman
Jul 15, 2012
46
422
2
its unlimited ammo code for cod4 when i compile it it tells me 1 succeeded 0 filed but when i turn on the unlimited ammo hack the ammo still limited
*its directx hack
 
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 League of Legends Accounts