Hello guys,
I am tired of noobs who ask me how to make hacks... So i write this tutorial ("explanation")...
So first to make a hack you need basic c/c++ knowledge... If you read this i think you know what are you doing.
Many of you leech and make a hack but after its patch you cant fix it bcs you don't even know what are you doing so, i will explain how is crossfire weapon struct made and will explain what we need to do so we can hack it ![Big Grin](images/emotions/emo2.png)
basically... all we need to know there is one array of classes and each index of the array points to a part of the class...
so in c/c++ code it looks like this...
Code:
struct weaponStruct
{
float range;
flaot dmg;
flaot angle;
float weapon change delay;
and so on...
//then there is one array of classes as i said before .
weaponStruct weaponArray[670];
};
so what is this doing ?
this is making 670 weaponStruct structures
...
if we want to edit something in it it is easy just :
Code:
weaponArray[5].dmg = 125.0f;// i use 5 bcs the 5 is the index of the knife
easy one
but we make hacks here we don't have the original source out task is more difficult... we work with addresses of the arrays, variables, structures... we don't have there names (actually even if we have them i don't think we can use them
)...
so the weapon array is stored in cshell.dll... so we get its address by :
Code:
DWORD dw_Cshell = (DWORD)(GetModuleHandleA("CShell.dll"));
//or
DWORD dw_Cshell = (DWORD)(GetModuleHandleW(L"CShell.dll"));
then we need the address of the weaponArray so we find the weaponMgr in olly ![Big Grin](images/emotions/emo2.png)
Code:
#define weaponMgr 0x?????? // i don't put it bcs we want tutorial which will work for next patches :D
// then we add to dw_Cshell the ewapon mgr like this (i wont explain why there are some * there bcs it is not easy to :D)
DWORD dw_WeaonMgr *(DWORD*)(dw_CShell + weaponMgr);
then we need to pass the gun index so we know which gun we are editing... (pointing to the class on that index)
this is easy we just add the gun id multiplied by 4 bcs it is an integer and the integer needs 4 bytes in the memory so
Code:
DWORD dw_Weapon = *(DWORD*)(dw_WeaponMgr + 5*4); // i use 5 bcs 5 is the knife index and i think this will be our gun :D
see how easy it is ? but now... we need to edit some varaible in the class we just pointed to
like this
Code:
#define someAddy 0x???? // we need the offset for the variable (get it from olly or some log)
// now we need to say that we are writing to address not just adding some thing to dw_Weapon like this
*(float*)(dw_Wapon + someAddy) = some value; // thats it :D
see how easy it is ? yes but this is not all if you havent noticed there is only one gun passed the knife so only the knife will be affected by our hack feature. to fix that we need to loop trough all the weapons ofc we can do this manually like the knife but this will be tiring ![Big Grin](images/emotions/emo2.png)
so we just make loop like this
Code:
for (for int i = 0 ; i <= 670; i++)
{
}
what does this do ? this creates one variable and increases it by one until it doesn't fit the second parameter
so finally we get :
Code:
#define weaponMgr 0x??????
#define someAddy 0x????
DWORD dw_Cshell = (DWORD)(GetModuleHandelA("CShell.dll")); // getting cshell base
DWORD dw_weaponMgr = *(DWORD*)(dw_Cshell+ weaponMgr); // getting pointer to weaponArray
if (dw_weaponMgr) //we check if our array is loaded
{
for(int i = 0; i <= 670 ; i++)
{
DWORD dw_Weapon = *(DWORD*)(dw_weaponMgr+i*4); //getting pointer to the class ... for each gun one by one
if (dw_Weapon)//check if our gun is loaded :D
{
*(flaot*)(dw_Wepon+someAddy) = some value// depends on the feature... so here we change the variable :D
}
}
}
thats it it is easy
here is some picture made by me if you cant understand good ![Big Grin](images/emotions/emo2.png)
<- open in another tab to se it fully if you dont
I hope this will help many people not to leach and understand what they are doing ![Big Grin](images/emotions/emo2.png)
Press thanks if you like my tutorial ![Big Grin](images/emotions/emo2.png)
As for you minnions
I worked hard, i writed this long time, i draw the picture myself, i made the codes here specially for this thread, i exaplained everything that i can, it will help many people, and i hope that the stupid questions will disappear. So pleace give it a sickly ![Wink](images/emotions/emo10.png)
@Jigsaw, @Hannibal, @Hero, @DaRk, @BACKD00R